Class swarmauri_core.tokens.ITokenService.ITokenService
swarmauri_core.tokens.ITokenService.ITokenService
Bases: ABC
Stable interface to mint and verify tokens.
Supports operations such as JSON Web Tokens (JWT) and JSON Web Signatures (JWS).
The interface keeps crypto-agnostic policy fields explicit (iss
, aud
,
exp
, scope
).
supports
abstractmethod
supports()
Return formats and algorithms supported by the service.
Source code in swarmauri_core/tokens/ITokenService.py
15 16 17 |
|
mint
abstractmethod
async
mint(
claims,
*,
alg,
kid=None,
key_version=None,
headers=None,
lifetime_s=3600,
issuer=None,
subject=None,
audience=None,
scope=None,
)
Return a compact JWS/JWT string with normalized timestamps.
Source code in swarmauri_core/tokens/ITokenService.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
|
verify
abstractmethod
async
verify(token, *, issuer=None, audience=None, leeway_s=60)
Return validated claims or raise an exception on failure.
Source code in swarmauri_core/tokens/ITokenService.py
36 37 38 39 40 41 42 43 44 45 |
|
jwks
abstractmethod
async
jwks()
Return a JWKS mapping ({"keys": [...]}
) for signing key discovery.
Source code in swarmauri_core/tokens/ITokenService.py
47 48 49 |
|