xtr_security_jwt ¶
Self-issued JSON Web Tokens for xtr security: encoder, token manager and authenticator.
JwtTokenManagerInterface ¶
Bases: Protocol
Mints a signed token for a user, and reads a presented one back into claims.
The manager assembles the payload — the user's roles and the claim naming who they are — enriches it, announces it for a listener to shape, signs it, and announces the finished token. Reading a token back verifies it and announces its payload, which a listener may reject.
create
async
¶
Mint a signed token for user, carrying its roles and identity.
create_from_payload
async
¶
Mint a signed token for user, starting from a caller's payload.
decode
async
¶
Read the claims out of a security token, or False when it has none.
parse
async
¶
Verify a compact token and return its claims.
Raises:
-
JwtDecodeFailureError–When the token cannot be read, has expired, or its signature does not verify.
get_user_id_claim ¶
Return the claim the user's identifier is written into.