Skip to main content

Crate uselesskey_axum

Crate uselesskey_axum 

Source
Expand description

axum auth-test helpers built on deterministic uselesskey fixtures.

This crate is intentionally test-focused and scoped to common drop-in needs:

  • JWKS and OIDC discovery routers
  • Bearer token verification middleware for tests
  • Typed deterministic auth context extraction/injection

Structs§

AuthExpectations
Expected JWT shape for test verification.
DeterministicJwksPhase
Deterministic signer + JWKS test fixture for one rotation phase.
MockJwtVerifierState
Middleware verification state.
TestAuthContext
Typed auth context inserted by helpers and extracted in handlers.

Enums§

RotationPhase
Deterministic JWT rotation phase.

Functions§

inject_auth_context_layer
Attach a middleware layer that injects a deterministic auth context without JWT parsing.
jwks_router
Build a JWKS router mounted at /.well-known/jwks.json.
mock_jwt_verifier_layer
Attach a middleware layer that verifies bearer tokens and inserts TestAuthContext.
oidc_router
Build an OIDC discovery router mounted at /.well-known/openid-configuration.