Skip to content

Adding /well-known endpoint to fetch JWKs - #1025

Merged
Manuthor merged 14 commits into
developfrom
jwksForJose
Jul 4, 2026
Merged

Adding /well-known endpoint to fetch JWKs#1025
Manuthor merged 14 commits into
developfrom
jwksForJose

Conversation

@HatemMn

@HatemMn HatemMn commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Overview

INFO: The KMS is not a JWT issuer

Who fetches /.well-known/jwks.json ? Why ??? Is KMS the token issuer?
A service that received a JWT signed by the KMS (via KMIP Sign) Needs the public key to verify the signature No — the caller signed the token using KMS as an oracle
Another KACLS instance during a /rewrap migration Verifies the peer-authentication JWT that KMS signed internally No — internal KMS-to-KMS trust, not user-facing tokens
An OIDC relying party expecting KMS to be an IdP Would fetch JWKS to verify ID tokens ❌ Wrong use case — KMS is not an IdP and issues no ID tokens

Cors considerations

        app = app.service(
            web::scope("/.well-known")
                .wrap(
                    // delibarate choice of exposing only what's needed
                    // the CORS::permissive default is too permissive for this use case
                    Cors::default()
                        .allow_any_origin()
                        .allowed_methods(vec!["GET"])
                )
                .service(jwks::get_jwks),
        );

CORS was not set to permissive on pupose, submit a bug report if the above config is too strict but E2E tests were conducted and everything passes

Closes #1029 and #1032

Other changes

Tests were added on https://github.com/Cosmian/kms/pull/1025/changes#diff-0a9df49d64235c67840cb9e0c3c78b198d38a87535c4a7766d8ced50d8e17a12

@HatemMn
HatemMn marked this pull request as ready for review June 26, 2026 14:28
@Manuthor
Manuthor merged commit 3a61066 into develop Jul 4, 2026
58 checks passed
@Manuthor
Manuthor deleted the jwksForJose branch July 4, 2026 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants