-
Notifications
You must be signed in to change notification settings - Fork 255
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
feat: adds verification context #3677
feat: adds verification context #3677
Conversation
3f7b765
to
9cc1bf1
Compare
9cc1bf1
to
a8ed6dc
Compare
spi/common/core-spi/src/main/java/org/eclipse/edc/spi/iam/VerificationContext.java
Outdated
Show resolved
Hide resolved
spi/common/core-spi/src/main/java/org/eclipse/edc/spi/iam/VerificationContext.java
Outdated
Show resolved
Hide resolved
…ficationContext.java Co-authored-by: Jim Marino <jim.marino@gmail.com>
…ficationContext.java Co-authored-by: Jim Marino <jim.marino@gmail.com>
* @return Result of the validation. | ||
*/ | ||
Result<ClaimToken> verifyJwtToken(TokenRepresentation tokenRepresentation, String audience); | ||
Result<ClaimToken> verifyJwtToken(TokenRepresentation tokenRepresentation, VerificationContext context); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can already here voices whining about backwards compatibility and breaking changes... Could we leave the old signature in place in a default method, and have it delegate to this new method?
the VerificationContext
contains the audience anyway
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can, but that method will not be called by our code in the protocol service layer, as we would need to populate the VerificationContext
. Also the audience
there will go away soon :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@paullatzelsperger hey, that's me 😆
In my opinion it really depends on how many extensions of this could exist, seems to be a pretty used interface so I'd go for the deprecation, but I will be also ok in changing without deprecating
(interface changes are generally more tolerated because only devs are involved, instead rest apis... well, you know)
* @return Result of the validation. | ||
*/ | ||
Result<ClaimToken> verifyJwtToken(TokenRepresentation tokenRepresentation, String audience); | ||
Result<ClaimToken> verifyJwtToken(TokenRepresentation tokenRepresentation, VerificationContext context); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@paullatzelsperger hey, that's me 😆
In my opinion it really depends on how many extensions of this could exist, seems to be a pretty used interface so I'd go for the deprecation, but I will be also ok in changing without deprecating
(interface changes are generally more tolerated because only devs are involved, instead rest apis... well, you know)
I've restored as default method the one with |
What this PR changes/adds
Adds
VerificationContext
in theIdentityService#verifyJwt
methodsWhy it does that
To be able to attach contextual information in the verification phase
Further notes
For now the
Policy
it's always an empty one. Policy extraction will be tackled in subsequent PRs on each area (catalog/transfer process/ contract negotiation)Linked Issue(s)
Closes #3675