{ "module": "jwtlib.models.app", "content": { "path": "jwtlib.models.app", "docstring": "# Summary\n\nAuthentication request and response models.\n\nThis module defines all **typed data models** used by the authentication\nlibrary for user registration, login, logout, and token introspection.\n\nNotes:\n **Model Categories:**\n\n - Request payloads used by authentication workflows.\n - Public response models exposed to consumers.\n - Introspection responses used for service-to-service authentication.\n\n **Design Principles:**\n\n - Fully typed (Pydantic v2).\n - Serialization-safe.\n - Framework-agnostic.\n - Suitable for both internal logic and external adapters.", "objects": { "ActiveStateMixin": { "name": "ActiveStateMixin", "kind": "class", "path": "jwtlib.models.app.ActiveStateMixin", "signature": null, "docstring": "Mixin for entities with an active status flag.\n\nAttributes:\n is_active (bool):\n Indicates whether the account is active and allowed to\n authenticate.", "members": { "is_active": { "name": "is_active", "kind": "attribute", "path": "jwtlib.models.app.ActiveStateMixin.is_active", "signature": null, "docstring": null } } }, "IdentityMixin": { "name": "IdentityMixin", "kind": "class", "path": "jwtlib.models.app.IdentityMixin", "signature": null, "docstring": "Mixin for entities with a username and email.\n\nAttributes:\n username (str):\n Unique username used for authentication and display.\n email (Optional[EmailStr]):\n Primary email address associated with the account.", "members": { "username": { "name": "username", "kind": "attribute", "path": "jwtlib.models.app.IdentityMixin.username", "signature": null, "docstring": null }, "email": { "name": "email", "kind": "attribute", "path": "jwtlib.models.app.IdentityMixin.email", "signature": null, "docstring": null } } }, "PasswordMixin": { "name": "PasswordMixin", "kind": "class", "path": "jwtlib.models.app.PasswordMixin", "signature": null, "docstring": "Mixin for entities with a raw password field.\n\nAttributes:\n password (str):\n User password (minimum 6 characters).", "members": { "password": { "name": "password", "kind": "attribute", "path": "jwtlib.models.app.PasswordMixin.password", "signature": null, "docstring": null } } }, "User": { "name": "User", "kind": "class", "path": "jwtlib.models.app.User", "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.models.app.User.hashed_password", "signature": null, "docstring": null } } }, "RegisterRequest": { "name": "RegisterRequest", "kind": "class", "path": "jwtlib.models.app.RegisterRequest", "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.app.RegisterRequest.model_config", "signature": null, "docstring": null }, "username": { "name": "username", "kind": "attribute", "path": "jwtlib.models.app.RegisterRequest.username", "signature": null, "docstring": null }, "email": { "name": "email", "kind": "attribute", "path": "jwtlib.models.app.RegisterRequest.email", "signature": null, "docstring": null }, "password": { "name": "password", "kind": "attribute", "path": "jwtlib.models.app.RegisterRequest.password", "signature": null, "docstring": null } } }, "LoginRequest": { "name": "LoginRequest", "kind": "class", "path": "jwtlib.models.app.LoginRequest", "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.app.LoginRequest.model_config", "signature": null, "docstring": null }, "username": { "name": "username", "kind": "attribute", "path": "jwtlib.models.app.LoginRequest.username", "signature": null, "docstring": null }, "password": { "name": "password", "kind": "attribute", "path": "jwtlib.models.app.LoginRequest.password", "signature": null, "docstring": null } } }, "IntrospectRequest": { "name": "IntrospectRequest", "kind": "class", "path": "jwtlib.models.app.IntrospectRequest", "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.models.app.IntrospectRequest.token", "signature": null, "docstring": null }, "model_config": { "name": "model_config", "kind": "attribute", "path": "jwtlib.models.app.IntrospectRequest.model_config", "signature": null, "docstring": null } } }, "PublicUser": { "name": "PublicUser", "kind": "class", "path": "jwtlib.models.app.PublicUser", "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.app.PublicUser.model_config", "signature": null, "docstring": null }, "username": { "name": "username", "kind": "attribute", "path": "jwtlib.models.app.PublicUser.username", "signature": null, "docstring": null }, "email": { "name": "email", "kind": "attribute", "path": "jwtlib.models.app.PublicUser.email", "signature": null, "docstring": null }, "is_active": { "name": "is_active", "kind": "attribute", "path": "jwtlib.models.app.PublicUser.is_active", "signature": null, "docstring": null } } }, "LoginResponse": { "name": "LoginResponse", "kind": "class", "path": "jwtlib.models.app.LoginResponse", "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.app.LoginResponse.access_token", "signature": null, "docstring": null }, "user": { "name": "user", "kind": "attribute", "path": "jwtlib.models.app.LoginResponse.user", "signature": null, "docstring": null }, "model_config": { "name": "model_config", "kind": "attribute", "path": "jwtlib.models.app.LoginResponse.model_config", "signature": null, "docstring": null } } }, "LogoutResponse": { "name": "LogoutResponse", "kind": "class", "path": "jwtlib.models.app.LogoutResponse", "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.app.LogoutResponse.message", "signature": null, "docstring": null }, "model_config": { "name": "model_config", "kind": "attribute", "path": "jwtlib.models.app.LogoutResponse.model_config", "signature": null, "docstring": null } } }, "IntrospectResponse": { "name": "IntrospectResponse", "kind": "class", "path": "jwtlib.models.app.IntrospectResponse", "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.models.app.IntrospectResponse.active", "signature": null, "docstring": null }, "user": { "name": "user", "kind": "attribute", "path": "jwtlib.models.app.IntrospectResponse.user", "signature": null, "docstring": null }, "model_config": { "name": "model_config", "kind": "attribute", "path": "jwtlib.models.app.IntrospectResponse.model_config", "signature": null, "docstring": null }, "jwt_error": { "name": "jwt_error", "kind": "function", "path": "jwtlib.models.app.IntrospectResponse.jwt_error", "signature": "jwt_error(error: Any) -> IntrospectResponse", "docstring": null }, "no_username": { "name": "no_username", "kind": "function", "path": "jwtlib.models.app.IntrospectResponse.no_username", "signature": "no_username() -> IntrospectResponse", "docstring": null }, "no_user": { "name": "no_user", "kind": "function", "path": "jwtlib.models.app.IntrospectResponse.no_user", "signature": "no_user() -> IntrospectResponse", "docstring": null }, "valid_user": { "name": "valid_user", "kind": "function", "path": "jwtlib.models.app.IntrospectResponse.valid_user", "signature": "valid_user(user: Any) -> IntrospectResponse", "docstring": null } } } } } }