mirror of
https://github.com/aljazceru/nutshell.git
synced 2025-12-22 03:24:18 +01:00
Blind authentication (#675)
* auth server * cleaning up * auth ledger class * class variables -> instance variables * annotations * add models and api route * custom amount and api prefix * add auth db * blind auth token working * jwt working * clean up * JWT works * using openid connect server * use oauth server with password flow * new realm * add keycloak docker * hopefully not garbage * auth works * auth kinda working * fix cli * auth works for send and receive * pass auth_db to Wallet * auth in info * refactor * fix supported * cache mint info * fix settings and endpoints * add description to .env.example * track changes for openid connect client * store mint in db * store credentials * clean up v1_api.py * load mint info into auth wallet * fix first login * authenticate if refresh token fails * clear auth also middleware * use regex * add cli command * pw works * persist keyset amounts * add errors.py * do not start auth server if disabled in config * upadte poetry * disvoery url * fix test * support device code flow * adopt latest spec changes * fix code flow * mint max bat dynamic * mypy ignore * fix test * do not serialize amount in authproof * all auth flows working * fix tests * submodule * refactor * test * dont sleep * test * add wallet auth tests * test differently * test only keycloak for now * fix creds * daemon * fix test * install everything * install jinja * delete wallet for every test * auth: use global rate limiter * test auth rate limit * keycloak hostname * move keycloak test data * reactivate all tests * add readme * load proofs * remove unused code * remove unused code * implement change suggestions by ok300 * add error codes * test errors
This commit is contained in:
@@ -11,7 +11,6 @@ from ..core.models import (
|
||||
KeysetsResponseKeyset,
|
||||
KeysResponse,
|
||||
KeysResponseKeyset,
|
||||
MintInfoContact,
|
||||
PostCheckStateRequest,
|
||||
PostCheckStateResponse,
|
||||
PostMeltQuoteRequest,
|
||||
@@ -44,23 +43,18 @@ redis = RedisCache()
|
||||
)
|
||||
async def info() -> GetInfoResponse:
|
||||
logger.trace("> GET /v1/info")
|
||||
mint_features = ledger.mint_features()
|
||||
contact_info = [
|
||||
MintInfoContact(method=m, info=i)
|
||||
for m, i in settings.mint_info_contact
|
||||
if m and i
|
||||
]
|
||||
mint_info = ledger.mint_info
|
||||
return GetInfoResponse(
|
||||
name=settings.mint_info_name,
|
||||
pubkey=ledger.pubkey.serialize().hex() if ledger.pubkey else None,
|
||||
version=f"Nutshell/{settings.version}",
|
||||
description=settings.mint_info_description,
|
||||
description_long=settings.mint_info_description_long,
|
||||
contact=contact_info,
|
||||
nuts=mint_features,
|
||||
icon_url=settings.mint_info_icon_url,
|
||||
name=mint_info.name,
|
||||
pubkey=mint_info.pubkey,
|
||||
version=mint_info.version,
|
||||
description=mint_info.description,
|
||||
description_long=mint_info.description_long,
|
||||
contact=mint_info.contact,
|
||||
nuts=mint_info.nuts,
|
||||
icon_url=mint_info.icon_url,
|
||||
urls=settings.mint_info_urls,
|
||||
motd=settings.mint_info_motd,
|
||||
motd=mint_info.motd,
|
||||
time=int(time.time()),
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user