bh-status-list: Add x5c field to StatusListTokenHeader#114
Merged
Conversation
m4t1j4
reviewed
Apr 10, 2026
Comment on lines
51
to
56
| pub fn new( | ||
| claims: StatusListTokenClaims, | ||
| kid: Option<String>, | ||
| x5c: Option<JwtX5Chain>, | ||
| key: &impl JwtSigner, | ||
| ) -> Result<Self> { |
Contributor
There was a problem hiding this comment.
With already two optional values, we might think about making a builder, or providing (set/with)_(kid/x5c/...) methods to make it cleaner. But no need to do it within this PR, just thinking out loud.
| ) -> Result<Self> { | ||
| let alg = key.algorithm(); | ||
|
|
||
| // TODO: verify x5c leaf key is the JWT signing key |
2aa6f4d to
2c7fb8d
Compare
2c7fb8d to
4c138f5
Compare
This commit adds `StatusListTokenHeader::unverified_from_token` function so that the caller code can use it to inspect the `kid` and `x5c` values from the `StatusListTokenHeader`, choose the public-key retrieval strategy, and then call the `verify` function with the fetched key. The alternative would be to inject a signature verifier which would potentially require `async`. This extra capability avoids color-coding the `verify` function with `async`.
4c138f5 to
3adb0b9
Compare
m4t1j4
approved these changes
Apr 14, 2026
|
|
||
| fn get_valid_jwt(alg: SigningAlgorithm, iss: UriBuf, sub: UriBuf, exp: Option<u64>) -> String { | ||
| let status_list = StatusListInternal::new(StatusBits::Eight, Option::None); | ||
| let status_list = StatusListInternal::new(StatusBits::Eight, None); |
Contributor
There was a problem hiding this comment.
Seems I was using Option::None for some reason. 😅
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is split into three commits :
StatusListTokenHeaderkidfield optional. Thekidfield is no longer mandatory sincex5cfield can also be used for public key information.x5cfield toStatusListTokenHeader. The field is made optional, same askidfield. There is no restrictions on the fields. Any combination ofx5candkidfields is valid.StatusListToken::parse_unverified_headerfunction. This commit addsStatusListToken::parse_unverified_headerfunction so that the caller code can use it to inspect thekidandx5cvalues from theStatusListTokenHeaderchoose the public-key retrieval strategy, and then call theverifyfunction with the fetched key. The alternative would be to inject a signature verifier which would potentially requireasync. This extra capability avoids color-coding theverifyfunction withasync.