- 1. Overview
- 2. Transport requirements
- 2.1. COMMONS-1: Outbound IdP HTTP transport
- 2.2. COMMONS-2: TLS enforcement
- 2.3. COMMONS-3: SSRF defence for advertised URLs
- 2.4. COMMONS-4: Response resilience and DoS bounds
- 2.5. COMMONS-5: Discovery (
.well-known) - 2.6. COMMONS-6: JWKS retrieval
- 2.7. COMMONS-7: Extended IdP endpoints (client-facing)
- 2.8. COMMONS-8: Caching of discovery and JWKS
- 3. Error-model requirements
- 4. Security-event requirements
- 5. Metrics requirements
- 6. Traceability
Functional and non-functional requirements for the commons base layer — the
de.cuioss.sheriff.token.commons. packages inside token-sheriff-validation. Commons
gathers the four cross-cutting concerns every capability sits on: *IdP transport, the
error model, security events and metrics. It moves bytes, raises typed errors,
counts events and exposes metrics; it never interprets a token’s trust — that is the
validation layer’s job.
Requirement IDs use the COMMONS-N scheme, grouped by concern. IDs are stable identifiers referenced across documentation and the
threat model; they are not sequential across groups.
The capability README is the entry point — it carries the full document map and the recommended reading order for this set.
New standards are catalogued in References. Standards reused from the validation bibliography (RFC 7517, RFC 6749, RFC 9700) are cited inline below and not restated here.
All outbound IdP HTTP. See Transport specification and Threat Model.
Commons owns the validation-side outbound HTTP to an OpenID Provider — discovery and
JWKS — and provides the hardened transport primitives (built on cui-http) it is
performed with. The client capability builds its own back-channel HTTP (token, userinfo,
revocation, PAR) on those primitives and applies its own in-module egress control
(owned back-channel HTTP); it
does not route those fetches through a commons transport service.
-
Source: RFC 9700 §4 (single hardened HTTP surface).
All outbound IdP requests MUST use TLS 1.2 or higher with certificate validation. Plain
HTTP endpoints MUST be rejected. TLS configuration is centralized (via cui-http’s
`SecureSSLContextProvider), not per-caller.
Carve-out — hostname matching. Certificate validation decomposes into chain trust, expiry,
algorithm constraints, and hostname matching. The first three are unconditional and admit no
opt-out. Hostname matching alone is a per-configuration, default-ON knob that a deployment MAY
relax by explicit opt-in; when it is relaxed, the remaining checks stay fully enforced, so an
untrusted or expired certificate is still rejected. The knob exists for development and test
topologies serving SAN-mismatched certificates and MUST NOT be used in production — a deployment
that opts out accepts a narrowed mitigation. It is reachable from two configuration surfaces:
sheriff.token.issuers.<name>.jwks.http.verify-hostname (per-issuer, validation) and
sheriff.client.verify-hostname (client-wide, client engine). See
ADR-0008.
-
Source: RFC 9700 §2.6, RFC 8414 §2 (metadata retrieved over TLS).
Any URL taken from an IdP-controlled source (jwks_uri, discovery endpoints, userinfo,
or any endpoint advertised via discovery) MUST be constrained before it is fetched:
scheme restricted to HTTPS, host subject to an allow-list / egress policy (EgressPolicy),
and internal / link-local / loopback address ranges blocked. The wellknown and jwks
fetch paths were audited to this requirement during their relocation into commons.
-
Source: OWASP SSRF, CVE-2026-1180, RFC 9700 §4.10.
Every outbound fetch MUST apply a connect/read timeout, a response-size limit, and bounded retry/backoff. Large or slow metadata, JWKS or userinfo responses MUST NOT be able to exhaust memory or block a caller indefinitely.
-
Source: RFC 9700 §4 (availability), RFC 7230 (message framing bounds).
Commons fetches and parses OpenID Provider metadata from
.well-known/openid-configuration (OIDC Discovery) and OAuth authorization-server
metadata (RFC 8414). The advertised issuer MUST be validated against the configured
issuer; advertised endpoint URLs are subject to COMMONS-3: SSRF defence for advertised URLs.
Commons retrieves JWKS documents (RFC 7517) over the hardened transport, subject to COMMONS-2: TLS enforcement, COMMONS-3: SSRF defence for advertised URLs and COMMONS-4: Response resilience and DoS bounds, and caches them (COMMONS-8: Caching of discovery and JWKS). Key material parsing is a transport-format concern; trust decisions about the resulting keys remain in validation.
-
Source: RFC 7517 (reused from validation bibliography).
Commons defines the transport contract for the endpoints the OIDC client capability
drives: token (RFC 6749), userinfo (OIDC Core), revocation (RFC 7009), introspection
(RFC 7662), end-session / RP-initiated logout, and PAR (RFC 9126). Each is exercised by a
dedicated MockWebServer dispatcher in the generators test artifact (default + adversarial
modes), so the contract is testable independently of the client engine.
-
Source: RFC 6749, RFC 7009, RFC 7662, RFC 9126, OIDC RP-Initiated Logout 1.0.
Discovery documents and JWKS are cached with a bounded lifetime to avoid re-fetching on every validation. Cache refresh MUST re-apply COMMONS-2: TLS enforcement–COMMONS-4: Response resilience and DoS bounds.
-
Source: OpenID Connect Discovery 1.0 §4.3 (caching guidance).
Library code (the commons and validation packages, and the client engine — pure
Java) MUST signal failure through a typed exception hierarchy defined in commons.error.
Library code MUST NOT produce HTTP problem documents — that is not its layer.
-
Source: RFC 9457 §3 (problem details are an HTTP-edge concern).
Every HTTP edge — token-sheriff-validation-quarkus, token-sheriff-client-quarkus,
and any future non-Quarkus/RESTEasy edge (e.g. a portal adapter) — MUST map the typed
exceptions to application/problem+json per RFC 9457. Existing validation rejection
responses are retrofitted to this contract.
-
Source: RFC 9457.
Commons MUST normalize inbound IdP error responses (OAuth error / error_description
per RFC 6749 §5.2) into the typed model the edges render — one contract, both directions.
-
Source: RFC 6749 §5.2 (reused from validation bibliography).
Rendered problem documents MUST carry only a safe type / title / detail, and MUST NOT
leak stack traces, internal identifiers, upstream URLs, or credential material.
-
Source: RFC 9457 §3 (member semantics), RFC 9700 §4 (information disclosure).
SecurityEventCounter and the security-event types live in commons.events so validation
and the client share one event surface. The counter MUST remain thread-safe and
free of any Micrometer dependency; Quarkus extensions expose it as before.
-
Source: RFC 9700 §4 (security monitoring).
Each security event MUST carry a category (structure / signature / semantic) usable by an edge to select a response. Event categories MUST NOT depend on any validation-layer type (the ArchUnit boundary — see Architecture).
-
Source: RFC 9700 §4.
Metric identifiers / contracts (sheriff.token.*) are defined once in commons.metrics.
Each Quarkus extension wires them to Micrometer; the identifiers themselves carry no
Micrometer dependency.
-
Source: RFC 9700 §4 (observability), project metric-naming convention (
sheriff.token.*).
Each requirement is covered by the threat model and realized in the transport, error-model and observability specifications.
| Requirement | Threats | Specification |
|---|---|---|
COMMONS-1..8 |
T-SSRF, T-TLS, T-DOS, T-DISCOVERY |
transport.adoc |
COMMONS-9..12 |
T-LEAK |
error-model.adoc |
COMMONS-13..14 |
T-LEAK (categorization) |
observability.adoc |
COMMONS-15 |
— |
observability.adoc |