Authentication Overview
Python ships three Nest-style modules: API keys, JWT (HS256), and OAuth 2.1.
| Module | Guard | Typical env |
|---|---|---|
ApiKeyModule.for_root(...) | ApiKeyGuard | API_KEY |
JWTModule.for_root(...) | JwtGuard | JWT_SECRET |
OAuthModule.for_root(...) | OAuthGuard | JWKS / introspection + OAUTH_REQUIRED |
Import the module on AppModule, then stack @use_guards(...) on tools.
Python
from nitrostack import module, ApiKeyModule, OAuthModule, JWTModule
@module(
name="app",
imports=[
ApiKeyModule.for_root(),
JWTModule.for_root(),
OAuthModule.for_root(),
],
)
class AppModule:
pass
context.auth is an AuthContext (subject, scopes, client_id, aud, claims) after a successful guard.
Agent skill:
nitrostack-python-auth-security(OAuth-focused). JWT and API keys are covered in the pages below.