Classes to handle authentication and authorization for async Python application.
Repo Neoteroi/GuardPost, read from GitHub 13 h ago. Neoteroi has not joined Take My Repo.
ES256, ES384, ES512) for EC keys in JWK, JWKS, and AsymmetricJWTValidator.test_jwt_validator_fetches_tokens_again_for_unknown_kid that failed on slower hardware (e.g. Raspberry Pi / aarch64) due to a timing-sensitive refresh_time threshold; replaced real-time sleeps with mocked time for deterministic behaviour. Reported by @wrobell in #18.guardpost.protection namespace with classes offering a strategy for brute-force protection against authentication attempts, and to log all failed authentication attempts consistently.InvalidCredentialsError exception. AuthenticationHandler implementations can raise InvalidCredentialsError when invalid credentials are provided, to enable automatic logging and, if enabled, brute-force protection.RateLimiter class that can block authentication attempts after a configurable threshold is exceeded. By default stores failed attempts in-memory.RateLimiter into AuthenticationStrategy with automatic tracking of failed authentication attempts and support for blocking excessive requests.3.14 and remove 3.9 from the build matrix.3.9 (it reached EOL in October 2025).essentials, to use its Secret class to handle secrets for JWT validation with symmetric encryption. This is useful to support rotating secrets by updating env variables.JWTs to include the source exception (exc.__cause__).roles property to the Identity object.RolesRequirement class to authorize by sufficient roles (any one is enough).SymmetricJWTValidator and AsymmetricJWTValidator).authorize method with an optional set of roles, treated as sufficient roles to succeed authorization.3.12 and 3.13 to the build matrix.3.8 from the build matrix.pyproject.toml.ForbiddenError when the user of anJWKS: when validating JWTs, JWKS arekid is encountered, and JWKS wererefresh_time seconds ago (by default 120 seconds).claims are read in the User class.ContainerProtocolrodi v2.AuthenticationStrategy.authenticate and AuthorizationStrategy.authorize (authentication handlers and authorization requirements can still be synchronous).setup.py with pyproject.toml.identity_getter code API.Identity.__getitem__ to raise KeyError if a claim is missing.⚠️ Contains breaking changes