Auth
- atproto_server.auth.jwt.parse_jwt(jwt: str | bytes) Tuple[bytes, bytes, Dict[str, Any], bytes]
Parse the given JWT.
- atproto_server.auth.jwt.decode_jwt_payload(payload: str | bytes) JwtPayload
Decode the given JWT payload.
- Parameters:
payload – The JWT payload to decode.
- Returns:
The decoded payload of the given JWT.
- Return type:
- atproto_server.auth.jwt.get_jwt_payload(jwt: str) JwtPayload
Return the payload of the given JWT.
- Parameters:
jwt – The JWT to get the payload from.
- Returns:
The payload of the given JWT.
- Return type:
- atproto_server.auth.jwt.validate_jwt_payload(payload: JwtPayload, leeway: int = 0) None
Validate the given JWT payload.
- Parameters:
payload – The JWT payload to validate.
leeway – The leeway in seconds to accept when verifying time claims (exp, iat).
- Returns:
The payload is valid.
- Return type:
- Raises:
TokenDecodeError – If the given JWT is invalid.
TokenExpiredSignatureError – If the given JWT is expired.
TokenImmatureSignatureError – If the given JWT is immature.
TokenInvalidIssuedAtError – If the given JWT has invalid issued at.
- atproto_server.auth.jwt.verify_jwt(jwt: str, get_signing_key_callback: Callable[[str, bool], str], own_did: str | None = None, leeway: int = 0) JwtPayload
Verify the given JWT.
- Parameters:
jwt – The JWT to verify.
get_signing_key_callback – The callback to get the signing key.
own_did – The DID of the service (aud).
leeway – The leeway in seconds to accept when verifying time claims (exp, iat).
- Returns:
The payload of the given JWT.
- Return type:
- Raises:
TokenDecodeError – If the given JWT is invalid.
TokenExpiredSignatureError – If the given JWT is expired.
TokenImmatureSignatureError – If the given JWT is immature.
TokenInvalidAudienceError – If the given JWT has invalid audience.
TokenInvalidIssuedAtError – If the given JWT has invalid issued at.
TokenInvalidSignatureError – If the given JWT has invalid signature.
- async atproto_server.auth.jwt.verify_jwt_async(jwt: str, get_signing_key_callback: Callable[[str, bool], Coroutine[Any, Any, str]], own_did: str | None = None, leeway: int = 0) JwtPayload
Asynchronously verifies the given JWT.
- Parameters:
jwt – The JWT to verify.
get_signing_key_callback – The callback to get the signing key.
own_did – The DID of the service (aud).
leeway – The leeway in seconds to accept when verifying time claims (exp, iat).
- Returns:
The payload of the given JWT.
- Return type:
- Raises:
TokenDecodeError – If the given JWT is invalid.
TokenExpiredSignatureError – If the given JWT is expired.
TokenImmatureSignatureError – If the given JWT is immature.
TokenInvalidAudienceError – If the given JWT has invalid audience.
TokenInvalidIssuedAtError – If the given JWT has invalid issued at.
TokenInvalidSignatureError – If the given JWT has invalid signature.