diff --git a/_index/index.html b/_index/index.html
index 3abd33f..0344c91 100644
--- a/_index/index.html
+++ b/_index/index.html
@@ -167,6 +167,7 @@
Py JWT
Lightweight, explicit JWT utilities for Python services with strong validation and minimal magic.
diff --git a/config.yml b/config.yml
index 297113e..1c17f42 100644
--- a/config.yml
+++ b/config.yml
@@ -77,6 +77,7 @@ repos:
description: Lightweight, explicit JWT utilities for Python services with strong validation and minimal magic.
section: libraries
docs:
+ wiki: site
lib: site
mcp: { bundle: docs/mcp, server: jwtlib, port: 8005 }
diff --git a/mcp/py-jwt/index.json b/mcp/py-jwt/index.json
index 26deb78..b871fd4 100644
--- a/mcp/py-jwt/index.json
+++ b/mcp/py-jwt/index.json
@@ -1,5 +1,5 @@
{
- "project": "jwtlib",
+ "project": "py-jwt",
"type": "docforge-model",
"modules_count": 12,
"source": "docforge"
diff --git a/mcp/py-jwt/modules/jwtlib.app.json b/mcp/py-jwt/modules/jwtlib.app.json
index c27849e..b53302d 100644
--- a/mcp/py-jwt/modules/jwtlib.app.json
+++ b/mcp/py-jwt/modules/jwtlib.app.json
@@ -8,70 +8,70 @@
"name": "AuthError",
"kind": "class",
"path": "jwtlib.app.AuthError",
- "signature": "",
+ "signature": null,
"docstring": "Base authentication and authorization error.\n\nNotes:\n **Guarantees:**\n\n - All authentication-related exceptions raised by this library\n inherit from this class.\n - Consumers may catch this exception to handle all auth failures\n uniformly."
},
"InvalidToken": {
"name": "InvalidToken",
"kind": "class",
"path": "jwtlib.app.InvalidToken",
- "signature": "",
+ "signature": null,
"docstring": "Raised when a `JWT` is missing, malformed, expired, or invalid.\n\nNotes:\n **Guarantees:**\n\n - This error indicates that the provided token cannot be used to\n authenticate a request."
},
"IntrospectResponse": {
"name": "IntrospectResponse",
"kind": "class",
"path": "jwtlib.app.IntrospectResponse",
- "signature": "",
+ "signature": null,
"docstring": "Result of a token introspection operation.\n\nAttributes:\n active (bool):\n Indicates whether the token is valid and active.\n user (Optional[PublicUser]):\n Public user details if the token is valid; otherwise null.",
"members": {
"active": {
"name": "active",
"kind": "attribute",
"path": "jwtlib.app.IntrospectResponse.active",
- "signature": "",
+ "signature": null,
"docstring": null
},
"user": {
"name": "user",
"kind": "attribute",
"path": "jwtlib.app.IntrospectResponse.user",
- "signature": "",
+ "signature": null,
"docstring": null
},
"model_config": {
"name": "model_config",
"kind": "attribute",
"path": "jwtlib.app.IntrospectResponse.model_config",
- "signature": "",
+ "signature": null,
"docstring": null
},
"jwt_error": {
"name": "jwt_error",
"kind": "function",
"path": "jwtlib.app.IntrospectResponse.jwt_error",
- "signature": "",
+ "signature": "jwt_error(error: Any)",
"docstring": null
},
"no_username": {
"name": "no_username",
"kind": "function",
"path": "jwtlib.app.IntrospectResponse.no_username",
- "signature": "",
+ "signature": "no_username()",
"docstring": null
},
"no_user": {
"name": "no_user",
"kind": "function",
"path": "jwtlib.app.IntrospectResponse.no_user",
- "signature": "",
+ "signature": "no_user()",
"docstring": null
},
"valid_user": {
"name": "valid_user",
"kind": "function",
"path": "jwtlib.app.IntrospectResponse.valid_user",
- "signature": "",
+ "signature": "valid_user(user: Any)",
"docstring": null
}
}
@@ -80,28 +80,28 @@
"name": "LoginRequest",
"kind": "class",
"path": "jwtlib.app.LoginRequest",
- "signature": "",
+ "signature": null,
"docstring": "Payload for authenticating a user and issuing a `JWT`.\n\nAttributes:\n username (str):\n Username identifier.\n password (str):\n Plain-text password to be verified.",
"members": {
"model_config": {
"name": "model_config",
"kind": "attribute",
"path": "jwtlib.app.LoginRequest.model_config",
- "signature": "",
+ "signature": null,
"docstring": null
},
"username": {
"name": "username",
"kind": "attribute",
"path": "jwtlib.app.LoginRequest.username",
- "signature": "",
+ "signature": null,
"docstring": null
},
"password": {
"name": "password",
"kind": "attribute",
"path": "jwtlib.app.LoginRequest.password",
- "signature": "",
+ "signature": null,
"docstring": null
}
}
@@ -110,28 +110,28 @@
"name": "LoginResponse",
"kind": "class",
"path": "jwtlib.app.LoginResponse",
- "signature": "",
+ "signature": null,
"docstring": "Response returned after successful authentication.\n\nAttributes:\n access_token (str):\n `JWT` access token for authenticated requests.\n user (PublicUser):\n Public profile of the authenticated user.",
"members": {
"access_token": {
"name": "access_token",
"kind": "attribute",
"path": "jwtlib.app.LoginResponse.access_token",
- "signature": "",
+ "signature": null,
"docstring": null
},
"user": {
"name": "user",
"kind": "attribute",
"path": "jwtlib.app.LoginResponse.user",
- "signature": "",
+ "signature": null,
"docstring": null
},
"model_config": {
"name": "model_config",
"kind": "attribute",
"path": "jwtlib.app.LoginResponse.model_config",
- "signature": "",
+ "signature": null,
"docstring": null
}
}
@@ -140,21 +140,21 @@
"name": "LogoutResponse",
"kind": "class",
"path": "jwtlib.app.LogoutResponse",
- "signature": "",
+ "signature": null,
"docstring": "Response returned after a logout operation.\n\nAttributes:\n message (str):\n Human-readable logout confirmation.",
"members": {
"message": {
"name": "message",
"kind": "attribute",
"path": "jwtlib.app.LogoutResponse.message",
- "signature": "",
+ "signature": null,
"docstring": null
},
"model_config": {
"name": "model_config",
"kind": "attribute",
"path": "jwtlib.app.LogoutResponse.model_config",
- "signature": "",
+ "signature": null,
"docstring": null
}
}
@@ -163,35 +163,35 @@
"name": "PublicUser",
"kind": "class",
"path": "jwtlib.app.PublicUser",
- "signature": "",
+ "signature": null,
"docstring": "Public-facing user representation returned by authentication APIs.\n\nAttributes:\n username (str):\n Unique username identifier.\n email (EmailStr, optional):\n User's email address.\n is_active (bool):\n Whether the user account is active.",
"members": {
"model_config": {
"name": "model_config",
"kind": "attribute",
"path": "jwtlib.app.PublicUser.model_config",
- "signature": "",
+ "signature": null,
"docstring": null
},
"username": {
"name": "username",
"kind": "attribute",
"path": "jwtlib.app.PublicUser.username",
- "signature": "",
+ "signature": null,
"docstring": null
},
"email": {
"name": "email",
"kind": "attribute",
"path": "jwtlib.app.PublicUser.email",
- "signature": "",
+ "signature": null,
"docstring": null
},
"is_active": {
"name": "is_active",
"kind": "attribute",
"path": "jwtlib.app.PublicUser.is_active",
- "signature": "",
+ "signature": null,
"docstring": null
}
}
@@ -200,35 +200,35 @@
"name": "RegisterRequest",
"kind": "class",
"path": "jwtlib.app.RegisterRequest",
- "signature": "",
+ "signature": null,
"docstring": "Payload for registering a new user account.\n\nAttributes:\n username (str):\n Unique username identifier.\n email (EmailStr, optional):\n User's email address.\n password (str):\n Plain-text password (to be hashed by the repository layer).",
"members": {
"model_config": {
"name": "model_config",
"kind": "attribute",
"path": "jwtlib.app.RegisterRequest.model_config",
- "signature": "",
+ "signature": null,
"docstring": null
},
"username": {
"name": "username",
"kind": "attribute",
"path": "jwtlib.app.RegisterRequest.username",
- "signature": "",
+ "signature": null,
"docstring": null
},
"email": {
"name": "email",
"kind": "attribute",
"path": "jwtlib.app.RegisterRequest.email",
- "signature": "",
+ "signature": null,
"docstring": null
},
"password": {
"name": "password",
"kind": "attribute",
"path": "jwtlib.app.RegisterRequest.password",
- "signature": "",
+ "signature": null,
"docstring": null
}
}
@@ -237,42 +237,42 @@
"name": "UserRepository",
"kind": "class",
"path": "jwtlib.app.UserRepository",
- "signature": "",
+ "signature": "UserRepository()",
"docstring": "MongoDB-backed repository for `User` documents.\n\nNotes:\n **Responsibilities:**\n\n - Manage user persistence (CRUD).\n - Handle credential verification and token issuance.",
"members": {
"create": {
"name": "create",
"kind": "function",
"path": "jwtlib.app.UserRepository.create",
- "signature": "",
+ "signature": "create(user_create: RegisterRequest)",
"docstring": "Create a new user record.\n\nArgs:\n user_create (RegisterRequest):\n Registration data including prospective password.\n\nReturns:\n PublicUser:\n A PublicUser representation of the created user."
},
"get_by_username": {
"name": "get_by_username",
"kind": "function",
"path": "jwtlib.app.UserRepository.get_by_username",
- "signature": "",
+ "signature": "get_by_username(username: str)",
"docstring": "Retrieve a user by their unique username.\n\nArgs:\n username (str):\n The username to search for.\n\nReturns:\n User | None:\n The User document if found, otherwise None."
},
"get_by_email": {
"name": "get_by_email",
"kind": "function",
"path": "jwtlib.app.UserRepository.get_by_email",
- "signature": "",
+ "signature": "get_by_email(email: str)",
"docstring": "Retrieve a user by their unique email address.\n\nArgs:\n email (str):\n The email address to search for.\n\nReturns:\n User | None:\n The User document if found, otherwise None."
},
"get_active_users": {
"name": "get_active_users",
"kind": "function",
"path": "jwtlib.app.UserRepository.get_active_users",
- "signature": "",
+ "signature": "get_active_users(skip: int = 0, limit: int = 100)",
"docstring": "List all active users with pagination.\n\nArgs:\n skip (int):\n Number of records to skip.\n limit (int):\n Maximum number of records to return.\n\nReturns:\n list[User]:\n A list of active User documents."
},
"authenticate_user": {
"name": "authenticate_user",
"kind": "function",
"path": "jwtlib.app.UserRepository.authenticate_user",
- "signature": "",
+ "signature": "authenticate_user(user_auth: LoginRequest)",
"docstring": "Verify user credentials and prepare a login response.\n\nArgs:\n user_auth (LoginRequest):\n Login credentials.\n\nReturns:\n dict | None:\n A dictionary containing the access token and public user if successful, otherwise None."
}
}
@@ -281,56 +281,56 @@
"name": "get_current_user",
"kind": "function",
"path": "jwtlib.app.get_current_user",
- "signature": "",
+ "signature": "get_current_user(token: str, repo: UserRepository | None = None)",
"docstring": "Validate token and return authenticated public user.\n\nArgs:\n token (str):\n The `JWT` string to validate.\n repo (UserRepository | None):\n The user repository to use for resolution.\n\nReturns:\n PublicUser:\n The resolved and validated user object.\n\nRaises:\n InvalidToken:\n If the token is missing, malformed, or invalid.\n UserNotFound:\n If the token is valid, but the user does not exist in the\n repository."
},
"get_user_repository": {
"name": "get_user_repository",
"kind": "function",
"path": "jwtlib.app.get_user_repository",
- "signature": "",
+ "signature": "get_user_repository()",
"docstring": "Return a singleton or new instance of the `UserRepository`.\n\nReturns:\n UserRepository:\n The user repository instance."
},
"get_validated_token_payload": {
"name": "get_validated_token_payload",
"kind": "function",
"path": "jwtlib.app.get_validated_token_payload",
- "signature": "",
+ "signature": "get_validated_token_payload(token: str)",
"docstring": "Validate a `JWT` and return a typed payload.\n\nArgs:\n token (str):\n The `JWT` string to validate.\n\nReturns:\n TokenPayload:\n The validated and typed token payload.\n\nRaises:\n JWTError:\n If the token is invalid or malformed."
},
"register_user": {
"name": "register_user",
"kind": "function",
"path": "jwtlib.app.register_user",
- "signature": "",
+ "signature": "register_user(user: RegisterRequest, repo: UserRepository | None = None) -> PublicUser",
"docstring": "Register a new user.\n\nArgs:\n user (RegisterRequest):\n Registration payload containing username, email, and password.\n repo (UserRepository | None):\n Optional user repository instance. If not provided, a default\n repository is obtained via dependency utilities.\n\nReturns:\n PublicUser:\n The newly created user as a public user representation."
},
"login_user": {
"name": "login_user",
"kind": "function",
"path": "jwtlib.app.login_user",
- "signature": "",
+ "signature": "login_user(user: LoginRequest, repo: UserRepository | None = None) -> LoginResponse",
"docstring": "Authenticate a user and issue an access token.\n\nArgs:\n user (LoginRequest):\n Login payload containing username and password.\n repo (UserRepository | None):\n Optional user repository instance. If not provided, a default\n repository is obtained via dependency utilities.\n\nReturns:\n LoginResponse:\n `LoginResponse` containing the issued access token and related\n metadata.\n\nRaises:\n AuthError:\n If the credentials are invalid."
},
"get_logged_in_user": {
"name": "get_logged_in_user",
"kind": "function",
"path": "jwtlib.app.get_logged_in_user",
- "signature": "",
+ "signature": "get_logged_in_user(token: str, repo: UserRepository | None = None) -> PublicUser",
"docstring": "Resolve the currently authenticated user from a `JWT`.\n\nArgs:\n token (str):\n `JWT` access token.\n repo (UserRepository | None):\n Optional user repository instance. If not provided, a default\n repository is obtained via dependency utilities.\n\nReturns:\n PublicUser:\n The authenticated user as a `PublicUser`.\n\nRaises:\n InvalidToken:\n If the token is missing, malformed, or invalid.\n AuthError:\n If the token is valid, but the user cannot be resolved."
},
"logout_user": {
"name": "logout_user",
"kind": "function",
"path": "jwtlib.app.logout_user",
- "signature": "",
+ "signature": "logout_user() -> LogoutResponse",
"docstring": "Perform a stateless logout.\n\nReturns:\n LogoutResponse:\n `LogoutResponse` containing a logout confirmation message.\n\nNotes:\n **Guarantees:**\n\n - This function does not invalidate tokens server-side. Instead, it\n provides a standardized response indicating that the client must\n discard its token."
},
"introspect_token": {
"name": "introspect_token",
"kind": "function",
"path": "jwtlib.app.introspect_token",
- "signature": "",
+ "signature": "introspect_token(token: str, repo: UserRepository | None = None) -> IntrospectResponse",
"docstring": "Introspect a `JWT` for service-to-service authentication.\n\nArgs:\n token (str):\n `JWT` access token to introspect.\n repo (UserRepository | None):\n Optional user repository instance. If not provided, a default\n repository is obtained via dependency utilities.\n\nReturns:\n IntrospectResponse:\n `IntrospectResponse` indicating valid token with user, invalid\n token, or valid token with no user.\n\nNotes:\n **Responsibilities:**\n\n - Validate the provided token and resolve the associated user,\n returning a structured introspection response suitable for\n internal service use.\n\n **Guarantees:**\n\n - This function never raises authentication exceptions. Instead, it\n returns a typed response indicating token validity and user\n presence."
}
}
diff --git a/mcp/py-jwt/modules/jwtlib.exceptions.json b/mcp/py-jwt/modules/jwtlib.exceptions.json
index 4abf029..e0368c8 100644
--- a/mcp/py-jwt/modules/jwtlib.exceptions.json
+++ b/mcp/py-jwt/modules/jwtlib.exceptions.json
@@ -8,42 +8,42 @@
"name": "AuthError",
"kind": "class",
"path": "jwtlib.exceptions.AuthError",
- "signature": "",
+ "signature": null,
"docstring": "Base authentication and authorization error.\n\nNotes:\n **Guarantees:**\n\n - All authentication-related exceptions raised by this library\n inherit from this class.\n - Consumers may catch this exception to handle all auth failures\n uniformly."
},
"InvalidToken": {
"name": "InvalidToken",
"kind": "class",
"path": "jwtlib.exceptions.InvalidToken",
- "signature": "",
+ "signature": null,
"docstring": "Raised when a `JWT` is missing, malformed, expired, or invalid.\n\nNotes:\n **Guarantees:**\n\n - This error indicates that the provided token cannot be used to\n authenticate a request."
},
"InvalidAuthorizationHeader": {
"name": "InvalidAuthorizationHeader",
"kind": "class",
"path": "jwtlib.exceptions.InvalidAuthorizationHeader",
- "signature": "",
+ "signature": null,
"docstring": "Raised when the `Authorization` header is missing or incorrectly\nformatted.\n\nNotes:\n **Guarantees:**\n\n - Indicates that the header is not present or does not follow the\n expected `Bearer ` format."
},
"UserNotFound": {
"name": "UserNotFound",
"kind": "class",
"path": "jwtlib.exceptions.UserNotFound",
- "signature": "",
+ "signature": null,
"docstring": "Raised when a valid token does not map to an existing user.\n\nNotes:\n **Guarantees:**\n\n - Indicates that authentication succeeded at the token level, but\n the associated user record could not be resolved."
},
"AuthServiceUnavailable": {
"name": "AuthServiceUnavailable",
"kind": "class",
"path": "jwtlib.exceptions.AuthServiceUnavailable",
- "signature": "",
+ "signature": null,
"docstring": "Raised when the authentication service cannot be reached.\n\nNotes:\n **Guarantees:**\n\n - Indicates a network failure, timeout, or unexpected error while\n communicating with the auth service."
},
"NotAuthenticated": {
"name": "NotAuthenticated",
"kind": "class",
"path": "jwtlib.exceptions.NotAuthenticated",
- "signature": "",
+ "signature": null,
"docstring": "Raised when authentication is required but no user context is present.\n\nNotes:\n **Guarantees:**\n\n - Typically used when attempting to access a protected operation\n without an authenticated user."
}
}
diff --git a/mcp/py-jwt/modules/jwtlib.introspection.json b/mcp/py-jwt/modules/jwtlib.introspection.json
index 40d1cc8..012df1a 100644
--- a/mcp/py-jwt/modules/jwtlib.introspection.json
+++ b/mcp/py-jwt/modules/jwtlib.introspection.json
@@ -4,81 +4,53 @@
"path": "jwtlib.introspection",
"docstring": "# Summary\n\nAuth client and access-control utilities.\n\nThis module provides **pure authentication and authorization logic**\nfor validating JWTs via service-to-service introspection and resolving\nauthenticated users.\n\nNotes:\n **Responsibilities:**\n\n - Calling the auth service introspection endpoint\n - Translating introspection responses into typed user models\n - Enforcing access control decisions at the logic layer\n\n **Constraints:**\n\n - This module intentionally does NOT: Parse HTTP requests or headers, implement authentication policies, or perform JWT signature verification locally.",
"objects": {
- "os": {
- "name": "os",
- "kind": "alias",
- "path": "jwtlib.introspection.os",
- "signature": "",
- "docstring": null
- },
- "Callable": {
- "name": "Callable",
- "kind": "alias",
- "path": "jwtlib.introspection.Callable",
- "signature": "",
- "docstring": null
- },
- "Any": {
- "name": "Any",
- "kind": "alias",
- "path": "jwtlib.introspection.Any",
- "signature": "",
- "docstring": null
- },
- "httpx": {
- "name": "httpx",
- "kind": "alias",
- "path": "jwtlib.introspection.httpx",
- "signature": "",
- "docstring": null
- },
"AuthServiceUnavailable": {
"name": "AuthServiceUnavailable",
"kind": "class",
"path": "jwtlib.introspection.AuthServiceUnavailable",
- "signature": "",
+ "signature": null,
"docstring": "Raised when the authentication service cannot be reached.\n\nNotes:\n **Guarantees:**\n\n - Indicates a network failure, timeout, or unexpected error while\n communicating with the auth service."
},
"InvalidToken": {
"name": "InvalidToken",
"kind": "class",
"path": "jwtlib.introspection.InvalidToken",
- "signature": "",
+ "signature": null,
"docstring": "Raised when a `JWT` is missing, malformed, expired, or invalid.\n\nNotes:\n **Guarantees:**\n\n - This error indicates that the provided token cannot be used to\n authenticate a request."
},
"PublicUser": {
"name": "PublicUser",
"kind": "class",
"path": "jwtlib.introspection.PublicUser",
- "signature": "",
+ "signature": null,
"docstring": "Public-facing user representation returned by authentication APIs.\n\nAttributes:\n username (str):\n Unique username identifier.\n email (EmailStr, optional):\n User's email address.\n is_active (bool):\n Whether the user account is active.",
"members": {
"model_config": {
"name": "model_config",
"kind": "attribute",
"path": "jwtlib.introspection.PublicUser.model_config",
- "signature": "",
+ "signature": null,
"docstring": null
},
"username": {
"name": "username",
"kind": "attribute",
"path": "jwtlib.introspection.PublicUser.username",
- "signature": "",
+ "signature": null,
"docstring": null
},
"email": {
"name": "email",
"kind": "attribute",
"path": "jwtlib.introspection.PublicUser.email",
- "signature": "",
+ "signature": null,
"docstring": null
},
"is_active": {
"name": "is_active",
"kind": "attribute",
"path": "jwtlib.introspection.PublicUser.is_active",
- "signature": "",
+ "signature": null,
"docstring": null
}
}
@@ -101,14 +73,14 @@
"name": "introspect_token",
"kind": "function",
"path": "jwtlib.introspection.introspect_token",
- "signature": "",
+ "signature": "introspect_token(token: str) -> dict[str, Any]",
"docstring": "Introspect a JWT using the external authentication service.\n\nArgs:\n token (str):\n JWT access token to introspect.\n\nReturns:\n dict[str, Any]:\n A dictionary containing the authenticated user's public payload.\n\nRaises:\n InvalidToken:\n If the token is missing, invalid, inactive, or revoked.\n AuthServiceUnavailable:\n If the auth service cannot be reached or fails unexpectedly.\n\nNotes:\n **Guarantees:**\n\n - This function treats the auth service as the source of truth. No local JWT validation or signature checking is performed here. The returned payload is expected to be safe for public exposure."
},
"authenticate_request": {
"name": "authenticate_request",
"kind": "function",
"path": "jwtlib.introspection.authenticate_request",
- "signature": "",
+ "signature": "authenticate_request(should_skip_authentication: Callable[[str, str], bool], *, method: str, path: str, authorization_token: str | None) -> PublicUser | None",
"docstring": "Authenticate an incoming request using token introspection.\n\nArgs:\n should_skip_authentication (Callable[[str, str], bool]):\n Callable that decides whether authentication is required for a given HTTP method and path.\n method (str):\n HTTP method of the incoming request.\n path (str):\n Request path.\n authorization_token (str | None):\n JWT access token provided by the caller.\n\nReturns:\n PublicUser | None:\n PublicUser if authentication succeeds; None if authentication is skipped.\n\nRaises:\n InvalidToken:\n If authentication is required but the token is missing, invalid, or revoked.\n AuthServiceUnavailable:\n If the auth service cannot be reached.\n\nNotes:\n **Responsibilities:**\n\n - Determines whether authentication should be skipped for the given request context and, if not, resolves the authenticated user via token introspection\n\n **Guarantees:**\n\n - This function does not parse Authorization headers; callers must supply the raw token. Access-control policy is externalized via `should_skip_authentication`."
}
}
diff --git a/mcp/py-jwt/modules/jwtlib.json b/mcp/py-jwt/modules/jwtlib.json
index 58a7bae..40ab120 100644
--- a/mcp/py-jwt/modules/jwtlib.json
+++ b/mcp/py-jwt/modules/jwtlib.json
@@ -8,14 +8,14 @@
"name": "User",
"kind": "class",
"path": "jwtlib.User",
- "signature": "",
+ "signature": null,
"docstring": "Internal user persistence model.\n\nAttributes:\n hashed_password (str):\n Secure hash of the user's password.\n\nNotes:\n **Responsibilities:**\n\n - Represents a user record as stored in the database. Includes\n sensitive fields and is strictly confined to the persistence\n layer.\n\n **Guarantees:**\n\n - This model MUST NOT be returned from authentication APIs.\n Consumers should use `PublicUser` instead. Password verification\n is handled by the repository layer.",
"members": {
"hashed_password": {
"name": "hashed_password",
"kind": "attribute",
"path": "jwtlib.User.hashed_password",
- "signature": "",
+ "signature": null,
"docstring": null
}
}
@@ -24,35 +24,35 @@
"name": "RegisterRequest",
"kind": "class",
"path": "jwtlib.RegisterRequest",
- "signature": "",
+ "signature": null,
"docstring": "Payload for registering a new user account.\n\nAttributes:\n username (str):\n Unique username identifier.\n email (EmailStr, optional):\n User's email address.\n password (str):\n Plain-text password (to be hashed by the repository layer).",
"members": {
"model_config": {
"name": "model_config",
"kind": "attribute",
"path": "jwtlib.RegisterRequest.model_config",
- "signature": "",
+ "signature": null,
"docstring": null
},
"username": {
"name": "username",
"kind": "attribute",
"path": "jwtlib.RegisterRequest.username",
- "signature": "",
+ "signature": null,
"docstring": null
},
"email": {
"name": "email",
"kind": "attribute",
"path": "jwtlib.RegisterRequest.email",
- "signature": "",
+ "signature": null,
"docstring": null
},
"password": {
"name": "password",
"kind": "attribute",
"path": "jwtlib.RegisterRequest.password",
- "signature": "",
+ "signature": null,
"docstring": null
}
}
@@ -61,28 +61,28 @@
"name": "LoginRequest",
"kind": "class",
"path": "jwtlib.LoginRequest",
- "signature": "",
+ "signature": null,
"docstring": "Payload for authenticating a user and issuing a `JWT`.\n\nAttributes:\n username (str):\n Username identifier.\n password (str):\n Plain-text password to be verified.",
"members": {
"model_config": {
"name": "model_config",
"kind": "attribute",
"path": "jwtlib.LoginRequest.model_config",
- "signature": "",
+ "signature": null,
"docstring": null
},
"username": {
"name": "username",
"kind": "attribute",
"path": "jwtlib.LoginRequest.username",
- "signature": "",
+ "signature": null,
"docstring": null
},
"password": {
"name": "password",
"kind": "attribute",
"path": "jwtlib.LoginRequest.password",
- "signature": "",
+ "signature": null,
"docstring": null
}
}
@@ -91,28 +91,28 @@
"name": "LoginResponse",
"kind": "class",
"path": "jwtlib.LoginResponse",
- "signature": "",
+ "signature": null,
"docstring": "Response returned after successful authentication.\n\nAttributes:\n access_token (str):\n `JWT` access token for authenticated requests.\n user (PublicUser):\n Public profile of the authenticated user.",
"members": {
"access_token": {
"name": "access_token",
"kind": "attribute",
"path": "jwtlib.LoginResponse.access_token",
- "signature": "",
+ "signature": null,
"docstring": null
},
"user": {
"name": "user",
"kind": "attribute",
"path": "jwtlib.LoginResponse.user",
- "signature": "",
+ "signature": null,
"docstring": null
},
"model_config": {
"name": "model_config",
"kind": "attribute",
"path": "jwtlib.LoginResponse.model_config",
- "signature": "",
+ "signature": null,
"docstring": null
}
}
@@ -121,21 +121,21 @@
"name": "LogoutResponse",
"kind": "class",
"path": "jwtlib.LogoutResponse",
- "signature": "",
+ "signature": null,
"docstring": "Response returned after a logout operation.\n\nAttributes:\n message (str):\n Human-readable logout confirmation.",
"members": {
"message": {
"name": "message",
"kind": "attribute",
"path": "jwtlib.LogoutResponse.message",
- "signature": "",
+ "signature": null,
"docstring": null
},
"model_config": {
"name": "model_config",
"kind": "attribute",
"path": "jwtlib.LogoutResponse.model_config",
- "signature": "",
+ "signature": null,
"docstring": null
}
}
@@ -144,35 +144,35 @@
"name": "PublicUser",
"kind": "class",
"path": "jwtlib.PublicUser",
- "signature": "",
+ "signature": null,
"docstring": "Public-facing user representation returned by authentication APIs.\n\nAttributes:\n username (str):\n Unique username identifier.\n email (EmailStr, optional):\n User's email address.\n is_active (bool):\n Whether the user account is active.",
"members": {
"model_config": {
"name": "model_config",
"kind": "attribute",
"path": "jwtlib.PublicUser.model_config",
- "signature": "",
+ "signature": null,
"docstring": null
},
"username": {
"name": "username",
"kind": "attribute",
"path": "jwtlib.PublicUser.username",
- "signature": "",
+ "signature": null,
"docstring": null
},
"email": {
"name": "email",
"kind": "attribute",
"path": "jwtlib.PublicUser.email",
- "signature": "",
+ "signature": null,
"docstring": null
},
"is_active": {
"name": "is_active",
"kind": "attribute",
"path": "jwtlib.PublicUser.is_active",
- "signature": "",
+ "signature": null,
"docstring": null
}
}
@@ -181,21 +181,21 @@
"name": "TokenPayload",
"kind": "class",
"path": "jwtlib.TokenPayload",
- "signature": "",
+ "signature": null,
"docstring": "Decoded `JWT` payload.\n\nAttributes:\n sub (str):\n Subject claim identifying the user (typically a username or user ID).\n exp (int):\n Expiration time as a Unix timestamp (seconds since epoch).\n\nNotes:\n **Responsibilities:**\n\n - Represents the validated claims extracted from a `JWT` after\n signature verification. This model is used internally to enforce\n required claims and provide a typed interface to token data.\n\n **Guarantees:**\n\n - This model assumes the `JWT` signature has already been verified.\n No authorization decisions should be made solely on this model.\n Additional claims may exist but are intentionally ignored.",
"members": {
"sub": {
"name": "sub",
"kind": "attribute",
"path": "jwtlib.TokenPayload.sub",
- "signature": "",
+ "signature": null,
"docstring": null
},
"exp": {
"name": "exp",
"kind": "attribute",
"path": "jwtlib.TokenPayload.exp",
- "signature": "",
+ "signature": null,
"docstring": null
}
}
@@ -204,21 +204,21 @@
"name": "IntrospectRequest",
"kind": "class",
"path": "jwtlib.IntrospectRequest",
- "signature": "",
+ "signature": null,
"docstring": "Payload for requesting token introspection.\n\nAttributes:\n token (str):\n `JWT` access token to introspect.",
"members": {
"token": {
"name": "token",
"kind": "attribute",
"path": "jwtlib.IntrospectRequest.token",
- "signature": "",
+ "signature": null,
"docstring": null
},
"model_config": {
"name": "model_config",
"kind": "attribute",
"path": "jwtlib.IntrospectRequest.model_config",
- "signature": "",
+ "signature": null,
"docstring": null
}
}
@@ -227,56 +227,56 @@
"name": "IntrospectResponse",
"kind": "class",
"path": "jwtlib.IntrospectResponse",
- "signature": "",
+ "signature": null,
"docstring": "Result of a token introspection operation.\n\nAttributes:\n active (bool):\n Indicates whether the token is valid and active.\n user (Optional[PublicUser]):\n Public user details if the token is valid; otherwise null.",
"members": {
"active": {
"name": "active",
"kind": "attribute",
"path": "jwtlib.IntrospectResponse.active",
- "signature": "",
+ "signature": null,
"docstring": null
},
"user": {
"name": "user",
"kind": "attribute",
"path": "jwtlib.IntrospectResponse.user",
- "signature": "",
+ "signature": null,
"docstring": null
},
"model_config": {
"name": "model_config",
"kind": "attribute",
"path": "jwtlib.IntrospectResponse.model_config",
- "signature": "",
+ "signature": null,
"docstring": null
},
"jwt_error": {
"name": "jwt_error",
"kind": "function",
"path": "jwtlib.IntrospectResponse.jwt_error",
- "signature": "",
+ "signature": "jwt_error(error: Any)",
"docstring": null
},
"no_username": {
"name": "no_username",
"kind": "function",
"path": "jwtlib.IntrospectResponse.no_username",
- "signature": "",
+ "signature": "no_username()",
"docstring": null
},
"no_user": {
"name": "no_user",
"kind": "function",
"path": "jwtlib.IntrospectResponse.no_user",
- "signature": "",
+ "signature": "no_user()",
"docstring": null
},
"valid_user": {
"name": "valid_user",
"kind": "function",
"path": "jwtlib.IntrospectResponse.valid_user",
- "signature": "",
+ "signature": "valid_user(user: Any)",
"docstring": null
}
}
@@ -285,63 +285,63 @@
"name": "register_user",
"kind": "function",
"path": "jwtlib.register_user",
- "signature": "",
+ "signature": "register_user(user: RegisterRequest, repo: UserRepository | None = None)",
"docstring": "Register a new user.\n\nArgs:\n user (RegisterRequest):\n Registration payload containing username, email, and password.\n repo (UserRepository | None):\n Optional user repository instance. If not provided, a default\n repository is obtained via dependency utilities.\n\nReturns:\n PublicUser:\n The newly created user as a public user representation."
},
"login_user": {
"name": "login_user",
"kind": "function",
"path": "jwtlib.login_user",
- "signature": "",
+ "signature": "login_user(user: LoginRequest, repo: UserRepository | None = None)",
"docstring": "Authenticate a user and issue an access token.\n\nArgs:\n user (LoginRequest):\n Login payload containing username and password.\n repo (UserRepository | None):\n Optional user repository instance. If not provided, a default\n repository is obtained via dependency utilities.\n\nReturns:\n LoginResponse:\n `LoginResponse` containing the issued access token and related\n metadata.\n\nRaises:\n AuthError:\n If the credentials are invalid."
},
"get_logged_in_user": {
"name": "get_logged_in_user",
"kind": "function",
"path": "jwtlib.get_logged_in_user",
- "signature": "",
+ "signature": "get_logged_in_user(token: str, repo: UserRepository | None = None)",
"docstring": "Resolve the currently authenticated user from a `JWT`.\n\nArgs:\n token (str):\n `JWT` access token.\n repo (UserRepository | None):\n Optional user repository instance. If not provided, a default\n repository is obtained via dependency utilities.\n\nReturns:\n PublicUser:\n The authenticated user as a `PublicUser`.\n\nRaises:\n InvalidToken:\n If the token is missing, malformed, or invalid.\n AuthError:\n If the token is valid, but the user cannot be resolved."
},
"logout_user": {
"name": "logout_user",
"kind": "function",
"path": "jwtlib.logout_user",
- "signature": "",
+ "signature": "logout_user()",
"docstring": "Perform a stateless logout.\n\nReturns:\n LogoutResponse:\n `LogoutResponse` containing a logout confirmation message.\n\nNotes:\n **Guarantees:**\n\n - This function does not invalidate tokens server-side. Instead, it\n provides a standardized response indicating that the client must\n discard its token."
},
"introspect_token": {
"name": "introspect_token",
"kind": "function",
"path": "jwtlib.introspect_token",
- "signature": "",
+ "signature": "introspect_token(token: str, repo: UserRepository | None = None)",
"docstring": "Introspect a `JWT` for service-to-service authentication.\n\nArgs:\n token (str):\n `JWT` access token to introspect.\n repo (UserRepository | None):\n Optional user repository instance. If not provided, a default\n repository is obtained via dependency utilities.\n\nReturns:\n IntrospectResponse:\n `IntrospectResponse` indicating valid token with user, invalid\n token, or valid token with no user.\n\nNotes:\n **Responsibilities:**\n\n - Validate the provided token and resolve the associated user,\n returning a structured introspection response suitable for\n internal service use.\n\n **Guarantees:**\n\n - This function never raises authentication exceptions. Instead, it\n returns a typed response indicating token validity and user\n presence."
},
"authenticate_request": {
"name": "authenticate_request",
"kind": "function",
"path": "jwtlib.authenticate_request",
- "signature": "",
+ "signature": "authenticate_request(should_skip_authentication: Callable[[str, str], bool], *, method: str, path: str, authorization_token: str | None)",
"docstring": "Authenticate an incoming request using token introspection.\n\nArgs:\n should_skip_authentication (Callable[[str, str], bool]):\n Callable that decides whether authentication is required for a given HTTP method and path.\n method (str):\n HTTP method of the incoming request.\n path (str):\n Request path.\n authorization_token (str | None):\n JWT access token provided by the caller.\n\nReturns:\n PublicUser | None:\n PublicUser if authentication succeeds; None if authentication is skipped.\n\nRaises:\n InvalidToken:\n If authentication is required but the token is missing, invalid, or revoked.\n AuthServiceUnavailable:\n If the auth service cannot be reached.\n\nNotes:\n **Responsibilities:**\n\n - Determines whether authentication should be skipped for the given request context and, if not, resolves the authenticated user via token introspection\n\n **Guarantees:**\n\n - This function does not parse Authorization headers; callers must supply the raw token. Access-control policy is externalized via `should_skip_authentication`."
},
"AuthError": {
"name": "AuthError",
"kind": "class",
"path": "jwtlib.AuthError",
- "signature": "",
+ "signature": null,
"docstring": "Base authentication and authorization error.\n\nNotes:\n **Guarantees:**\n\n - All authentication-related exceptions raised by this library\n inherit from this class.\n - Consumers may catch this exception to handle all auth failures\n uniformly."
},
"InvalidToken": {
"name": "InvalidToken",
"kind": "class",
"path": "jwtlib.InvalidToken",
- "signature": "",
+ "signature": null,
"docstring": "Raised when a `JWT` is missing, malformed, expired, or invalid.\n\nNotes:\n **Guarantees:**\n\n - This error indicates that the provided token cannot be used to\n authenticate a request."
},
"UserNotFound": {
"name": "UserNotFound",
"kind": "class",
"path": "jwtlib.UserNotFound",
- "signature": "",
+ "signature": null,
"docstring": "Raised when a valid token does not map to an existing user.\n\nNotes:\n **Guarantees:**\n\n - Indicates that authentication succeeded at the token level, but\n the associated user record could not be resolved."
},
"app": {
@@ -355,70 +355,70 @@
"name": "AuthError",
"kind": "class",
"path": "jwtlib.app.AuthError",
- "signature": "",
+ "signature": null,
"docstring": "Base authentication and authorization error.\n\nNotes:\n **Guarantees:**\n\n - All authentication-related exceptions raised by this library\n inherit from this class.\n - Consumers may catch this exception to handle all auth failures\n uniformly."
},
"InvalidToken": {
"name": "InvalidToken",
"kind": "class",
"path": "jwtlib.app.InvalidToken",
- "signature": "",
+ "signature": null,
"docstring": "Raised when a `JWT` is missing, malformed, expired, or invalid.\n\nNotes:\n **Guarantees:**\n\n - This error indicates that the provided token cannot be used to\n authenticate a request."
},
"IntrospectResponse": {
"name": "IntrospectResponse",
"kind": "class",
"path": "jwtlib.app.IntrospectResponse",
- "signature": "",
+ "signature": null,
"docstring": "Result of a token introspection operation.\n\nAttributes:\n active (bool):\n Indicates whether the token is valid and active.\n user (Optional[PublicUser]):\n Public user details if the token is valid; otherwise null.",
"members": {
"active": {
"name": "active",
"kind": "attribute",
"path": "jwtlib.app.IntrospectResponse.active",
- "signature": "",
+ "signature": null,
"docstring": null
},
"user": {
"name": "user",
"kind": "attribute",
"path": "jwtlib.app.IntrospectResponse.user",
- "signature": "",
+ "signature": null,
"docstring": null
},
"model_config": {
"name": "model_config",
"kind": "attribute",
"path": "jwtlib.app.IntrospectResponse.model_config",
- "signature": "",
+ "signature": null,
"docstring": null
},
"jwt_error": {
"name": "jwt_error",
"kind": "function",
"path": "jwtlib.app.IntrospectResponse.jwt_error",
- "signature": "",
+ "signature": "jwt_error(error: Any)",
"docstring": null
},
"no_username": {
"name": "no_username",
"kind": "function",
"path": "jwtlib.app.IntrospectResponse.no_username",
- "signature": "",
+ "signature": "no_username()",
"docstring": null
},
"no_user": {
"name": "no_user",
"kind": "function",
"path": "jwtlib.app.IntrospectResponse.no_user",
- "signature": "",
+ "signature": "no_user()",
"docstring": null
},
"valid_user": {
"name": "valid_user",
"kind": "function",
"path": "jwtlib.app.IntrospectResponse.valid_user",
- "signature": "",
+ "signature": "valid_user(user: Any)",
"docstring": null
}
}
@@ -427,28 +427,28 @@
"name": "LoginRequest",
"kind": "class",
"path": "jwtlib.app.LoginRequest",
- "signature": "",
+ "signature": null,
"docstring": "Payload for authenticating a user and issuing a `JWT`.\n\nAttributes:\n username (str):\n Username identifier.\n password (str):\n Plain-text password to be verified.",
"members": {
"model_config": {
"name": "model_config",
"kind": "attribute",
"path": "jwtlib.app.LoginRequest.model_config",
- "signature": "",
+ "signature": null,
"docstring": null
},
"username": {
"name": "username",
"kind": "attribute",
"path": "jwtlib.app.LoginRequest.username",
- "signature": "",
+ "signature": null,
"docstring": null
},
"password": {
"name": "password",
"kind": "attribute",
"path": "jwtlib.app.LoginRequest.password",
- "signature": "",
+ "signature": null,
"docstring": null
}
}
@@ -457,28 +457,28 @@
"name": "LoginResponse",
"kind": "class",
"path": "jwtlib.app.LoginResponse",
- "signature": "",
+ "signature": null,
"docstring": "Response returned after successful authentication.\n\nAttributes:\n access_token (str):\n `JWT` access token for authenticated requests.\n user (PublicUser):\n Public profile of the authenticated user.",
"members": {
"access_token": {
"name": "access_token",
"kind": "attribute",
"path": "jwtlib.app.LoginResponse.access_token",
- "signature": "",
+ "signature": null,
"docstring": null
},
"user": {
"name": "user",
"kind": "attribute",
"path": "jwtlib.app.LoginResponse.user",
- "signature": "",
+ "signature": null,
"docstring": null
},
"model_config": {
"name": "model_config",
"kind": "attribute",
"path": "jwtlib.app.LoginResponse.model_config",
- "signature": "",
+ "signature": null,
"docstring": null
}
}
@@ -487,21 +487,21 @@
"name": "LogoutResponse",
"kind": "class",
"path": "jwtlib.app.LogoutResponse",
- "signature": "",
+ "signature": null,
"docstring": "Response returned after a logout operation.\n\nAttributes:\n message (str):\n Human-readable logout confirmation.",
"members": {
"message": {
"name": "message",
"kind": "attribute",
"path": "jwtlib.app.LogoutResponse.message",
- "signature": "",
+ "signature": null,
"docstring": null
},
"model_config": {
"name": "model_config",
"kind": "attribute",
"path": "jwtlib.app.LogoutResponse.model_config",
- "signature": "",
+ "signature": null,
"docstring": null
}
}
@@ -510,35 +510,35 @@
"name": "PublicUser",
"kind": "class",
"path": "jwtlib.app.PublicUser",
- "signature": "",
+ "signature": null,
"docstring": "Public-facing user representation returned by authentication APIs.\n\nAttributes:\n username (str):\n Unique username identifier.\n email (EmailStr, optional):\n User's email address.\n is_active (bool):\n Whether the user account is active.",
"members": {
"model_config": {
"name": "model_config",
"kind": "attribute",
"path": "jwtlib.app.PublicUser.model_config",
- "signature": "",
+ "signature": null,
"docstring": null
},
"username": {
"name": "username",
"kind": "attribute",
"path": "jwtlib.app.PublicUser.username",
- "signature": "",
+ "signature": null,
"docstring": null
},
"email": {
"name": "email",
"kind": "attribute",
"path": "jwtlib.app.PublicUser.email",
- "signature": "",
+ "signature": null,
"docstring": null
},
"is_active": {
"name": "is_active",
"kind": "attribute",
"path": "jwtlib.app.PublicUser.is_active",
- "signature": "",
+ "signature": null,
"docstring": null
}
}
@@ -547,35 +547,35 @@
"name": "RegisterRequest",
"kind": "class",
"path": "jwtlib.app.RegisterRequest",
- "signature": "",
+ "signature": null,
"docstring": "Payload for registering a new user account.\n\nAttributes:\n username (str):\n Unique username identifier.\n email (EmailStr, optional):\n User's email address.\n password (str):\n Plain-text password (to be hashed by the repository layer).",
"members": {
"model_config": {
"name": "model_config",
"kind": "attribute",
"path": "jwtlib.app.RegisterRequest.model_config",
- "signature": "",
+ "signature": null,
"docstring": null
},
"username": {
"name": "username",
"kind": "attribute",
"path": "jwtlib.app.RegisterRequest.username",
- "signature": "",
+ "signature": null,
"docstring": null
},
"email": {
"name": "email",
"kind": "attribute",
"path": "jwtlib.app.RegisterRequest.email",
- "signature": "",
+ "signature": null,
"docstring": null
},
"password": {
"name": "password",
"kind": "attribute",
"path": "jwtlib.app.RegisterRequest.password",
- "signature": "",
+ "signature": null,
"docstring": null
}
}
@@ -584,42 +584,42 @@
"name": "UserRepository",
"kind": "class",
"path": "jwtlib.app.UserRepository",
- "signature": "",
+ "signature": "UserRepository()",
"docstring": "MongoDB-backed repository for `User` documents.\n\nNotes:\n **Responsibilities:**\n\n - Manage user persistence (CRUD).\n - Handle credential verification and token issuance.",
"members": {
"create": {
"name": "create",
"kind": "function",
"path": "jwtlib.app.UserRepository.create",
- "signature": "",
+ "signature": "create(user_create: RegisterRequest)",
"docstring": "Create a new user record.\n\nArgs:\n user_create (RegisterRequest):\n Registration data including prospective password.\n\nReturns:\n PublicUser:\n A PublicUser representation of the created user."
},
"get_by_username": {
"name": "get_by_username",
"kind": "function",
"path": "jwtlib.app.UserRepository.get_by_username",
- "signature": "",
+ "signature": "get_by_username(username: str)",
"docstring": "Retrieve a user by their unique username.\n\nArgs:\n username (str):\n The username to search for.\n\nReturns:\n User | None:\n The User document if found, otherwise None."
},
"get_by_email": {
"name": "get_by_email",
"kind": "function",
"path": "jwtlib.app.UserRepository.get_by_email",
- "signature": "",
+ "signature": "get_by_email(email: str)",
"docstring": "Retrieve a user by their unique email address.\n\nArgs:\n email (str):\n The email address to search for.\n\nReturns:\n User | None:\n The User document if found, otherwise None."
},
"get_active_users": {
"name": "get_active_users",
"kind": "function",
"path": "jwtlib.app.UserRepository.get_active_users",
- "signature": "",
+ "signature": "get_active_users(skip: int = 0, limit: int = 100)",
"docstring": "List all active users with pagination.\n\nArgs:\n skip (int):\n Number of records to skip.\n limit (int):\n Maximum number of records to return.\n\nReturns:\n list[User]:\n A list of active User documents."
},
"authenticate_user": {
"name": "authenticate_user",
"kind": "function",
"path": "jwtlib.app.UserRepository.authenticate_user",
- "signature": "",
+ "signature": "authenticate_user(user_auth: LoginRequest)",
"docstring": "Verify user credentials and prepare a login response.\n\nArgs:\n user_auth (LoginRequest):\n Login credentials.\n\nReturns:\n dict | None:\n A dictionary containing the access token and public user if successful, otherwise None."
}
}
@@ -628,56 +628,56 @@
"name": "get_current_user",
"kind": "function",
"path": "jwtlib.app.get_current_user",
- "signature": "",
+ "signature": "get_current_user(token: str, repo: UserRepository | None = None)",
"docstring": "Validate token and return authenticated public user.\n\nArgs:\n token (str):\n The `JWT` string to validate.\n repo (UserRepository | None):\n The user repository to use for resolution.\n\nReturns:\n PublicUser:\n The resolved and validated user object.\n\nRaises:\n InvalidToken:\n If the token is missing, malformed, or invalid.\n UserNotFound:\n If the token is valid, but the user does not exist in the\n repository."
},
"get_user_repository": {
"name": "get_user_repository",
"kind": "function",
"path": "jwtlib.app.get_user_repository",
- "signature": "",
+ "signature": "get_user_repository()",
"docstring": "Return a singleton or new instance of the `UserRepository`.\n\nReturns:\n UserRepository:\n The user repository instance."
},
"get_validated_token_payload": {
"name": "get_validated_token_payload",
"kind": "function",
"path": "jwtlib.app.get_validated_token_payload",
- "signature": "",
+ "signature": "get_validated_token_payload(token: str)",
"docstring": "Validate a `JWT` and return a typed payload.\n\nArgs:\n token (str):\n The `JWT` string to validate.\n\nReturns:\n TokenPayload:\n The validated and typed token payload.\n\nRaises:\n JWTError:\n If the token is invalid or malformed."
},
"register_user": {
"name": "register_user",
"kind": "function",
"path": "jwtlib.app.register_user",
- "signature": "",
+ "signature": "register_user(user: RegisterRequest, repo: UserRepository | None = None) -> PublicUser",
"docstring": "Register a new user.\n\nArgs:\n user (RegisterRequest):\n Registration payload containing username, email, and password.\n repo (UserRepository | None):\n Optional user repository instance. If not provided, a default\n repository is obtained via dependency utilities.\n\nReturns:\n PublicUser:\n The newly created user as a public user representation."
},
"login_user": {
"name": "login_user",
"kind": "function",
"path": "jwtlib.app.login_user",
- "signature": "",
+ "signature": "login_user(user: LoginRequest, repo: UserRepository | None = None) -> LoginResponse",
"docstring": "Authenticate a user and issue an access token.\n\nArgs:\n user (LoginRequest):\n Login payload containing username and password.\n repo (UserRepository | None):\n Optional user repository instance. If not provided, a default\n repository is obtained via dependency utilities.\n\nReturns:\n LoginResponse:\n `LoginResponse` containing the issued access token and related\n metadata.\n\nRaises:\n AuthError:\n If the credentials are invalid."
},
"get_logged_in_user": {
"name": "get_logged_in_user",
"kind": "function",
"path": "jwtlib.app.get_logged_in_user",
- "signature": "",
+ "signature": "get_logged_in_user(token: str, repo: UserRepository | None = None) -> PublicUser",
"docstring": "Resolve the currently authenticated user from a `JWT`.\n\nArgs:\n token (str):\n `JWT` access token.\n repo (UserRepository | None):\n Optional user repository instance. If not provided, a default\n repository is obtained via dependency utilities.\n\nReturns:\n PublicUser:\n The authenticated user as a `PublicUser`.\n\nRaises:\n InvalidToken:\n If the token is missing, malformed, or invalid.\n AuthError:\n If the token is valid, but the user cannot be resolved."
},
"logout_user": {
"name": "logout_user",
"kind": "function",
"path": "jwtlib.app.logout_user",
- "signature": "",
+ "signature": "logout_user() -> LogoutResponse",
"docstring": "Perform a stateless logout.\n\nReturns:\n LogoutResponse:\n `LogoutResponse` containing a logout confirmation message.\n\nNotes:\n **Guarantees:**\n\n - This function does not invalidate tokens server-side. Instead, it\n provides a standardized response indicating that the client must\n discard its token."
},
"introspect_token": {
"name": "introspect_token",
"kind": "function",
"path": "jwtlib.app.introspect_token",
- "signature": "",
+ "signature": "introspect_token(token: str, repo: UserRepository | None = None) -> IntrospectResponse",
"docstring": "Introspect a `JWT` for service-to-service authentication.\n\nArgs:\n token (str):\n `JWT` access token to introspect.\n repo (UserRepository | None):\n Optional user repository instance. If not provided, a default\n repository is obtained via dependency utilities.\n\nReturns:\n IntrospectResponse:\n `IntrospectResponse` indicating valid token with user, invalid\n token, or valid token with no user.\n\nNotes:\n **Responsibilities:**\n\n - Validate the provided token and resolve the associated user,\n returning a structured introspection response suitable for\n internal service use.\n\n **Guarantees:**\n\n - This function never raises authentication exceptions. Instead, it\n returns a typed response indicating token validity and user\n presence."
}
}
@@ -693,42 +693,42 @@
"name": "AuthError",
"kind": "class",
"path": "jwtlib.exceptions.AuthError",
- "signature": "",
+ "signature": null,
"docstring": "Base authentication and authorization error.\n\nNotes:\n **Guarantees:**\n\n - All authentication-related exceptions raised by this library\n inherit from this class.\n - Consumers may catch this exception to handle all auth failures\n uniformly."
},
"InvalidToken": {
"name": "InvalidToken",
"kind": "class",
"path": "jwtlib.exceptions.InvalidToken",
- "signature": "",
+ "signature": null,
"docstring": "Raised when a `JWT` is missing, malformed, expired, or invalid.\n\nNotes:\n **Guarantees:**\n\n - This error indicates that the provided token cannot be used to\n authenticate a request."
},
"InvalidAuthorizationHeader": {
"name": "InvalidAuthorizationHeader",
"kind": "class",
"path": "jwtlib.exceptions.InvalidAuthorizationHeader",
- "signature": "",
+ "signature": null,
"docstring": "Raised when the `Authorization` header is missing or incorrectly\nformatted.\n\nNotes:\n **Guarantees:**\n\n - Indicates that the header is not present or does not follow the\n expected `Bearer ` format."
},
"UserNotFound": {
"name": "UserNotFound",
"kind": "class",
"path": "jwtlib.exceptions.UserNotFound",
- "signature": "",
+ "signature": null,
"docstring": "Raised when a valid token does not map to an existing user.\n\nNotes:\n **Guarantees:**\n\n - Indicates that authentication succeeded at the token level, but\n the associated user record could not be resolved."
},
"AuthServiceUnavailable": {
"name": "AuthServiceUnavailable",
"kind": "class",
"path": "jwtlib.exceptions.AuthServiceUnavailable",
- "signature": "",
+ "signature": null,
"docstring": "Raised when the authentication service cannot be reached.\n\nNotes:\n **Guarantees:**\n\n - Indicates a network failure, timeout, or unexpected error while\n communicating with the auth service."
},
"NotAuthenticated": {
"name": "NotAuthenticated",
"kind": "class",
"path": "jwtlib.exceptions.NotAuthenticated",
- "signature": "",
+ "signature": null,
"docstring": "Raised when authentication is required but no user context is present.\n\nNotes:\n **Guarantees:**\n\n - Typically used when attempting to access a protected operation\n without an authenticated user."
}
}
@@ -740,81 +740,53 @@
"signature": null,
"docstring": "# Summary\n\nAuth client and access-control utilities.\n\nThis module provides **pure authentication and authorization logic**\nfor validating JWTs via service-to-service introspection and resolving\nauthenticated users.\n\nNotes:\n **Responsibilities:**\n\n - Calling the auth service introspection endpoint\n - Translating introspection responses into typed user models\n - Enforcing access control decisions at the logic layer\n\n **Constraints:**\n\n - This module intentionally does NOT: Parse HTTP requests or headers, implement authentication policies, or perform JWT signature verification locally.",
"members": {
- "os": {
- "name": "os",
- "kind": "alias",
- "path": "jwtlib.introspection.os",
- "signature": "",
- "docstring": null
- },
- "Callable": {
- "name": "Callable",
- "kind": "alias",
- "path": "jwtlib.introspection.Callable",
- "signature": "",
- "docstring": null
- },
- "Any": {
- "name": "Any",
- "kind": "alias",
- "path": "jwtlib.introspection.Any",
- "signature": "",
- "docstring": null
- },
- "httpx": {
- "name": "httpx",
- "kind": "alias",
- "path": "jwtlib.introspection.httpx",
- "signature": "",
- "docstring": null
- },
"AuthServiceUnavailable": {
"name": "AuthServiceUnavailable",
"kind": "class",
"path": "jwtlib.introspection.AuthServiceUnavailable",
- "signature": "",
+ "signature": null,
"docstring": "Raised when the authentication service cannot be reached.\n\nNotes:\n **Guarantees:**\n\n - Indicates a network failure, timeout, or unexpected error while\n communicating with the auth service."
},
"InvalidToken": {
"name": "InvalidToken",
"kind": "class",
"path": "jwtlib.introspection.InvalidToken",
- "signature": "",
+ "signature": null,
"docstring": "Raised when a `JWT` is missing, malformed, expired, or invalid.\n\nNotes:\n **Guarantees:**\n\n - This error indicates that the provided token cannot be used to\n authenticate a request."
},
"PublicUser": {
"name": "PublicUser",
"kind": "class",
"path": "jwtlib.introspection.PublicUser",
- "signature": "",
+ "signature": null,
"docstring": "Public-facing user representation returned by authentication APIs.\n\nAttributes:\n username (str):\n Unique username identifier.\n email (EmailStr, optional):\n User's email address.\n is_active (bool):\n Whether the user account is active.",
"members": {
"model_config": {
"name": "model_config",
"kind": "attribute",
"path": "jwtlib.introspection.PublicUser.model_config",
- "signature": "",
+ "signature": null,
"docstring": null
},
"username": {
"name": "username",
"kind": "attribute",
"path": "jwtlib.introspection.PublicUser.username",
- "signature": "",
+ "signature": null,
"docstring": null
},
"email": {
"name": "email",
"kind": "attribute",
"path": "jwtlib.introspection.PublicUser.email",
- "signature": "",
+ "signature": null,
"docstring": null
},
"is_active": {
"name": "is_active",
"kind": "attribute",
"path": "jwtlib.introspection.PublicUser.is_active",
- "signature": "",
+ "signature": null,
"docstring": null
}
}
@@ -837,14 +809,14 @@
"name": "introspect_token",
"kind": "function",
"path": "jwtlib.introspection.introspect_token",
- "signature": "",
+ "signature": "introspect_token(token: str) -> dict[str, Any]",
"docstring": "Introspect a JWT using the external authentication service.\n\nArgs:\n token (str):\n JWT access token to introspect.\n\nReturns:\n dict[str, Any]:\n A dictionary containing the authenticated user's public payload.\n\nRaises:\n InvalidToken:\n If the token is missing, invalid, inactive, or revoked.\n AuthServiceUnavailable:\n If the auth service cannot be reached or fails unexpectedly.\n\nNotes:\n **Guarantees:**\n\n - This function treats the auth service as the source of truth. No local JWT validation or signature checking is performed here. The returned payload is expected to be safe for public exposure."
},
"authenticate_request": {
"name": "authenticate_request",
"kind": "function",
"path": "jwtlib.introspection.authenticate_request",
- "signature": "",
+ "signature": "authenticate_request(should_skip_authentication: Callable[[str, str], bool], *, method: str, path: str, authorization_token: str | None) -> PublicUser | None",
"docstring": "Authenticate an incoming request using token introspection.\n\nArgs:\n should_skip_authentication (Callable[[str, str], bool]):\n Callable that decides whether authentication is required for a given HTTP method and path.\n method (str):\n HTTP method of the incoming request.\n path (str):\n Request path.\n authorization_token (str | None):\n JWT access token provided by the caller.\n\nReturns:\n PublicUser | None:\n PublicUser if authentication succeeds; None if authentication is skipped.\n\nRaises:\n InvalidToken:\n If authentication is required but the token is missing, invalid, or revoked.\n AuthServiceUnavailable:\n If the auth service cannot be reached.\n\nNotes:\n **Responsibilities:**\n\n - Determines whether authentication should be skipped for the given request context and, if not, resolves the authenticated user via token introspection\n\n **Guarantees:**\n\n - This function does not parse Authorization headers; callers must supply the raw token. Access-control policy is externalized via `should_skip_authentication`."
}
}
@@ -856,39 +828,32 @@
"signature": null,
"docstring": "# Summary\n\nUserRepository: Persistence layer for authentication.\n\nThis module defines the MongoDB-backed repository for managing user records,\nincluding creation, lookup, and credential verification.",
"members": {
- "BaseRepository": {
- "name": "BaseRepository",
- "kind": "alias",
- "path": "jwtlib.repository.BaseRepository",
- "signature": "",
- "docstring": null
- },
"LoginRequest": {
"name": "LoginRequest",
"kind": "class",
"path": "jwtlib.repository.LoginRequest",
- "signature": "",
+ "signature": null,
"docstring": "Payload for authenticating a user and issuing a `JWT`.\n\nAttributes:\n username (str):\n Username identifier.\n password (str):\n Plain-text password to be verified.",
"members": {
"model_config": {
"name": "model_config",
"kind": "attribute",
"path": "jwtlib.repository.LoginRequest.model_config",
- "signature": "",
+ "signature": null,
"docstring": null
},
"username": {
"name": "username",
"kind": "attribute",
"path": "jwtlib.repository.LoginRequest.username",
- "signature": "",
+ "signature": null,
"docstring": null
},
"password": {
"name": "password",
"kind": "attribute",
"path": "jwtlib.repository.LoginRequest.password",
- "signature": "",
+ "signature": null,
"docstring": null
}
}
@@ -897,35 +862,35 @@
"name": "PublicUser",
"kind": "class",
"path": "jwtlib.repository.PublicUser",
- "signature": "",
+ "signature": null,
"docstring": "Public-facing user representation returned by authentication APIs.\n\nAttributes:\n username (str):\n Unique username identifier.\n email (EmailStr, optional):\n User's email address.\n is_active (bool):\n Whether the user account is active.",
"members": {
"model_config": {
"name": "model_config",
"kind": "attribute",
"path": "jwtlib.repository.PublicUser.model_config",
- "signature": "",
+ "signature": null,
"docstring": null
},
"username": {
"name": "username",
"kind": "attribute",
"path": "jwtlib.repository.PublicUser.username",
- "signature": "",
+ "signature": null,
"docstring": null
},
"email": {
"name": "email",
"kind": "attribute",
"path": "jwtlib.repository.PublicUser.email",
- "signature": "",
+ "signature": null,
"docstring": null
},
"is_active": {
"name": "is_active",
"kind": "attribute",
"path": "jwtlib.repository.PublicUser.is_active",
- "signature": "",
+ "signature": null,
"docstring": null
}
}
@@ -934,35 +899,35 @@
"name": "RegisterRequest",
"kind": "class",
"path": "jwtlib.repository.RegisterRequest",
- "signature": "",
+ "signature": null,
"docstring": "Payload for registering a new user account.\n\nAttributes:\n username (str):\n Unique username identifier.\n email (EmailStr, optional):\n User's email address.\n password (str):\n Plain-text password (to be hashed by the repository layer).",
"members": {
"model_config": {
"name": "model_config",
"kind": "attribute",
"path": "jwtlib.repository.RegisterRequest.model_config",
- "signature": "",
+ "signature": null,
"docstring": null
},
"username": {
"name": "username",
"kind": "attribute",
"path": "jwtlib.repository.RegisterRequest.username",
- "signature": "",
+ "signature": null,
"docstring": null
},
"email": {
"name": "email",
"kind": "attribute",
"path": "jwtlib.repository.RegisterRequest.email",
- "signature": "",
+ "signature": null,
"docstring": null
},
"password": {
"name": "password",
"kind": "attribute",
"path": "jwtlib.repository.RegisterRequest.password",
- "signature": "",
+ "signature": null,
"docstring": null
}
}
@@ -971,14 +936,14 @@
"name": "User",
"kind": "class",
"path": "jwtlib.repository.User",
- "signature": "",
+ "signature": null,
"docstring": "Internal user persistence model.\n\nAttributes:\n hashed_password (str):\n Secure hash of the user's password.\n\nNotes:\n **Responsibilities:**\n\n - Represents a user record as stored in the database. Includes\n sensitive fields and is strictly confined to the persistence\n layer.\n\n **Guarantees:**\n\n - This model MUST NOT be returned from authentication APIs.\n Consumers should use `PublicUser` instead. Password verification\n is handled by the repository layer.",
"members": {
"hashed_password": {
"name": "hashed_password",
"kind": "attribute",
"path": "jwtlib.repository.User.hashed_password",
- "signature": "",
+ "signature": null,
"docstring": null
}
}
@@ -987,63 +952,63 @@
"name": "create_access_token",
"kind": "function",
"path": "jwtlib.repository.create_access_token",
- "signature": "",
+ "signature": "create_access_token(data: dict[str, object], expires_delta: timedelta | None = None)",
"docstring": "Generate a new `JWT` access token.\n\nArgs:\n data (dict):\n Subject data to include in the token payload.\n expires_delta (timedelta | None):\n Optional expiration override.\n\nReturns:\n str:\n An encoded `JWT` string."
},
"hash_password": {
"name": "hash_password",
"kind": "function",
"path": "jwtlib.repository.hash_password",
- "signature": "",
+ "signature": "hash_password(password: str)",
"docstring": "Hash a plain-text password using the configured crypt context.\n\nArgs:\n password (str):\n The plain-text password to hash.\n\nReturns:\n str:\n The secure hash string."
},
"verify_password": {
"name": "verify_password",
"kind": "function",
"path": "jwtlib.repository.verify_password",
- "signature": "",
+ "signature": "verify_password(plain_password: str, hashed_password: str)",
"docstring": "Verify a plain-text password against a stored hash.\n\nArgs:\n plain_password (str):\n The unhashed password provided by the user.\n hashed_password (str):\n The secure hash to verify against.\n\nReturns:\n bool:\n True if the password is valid, False otherwise."
},
"UserRepository": {
"name": "UserRepository",
"kind": "class",
"path": "jwtlib.repository.UserRepository",
- "signature": "",
+ "signature": "UserRepository()",
"docstring": "MongoDB-backed repository for `User` documents.\n\nNotes:\n **Responsibilities:**\n\n - Manage user persistence (CRUD).\n - Handle credential verification and token issuance.",
"members": {
"create": {
"name": "create",
"kind": "function",
"path": "jwtlib.repository.UserRepository.create",
- "signature": "",
+ "signature": "create(user_create: RegisterRequest) -> PublicUser",
"docstring": "Create a new user record.\n\nArgs:\n user_create (RegisterRequest):\n Registration data including prospective password.\n\nReturns:\n PublicUser:\n A PublicUser representation of the created user."
},
"get_by_username": {
"name": "get_by_username",
"kind": "function",
"path": "jwtlib.repository.UserRepository.get_by_username",
- "signature": "",
+ "signature": "get_by_username(username: str) -> User | None",
"docstring": "Retrieve a user by their unique username.\n\nArgs:\n username (str):\n The username to search for.\n\nReturns:\n User | None:\n The User document if found, otherwise None."
},
"get_by_email": {
"name": "get_by_email",
"kind": "function",
"path": "jwtlib.repository.UserRepository.get_by_email",
- "signature": "",
+ "signature": "get_by_email(email: str) -> User | None",
"docstring": "Retrieve a user by their unique email address.\n\nArgs:\n email (str):\n The email address to search for.\n\nReturns:\n User | None:\n The User document if found, otherwise None."
},
"get_active_users": {
"name": "get_active_users",
"kind": "function",
"path": "jwtlib.repository.UserRepository.get_active_users",
- "signature": "",
+ "signature": "get_active_users(skip: int = 0, limit: int = 100) -> list[User]",
"docstring": "List all active users with pagination.\n\nArgs:\n skip (int):\n Number of records to skip.\n limit (int):\n Maximum number of records to return.\n\nReturns:\n list[User]:\n A list of active User documents."
},
"authenticate_user": {
"name": "authenticate_user",
"kind": "function",
"path": "jwtlib.repository.UserRepository.authenticate_user",
- "signature": "",
+ "signature": "authenticate_user(user_auth: LoginRequest) -> dict[str, object] | None",
"docstring": "Verify user credentials and prepare a login response.\n\nArgs:\n user_auth (LoginRequest):\n Login credentials.\n\nReturns:\n dict | None:\n A dictionary containing the access token and public user if successful, otherwise None."
}
}
@@ -1057,67 +1022,25 @@
"signature": null,
"docstring": "# Summary\n\nSecurity utilities: Password hashing and `JWT` management.\n\nThis module provides low-level cryptographic helpers for password\nhashing and `JWT` token lifecycle management. It serves as the\ncryptographic engine for the authentication library.",
"members": {
- "os": {
- "name": "os",
- "kind": "alias",
- "path": "jwtlib.security.os",
- "signature": "",
- "docstring": null
- },
- "datetime": {
- "name": "datetime",
- "kind": "alias",
- "path": "jwtlib.security.datetime",
- "signature": "",
- "docstring": null
- },
- "timedelta": {
- "name": "timedelta",
- "kind": "alias",
- "path": "jwtlib.security.timedelta",
- "signature": "",
- "docstring": null
- },
- "JWTError": {
- "name": "JWTError",
- "kind": "alias",
- "path": "jwtlib.security.JWTError",
- "signature": "",
- "docstring": null
- },
- "jwt": {
- "name": "jwt",
- "kind": "alias",
- "path": "jwtlib.security.jwt",
- "signature": "",
- "docstring": null
- },
- "CryptContext": {
- "name": "CryptContext",
- "kind": "alias",
- "path": "jwtlib.security.CryptContext",
- "signature": "",
- "docstring": null
- },
"TokenPayload": {
"name": "TokenPayload",
"kind": "class",
"path": "jwtlib.security.TokenPayload",
- "signature": "",
+ "signature": null,
"docstring": "Decoded `JWT` payload.\n\nAttributes:\n sub (str):\n Subject claim identifying the user (typically a username or user ID).\n exp (int):\n Expiration time as a Unix timestamp (seconds since epoch).\n\nNotes:\n **Responsibilities:**\n\n - Represents the validated claims extracted from a `JWT` after\n signature verification. This model is used internally to enforce\n required claims and provide a typed interface to token data.\n\n **Guarantees:**\n\n - This model assumes the `JWT` signature has already been verified.\n No authorization decisions should be made solely on this model.\n Additional claims may exist but are intentionally ignored.",
"members": {
"sub": {
"name": "sub",
"kind": "attribute",
"path": "jwtlib.security.TokenPayload.sub",
- "signature": "",
+ "signature": null,
"docstring": null
},
"exp": {
"name": "exp",
"kind": "attribute",
"path": "jwtlib.security.TokenPayload.exp",
- "signature": "",
+ "signature": null,
"docstring": null
}
}
@@ -1154,28 +1077,28 @@
"name": "hash_password",
"kind": "function",
"path": "jwtlib.security.hash_password",
- "signature": "",
+ "signature": "hash_password(password: str) -> str",
"docstring": "Hash a plain-text password using the configured crypt context.\n\nArgs:\n password (str):\n The plain-text password to hash.\n\nReturns:\n str:\n The secure hash string."
},
"verify_password": {
"name": "verify_password",
"kind": "function",
"path": "jwtlib.security.verify_password",
- "signature": "",
+ "signature": "verify_password(plain_password: str, hashed_password: str) -> bool",
"docstring": "Verify a plain-text password against a stored hash.\n\nArgs:\n plain_password (str):\n The unhashed password provided by the user.\n hashed_password (str):\n The secure hash to verify against.\n\nReturns:\n bool:\n True if the password is valid, False otherwise."
},
"create_access_token": {
"name": "create_access_token",
"kind": "function",
"path": "jwtlib.security.create_access_token",
- "signature": "",
+ "signature": "create_access_token(data: dict[str, object], expires_delta: timedelta | None = None) -> str",
"docstring": "Generate a new `JWT` access token.\n\nArgs:\n data (dict):\n Subject data to include in the token payload.\n expires_delta (timedelta | None):\n Optional expiration override.\n\nReturns:\n str:\n An encoded `JWT` string."
},
"get_jwt_payload": {
"name": "get_jwt_payload",
"kind": "function",
"path": "jwtlib.security.get_jwt_payload",
- "signature": "",
+ "signature": "get_jwt_payload(token: str) -> TokenPayload",
"docstring": "Decode and validate a `JWT`, returning a strongly-typed payload.\n\nArgs:\n token (str):\n The `JWT` string to decode.\n\nReturns:\n TokenPayload:\n The decoded and typed token payload.\n\nRaises:\n JWTError:\n If the token is invalid, expired, or malformed."
}
}
@@ -1187,60 +1110,53 @@
"signature": null,
"docstring": "# Summary\n\nAuth Utilities: Token validation and user resolution.\n\nThis module provides high-level helpers for validating `JWT` payloads and\nresolving users, intended for use in dependency injection or middleware.",
"members": {
- "JWTError": {
- "name": "JWTError",
- "kind": "alias",
- "path": "jwtlib.utils.JWTError",
- "signature": "",
- "docstring": null
- },
"InvalidToken": {
"name": "InvalidToken",
"kind": "class",
"path": "jwtlib.utils.InvalidToken",
- "signature": "",
+ "signature": null,
"docstring": "Raised when a `JWT` is missing, malformed, expired, or invalid.\n\nNotes:\n **Guarantees:**\n\n - This error indicates that the provided token cannot be used to\n authenticate a request."
},
"UserNotFound": {
"name": "UserNotFound",
"kind": "class",
"path": "jwtlib.utils.UserNotFound",
- "signature": "",
+ "signature": null,
"docstring": "Raised when a valid token does not map to an existing user.\n\nNotes:\n **Guarantees:**\n\n - Indicates that authentication succeeded at the token level, but\n the associated user record could not be resolved."
},
"PublicUser": {
"name": "PublicUser",
"kind": "class",
"path": "jwtlib.utils.PublicUser",
- "signature": "",
+ "signature": null,
"docstring": "Public-facing user representation returned by authentication APIs.\n\nAttributes:\n username (str):\n Unique username identifier.\n email (EmailStr, optional):\n User's email address.\n is_active (bool):\n Whether the user account is active.",
"members": {
"model_config": {
"name": "model_config",
"kind": "attribute",
"path": "jwtlib.utils.PublicUser.model_config",
- "signature": "",
+ "signature": null,
"docstring": null
},
"username": {
"name": "username",
"kind": "attribute",
"path": "jwtlib.utils.PublicUser.username",
- "signature": "",
+ "signature": null,
"docstring": null
},
"email": {
"name": "email",
"kind": "attribute",
"path": "jwtlib.utils.PublicUser.email",
- "signature": "",
+ "signature": null,
"docstring": null
},
"is_active": {
"name": "is_active",
"kind": "attribute",
"path": "jwtlib.utils.PublicUser.is_active",
- "signature": "",
+ "signature": null,
"docstring": null
}
}
@@ -1249,21 +1165,21 @@
"name": "TokenPayload",
"kind": "class",
"path": "jwtlib.utils.TokenPayload",
- "signature": "",
+ "signature": null,
"docstring": "Decoded `JWT` payload.\n\nAttributes:\n sub (str):\n Subject claim identifying the user (typically a username or user ID).\n exp (int):\n Expiration time as a Unix timestamp (seconds since epoch).\n\nNotes:\n **Responsibilities:**\n\n - Represents the validated claims extracted from a `JWT` after\n signature verification. This model is used internally to enforce\n required claims and provide a typed interface to token data.\n\n **Guarantees:**\n\n - This model assumes the `JWT` signature has already been verified.\n No authorization decisions should be made solely on this model.\n Additional claims may exist but are intentionally ignored.",
"members": {
"sub": {
"name": "sub",
"kind": "attribute",
"path": "jwtlib.utils.TokenPayload.sub",
- "signature": "",
+ "signature": null,
"docstring": null
},
"exp": {
"name": "exp",
"kind": "attribute",
"path": "jwtlib.utils.TokenPayload.exp",
- "signature": "",
+ "signature": null,
"docstring": null
}
}
@@ -1272,42 +1188,42 @@
"name": "UserRepository",
"kind": "class",
"path": "jwtlib.utils.UserRepository",
- "signature": "",
+ "signature": "UserRepository()",
"docstring": "MongoDB-backed repository for `User` documents.\n\nNotes:\n **Responsibilities:**\n\n - Manage user persistence (CRUD).\n - Handle credential verification and token issuance.",
"members": {
"create": {
"name": "create",
"kind": "function",
"path": "jwtlib.utils.UserRepository.create",
- "signature": "",
+ "signature": "create(user_create: RegisterRequest)",
"docstring": "Create a new user record.\n\nArgs:\n user_create (RegisterRequest):\n Registration data including prospective password.\n\nReturns:\n PublicUser:\n A PublicUser representation of the created user."
},
"get_by_username": {
"name": "get_by_username",
"kind": "function",
"path": "jwtlib.utils.UserRepository.get_by_username",
- "signature": "",
+ "signature": "get_by_username(username: str)",
"docstring": "Retrieve a user by their unique username.\n\nArgs:\n username (str):\n The username to search for.\n\nReturns:\n User | None:\n The User document if found, otherwise None."
},
"get_by_email": {
"name": "get_by_email",
"kind": "function",
"path": "jwtlib.utils.UserRepository.get_by_email",
- "signature": "",
+ "signature": "get_by_email(email: str)",
"docstring": "Retrieve a user by their unique email address.\n\nArgs:\n email (str):\n The email address to search for.\n\nReturns:\n User | None:\n The User document if found, otherwise None."
},
"get_active_users": {
"name": "get_active_users",
"kind": "function",
"path": "jwtlib.utils.UserRepository.get_active_users",
- "signature": "",
+ "signature": "get_active_users(skip: int = 0, limit: int = 100)",
"docstring": "List all active users with pagination.\n\nArgs:\n skip (int):\n Number of records to skip.\n limit (int):\n Maximum number of records to return.\n\nReturns:\n list[User]:\n A list of active User documents."
},
"authenticate_user": {
"name": "authenticate_user",
"kind": "function",
"path": "jwtlib.utils.UserRepository.authenticate_user",
- "signature": "",
+ "signature": "authenticate_user(user_auth: LoginRequest)",
"docstring": "Verify user credentials and prepare a login response.\n\nArgs:\n user_auth (LoginRequest):\n Login credentials.\n\nReturns:\n dict | None:\n A dictionary containing the access token and public user if successful, otherwise None."
}
}
@@ -1316,28 +1232,28 @@
"name": "get_jwt_payload",
"kind": "function",
"path": "jwtlib.utils.get_jwt_payload",
- "signature": "",
+ "signature": "get_jwt_payload(token: str)",
"docstring": "Decode and validate a `JWT`, returning a strongly-typed payload.\n\nArgs:\n token (str):\n The `JWT` string to decode.\n\nReturns:\n TokenPayload:\n The decoded and typed token payload.\n\nRaises:\n JWTError:\n If the token is invalid, expired, or malformed."
},
"get_user_repository": {
"name": "get_user_repository",
"kind": "function",
"path": "jwtlib.utils.get_user_repository",
- "signature": "",
+ "signature": "get_user_repository() -> UserRepository",
"docstring": "Return a singleton or new instance of the `UserRepository`.\n\nReturns:\n UserRepository:\n The user repository instance."
},
"get_current_user": {
"name": "get_current_user",
"kind": "function",
"path": "jwtlib.utils.get_current_user",
- "signature": "",
+ "signature": "get_current_user(token: str, repo: UserRepository | None = None) -> PublicUser",
"docstring": "Validate token and return authenticated public user.\n\nArgs:\n token (str):\n The `JWT` string to validate.\n repo (UserRepository | None):\n The user repository to use for resolution.\n\nReturns:\n PublicUser:\n The resolved and validated user object.\n\nRaises:\n InvalidToken:\n If the token is missing, malformed, or invalid.\n UserNotFound:\n If the token is valid, but the user does not exist in the\n repository."
},
"get_validated_token_payload": {
"name": "get_validated_token_payload",
"kind": "function",
"path": "jwtlib.utils.get_validated_token_payload",
- "signature": "",
+ "signature": "get_validated_token_payload(token: str) -> TokenPayload",
"docstring": "Validate a `JWT` and return a typed payload.\n\nArgs:\n token (str):\n The `JWT` string to validate.\n\nReturns:\n TokenPayload:\n The validated and typed token payload.\n\nRaises:\n JWTError:\n If the token is invalid or malformed."
}
}
@@ -1353,28 +1269,28 @@
"name": "LoginRequest",
"kind": "class",
"path": "jwtlib.models.LoginRequest",
- "signature": "",
+ "signature": null,
"docstring": "Payload for authenticating a user and issuing a `JWT`.\n\nAttributes:\n username (str):\n Username identifier.\n password (str):\n Plain-text password to be verified.",
"members": {
"model_config": {
"name": "model_config",
"kind": "attribute",
"path": "jwtlib.models.LoginRequest.model_config",
- "signature": "",
+ "signature": null,
"docstring": null
},
"username": {
"name": "username",
"kind": "attribute",
"path": "jwtlib.models.LoginRequest.username",
- "signature": "",
+ "signature": null,
"docstring": null
},
"password": {
"name": "password",
"kind": "attribute",
"path": "jwtlib.models.LoginRequest.password",
- "signature": "",
+ "signature": null,
"docstring": null
}
}
@@ -1383,35 +1299,35 @@
"name": "RegisterRequest",
"kind": "class",
"path": "jwtlib.models.RegisterRequest",
- "signature": "",
+ "signature": null,
"docstring": "Payload for registering a new user account.\n\nAttributes:\n username (str):\n Unique username identifier.\n email (EmailStr, optional):\n User's email address.\n password (str):\n Plain-text password (to be hashed by the repository layer).",
"members": {
"model_config": {
"name": "model_config",
"kind": "attribute",
"path": "jwtlib.models.RegisterRequest.model_config",
- "signature": "",
+ "signature": null,
"docstring": null
},
"username": {
"name": "username",
"kind": "attribute",
"path": "jwtlib.models.RegisterRequest.username",
- "signature": "",
+ "signature": null,
"docstring": null
},
"email": {
"name": "email",
"kind": "attribute",
"path": "jwtlib.models.RegisterRequest.email",
- "signature": "",
+ "signature": null,
"docstring": null
},
"password": {
"name": "password",
"kind": "attribute",
"path": "jwtlib.models.RegisterRequest.password",
- "signature": "",
+ "signature": null,
"docstring": null
}
}
@@ -1420,28 +1336,28 @@
"name": "LoginResponse",
"kind": "class",
"path": "jwtlib.models.LoginResponse",
- "signature": "",
+ "signature": null,
"docstring": "Response returned after successful authentication.\n\nAttributes:\n access_token (str):\n `JWT` access token for authenticated requests.\n user (PublicUser):\n Public profile of the authenticated user.",
"members": {
"access_token": {
"name": "access_token",
"kind": "attribute",
"path": "jwtlib.models.LoginResponse.access_token",
- "signature": "",
+ "signature": null,
"docstring": null
},
"user": {
"name": "user",
"kind": "attribute",
"path": "jwtlib.models.LoginResponse.user",
- "signature": "",
+ "signature": null,
"docstring": null
},
"model_config": {
"name": "model_config",
"kind": "attribute",
"path": "jwtlib.models.LoginResponse.model_config",
- "signature": "",
+ "signature": null,
"docstring": null
}
}
@@ -1450,21 +1366,21 @@
"name": "LogoutResponse",
"kind": "class",
"path": "jwtlib.models.LogoutResponse",
- "signature": "",
+ "signature": null,
"docstring": "Response returned after a logout operation.\n\nAttributes:\n message (str):\n Human-readable logout confirmation.",
"members": {
"message": {
"name": "message",
"kind": "attribute",
"path": "jwtlib.models.LogoutResponse.message",
- "signature": "",
+ "signature": null,
"docstring": null
},
"model_config": {
"name": "model_config",
"kind": "attribute",
"path": "jwtlib.models.LogoutResponse.model_config",
- "signature": "",
+ "signature": null,
"docstring": null
}
}
@@ -1473,35 +1389,35 @@
"name": "PublicUser",
"kind": "class",
"path": "jwtlib.models.PublicUser",
- "signature": "",
+ "signature": null,
"docstring": "Public-facing user representation returned by authentication APIs.\n\nAttributes:\n username (str):\n Unique username identifier.\n email (EmailStr, optional):\n User's email address.\n is_active (bool):\n Whether the user account is active.",
"members": {
"model_config": {
"name": "model_config",
"kind": "attribute",
"path": "jwtlib.models.PublicUser.model_config",
- "signature": "