This page consolidates the public surface of Cervantes: artefacts to declare, exported Java modules, recognised security annotations, every mp.jwt.* key read by JwtAuthConfigProducer, and every JOSE algorithm supported by the signature and encryption engine.
Maven artefacts
groupId |
artifactId |
Role |
|---|---|---|
|
|
MP JWT 2.2 spec repackaged into a named Java module ( |
|
|
Stable public SPI — |
|
|
Pure validation engine — JWT parsing, signature verification (RS/ES), claim validation, key loading (PEM, JWKS), JWE decryption. No CDI, no JAX-RS. |
|
|
|
|
|
|
|
|
JMH benchmarks (vs SmallRye JWT, opt-in profile |
|
|
Examples ( |
|
|
Official MP JWT 2.2 TCK runner — in-reactor, but only under the |
All versions at 0.4.0-SNAPSHOT. Shared parent io.vidocq:vidocq-parent:0.4.0-SNAPSHOT.
Java modules
| Module | Contents |
|---|---|
|
Spec repackaging — annotations |
|
|
|
No unqualified export — the only export is qualified: |
|
|
|
|
io.vidocq.cervantes.internal (the core engine) is exported only to io.vidocq.cervantes.cdi.vauban — application modules cannot read it, and any application class depending on it signals a regression to be fixed. The io.vidocq.cervantes.cdi.internal package, although exported for the Vauban wiring, is likewise not a supported API.
On a class path NEW
On a class path, provides clauses are ignored. This is the case under Weld, in an application server, or in any WAR. So cervantes-cdi-vauban also lists CervantesClaimExtension in META-INF/services/jakarta.enterprise.inject.build.compatible.spi.BuildCompatibleExtension. Without it, @Claim injection points stay unsatisfied (CERV-007).
cervantes-cdi-vauban and cervantes-jaxrs are also explicit bean archives: each ships a META-INF/beans.xml with bean-discovery-mode="annotated". A container that does not scan implicit archives, such as Weld SE by default, therefore still discovers the producers, the request context, the authentication filter and the @RolesAllowed feature.
Other CDI containers NEW
Cervantes does not need Vauban. The jars run unchanged under another CDI container, on a class path, and two integration-test modules, grouped under cervantes-it-other-containers, prove it on every build (cervantes#24):
| Module | What it runs |
|---|---|
|
Weld SE 6.0 (CDI 4.1), class path, no Vauban, Ravel for MicroProfile Config: the authentication filter bean validates a signed bearer token and sets the security context, an application bean reads the caller through |
|
A WAR on Open Liberty 26.0.0.10, MicroProfile 7 distribution (CDI 4.0, Jakarta REST 3.1, JSON-P 2.1, MicroProfile Config 3.1), with Liberty’s |
Neither module is published. vauban-api is a runtime dependency of cervantes-cdi-vauban and cervantes-jaxrs, under any container: the Vauban build weaves a protected constructor taking io.vidocq.vauban.api.ProxyLink into each normal-scoped bean (JsonWebTokenContext, JsonWebTokenProducer, the authentication filter, the @RolesAllowed feature). A container that cannot load that type cannot load the bean class, and Weld drops the bean with an INFO message (WELD-000119) before failing the deployment (CERV-008). vauban-api holds API types only (13 KB): no Vauban code runs outside Vauban. Its Jakarta CDI dependencies are excluded, so the container’s own CDI API stays the only one.
JwtValidator stays @Dependent on purpose: with no verification key configured, the producer returns null, which only a @Dependent bean may do.
|
Deploying on an application server
|
Recognised security annotations
| Annotation | Effect | Status |
|---|---|---|
|
Caller must own at least one of the listed roles (a role is a string from the |
✅ |
|
Endpoint open to everyone, anonymous included. Disables inherited |
✅ |
|
Endpoint always rejected with 403, whatever the token. |
✅ |
|
CDI injection qualifier. The typed value is extracted from the current |
✅ |
|
Variant naming the claim by its MP standard enum (instead of a free string). |
✅ |
|
Application-level marker (spec compatibility). Cervantes accepts it without specific action — the auth filter is registered anyway. |
✅ |
Supported types for @Claim
| Java type | Semantics |
|---|---|
|
Coercion: |
|
|
|
|
|
|
|
|
|
For array-typed claims ( |
|
Raw value parsed by Champollion. |
|
JSON-P sub-types. |
|
Eager. Resolved once at injection. |
|
Lazy MP. |
|
Lazy CDI. |
|
Lazy JDK. |
|
The original raw token — useful for propagation. |
mp.jwt.* MicroProfile Config keys
All keys are read through ConfigProvider.getConfig() — provided by Ravel in the Vidocq ecosystem.
Signature verification
| Key | Effect |
|---|---|
|
Inline public key. Accepts X.509 PEM ( |
|
Public-key location: |
|
Expected algorithm family ( |
|
Expected issuer — string. Strictly compared to the token’s |
|
Accepted audiences — comma-separated list. At least one intersection with |
|
Maximum token age, in seconds since |
|
The standard |
|
NEW The configuration is validated when the container starts, never during compilation. An unrecognised |
Token transport
| Key | Effect |
|---|---|
|
|
|
Cookie name carrying the token when |
JWE decryption (optional)
| Key | Effect |
|---|---|
|
Inline decryption private key. PKCS#8 PEM. |
|
Decryption private-key location. |
|
Expected key-wrapping algorithm: |
Supported signature algorithms
| Family | Algorithms | JDK implementation |
|---|---|---|
RSA |
|
|
ECDSA |
|
|
Not supported |
|
Rejected: |
Supported JWE algorithms
| Step | Algorithm | Notes |
|---|---|---|
Key wrapping ( |
|
Single transformation |
Content encryption ( |
|
|
(planned) |
|
Not yet supported — to be added if a future TCK milestone requires it. |
HTTP behaviour
| Situation | Code |
|---|---|
No token + unannotated or |
Endpoint runs anonymously (the filter leaves the request anonymous — pass-through). |
No token + |
|
Token present, invalid signature / expired |
|
Valid token but missing required role |
|
Valid token and required role present |
|
|
|
Compatibility
-
Java 25 (LTS), Maven 3.9.16.
-
JAX-RS 4.0 (Cassini or another compliant runtime).
-
CDI 4.1 Lite (Vauban) with BCE support, or any CDI 4.0 Lite container with BCE support — proven on Weld and Open Liberty, see Other CDI containers NEW.
-
MicroProfile Config 3.1+ (Ravel).
-
JSON-P 2.1 (Champollion).
-
No Jakarta EE Full Profile dependency.