Files
docs/mcp/py-jwt/modules/jwtlib.security.json
Vishesh 'ironeagle' Bangotra b3b1c3404b feat: collect py-jwt wiki; register wiki kind; refresh lib and mcp artifacts
Adds the py-jwt wiki to the hub alongside lib and mcp and picks up
the regenerated flat lib reference and standardized MCP modules.
2026-09-16 20:08:15 +05:30

88 lines
4.5 KiB
JSON

{
"module": "jwtlib.security",
"content": {
"path": "jwtlib.security",
"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.",
"objects": {
"TokenPayload": {
"name": "TokenPayload",
"kind": "class",
"path": "jwtlib.security.TokenPayload",
"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": null,
"docstring": null
},
"exp": {
"name": "exp",
"kind": "attribute",
"path": "jwtlib.security.TokenPayload.exp",
"signature": null,
"docstring": null
}
}
},
"SECRET_KEY": {
"name": "SECRET_KEY",
"kind": "attribute",
"path": "jwtlib.security.SECRET_KEY",
"signature": null,
"docstring": null
},
"ALGORITHM": {
"name": "ALGORITHM",
"kind": "attribute",
"path": "jwtlib.security.ALGORITHM",
"signature": null,
"docstring": null
},
"ACCESS_TOKEN_EXPIRE_MINUTES": {
"name": "ACCESS_TOKEN_EXPIRE_MINUTES",
"kind": "attribute",
"path": "jwtlib.security.ACCESS_TOKEN_EXPIRE_MINUTES",
"signature": null,
"docstring": null
},
"pwd_context": {
"name": "pwd_context",
"kind": "attribute",
"path": "jwtlib.security.pwd_context",
"signature": null,
"docstring": null
},
"hash_password": {
"name": "hash_password",
"kind": "function",
"path": "jwtlib.security.hash_password",
"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": "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": "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": "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."
}
}
}
}