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

Add ID to Claims interface #352

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

st3fan
Copy link

@st3fan st3fan commented Oct 9, 2023

This patch adds the jti claim to the Claims interface with a GetID() method. It also implements GetID() for both MapClaims and RegisteredClaims.

This makes it easier to use the registered claims (as documented in https://datatracker.ietf.org/doc/html/rfc7519#section-4.1) when you don't know whether you have an instance of RegisteredClaims or MapClaims to work with.

(I have a a concrete use for this where it saves me a type switch to find out what type of claims I am working with)

I realize that this is a drive-by pull request - if this change is unwanted then please discard it.

@oxisto
Copy link
Collaborator

oxisto commented Oct 9, 2023

This looks like a good idea, unfortunately this is API breaking, so this is something we need to keep reserved for a future v6, so this might be "stuck" for a while.

@oxisto oxisto added the next The next iteration of development, currently `v6` label Oct 9, 2023
@oxisto oxisto linked an issue Oct 9, 2023 that may be closed by this pull request
@oxisto oxisto added next The next iteration of development, currently `v6` and removed next The next iteration of development, currently `v6` labels Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
next The next iteration of development, currently `v6`
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GetID in the Claims interface ?
2 participants