Spikard. JwtAuthConfig
(spikard v0.17.0)
Copy Markdown
Per-route JWT authentication requirement.
spikard-http defines the canonical JwtConfig used by ServerConfig.jwt_auth, but
spikard-core cannot depend on spikard-http (the dependency runs the other way), so that
type cannot be reused here. This mirrors its fields so a later enforcement phase in
spikard-http can convert between the two without losing information.
secret and public_key are both optional because asymmetric algorithms (RS256, ES256, ...)
verify against a public key rather than a shared secret; see fixtures/auth.json's
jwt_config_algorithm_rs256, which carries public_key and no secret at all. Exactly one is
expected to be populated for a given algorithm, but that cross-field invariant is left to a
later enforcement phase rather than the type itself.