Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change AuthorizationHeaderParserConfiguration to take a JSON Web Key Set #179

Closed
wants to merge 9 commits into from

Conversation

mortenmj
Copy link
Contributor

@mortenmj mortenmj commented Sep 25, 2023

This adds a signature validator for JWKs (JSON Web Keys) to pkg/jwt. The new validator takes a JSON structure like the below, and will instantiate the correct signature validator for whichever types of keys are found in the structure.

{
   "keys":[
      {
         "kty":"RSA",
         "n":"u1SU1LfVLPHCozMxH2Mo4lgOEePzNm0tRgeLezV6ffAt0gunVTLw7onLRnrq0_IzW7yWR7QkrmBL7jTKEn5u-qKhbwKfBstIs-bMY2Zkp18gnTxKLxoS2tFczGkPLPgizskuemMghRniWaoLcyehkd3qqGElvW_VDL5AaWTg0nLVkjRo9z-40RQzuVaE8AkAFmxZzow3x-VJYKdjykkJ0iT9wCS0DRTXu269V264Vf_3jvredZiKRkgwlL9xNAwxXFg0x_XFw005UWVRIkdgcKWTjpBP2dPwVZ4WWC-9aGVd-Gyn1o0CLelf4rEjGoXbAAEgAqeGUxrcIlbjXfbcmw",
         "e":"AQAB",
         "alg":"RS256",
         "kid":"7c0b6913fe13820a333399ace426e70535a9a0bf",
         "use":"sig"
      }
   ]
}

The fields hmac_key and public_key in AuthorizationHeaderParserConfiguration have been replaced by a new field, jwks_inline, which takes the above structure.

As a follow-on step to this work, in a later PR, this data can be read from a file and periodically refreshed similar to how TLS certificates are treated.

@mortenmj mortenmj marked this pull request as ready for review October 5, 2023 11:30
@EdSchouten EdSchouten closed this in 0bb5e73 Oct 6, 2023
@EdSchouten
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants