-
Notifications
You must be signed in to change notification settings - Fork 248
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
fix: issuedAt now validated with leeway in Oauth2ExpirationIssuedAtValidationRule #3728
fix: issuedAt now validated with leeway in Oauth2ExpirationIssuedAtValidationRule #3728
Conversation
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 are always happy to welcome new contributors ❤️ To make things easier for everyone, please make sure to follow our contribution guidelines, check if you have already signed the ECA, and relate this pull request to an existing issue or discussion.
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.
Please have the validation leeway an opt-in and adjust the tests accordingly. Also include a test for the case where the validation leeway is set but has been exceeded.
e2b19c9
to
8f910ab
Compare
Will post the changes in a sec. I'd like to warn against not enabling a reasonable leeway (2s-5s) by default:
This error is almost impossible to debug, as it happens only in production. So I am afraid that keeping this leeway opt-in rather than opt-out might cause people to run into issues they deem impossible to debug and just drop their work. I would personally also argue against a configurability, as any clock skew beyond 1 or 2s (with rounding) could be considered out-of-scope for the eclipse edc connector to deal with. |
I updated both the default to 0 and the tests to be more explicit. |
This needs to be an explicit security decision by the operator. We can issue an INFO (not warning, since that pollutes the log) in the case that this is not set. |
I added a warning logged with INFO. |
.../iam/oauth2/oauth2-core/src/main/java/org/eclipse/edc/iam/oauth2/Oauth2ServiceExtension.java
Outdated
Show resolved
Hide resolved
The code style + message are fixed now. |
.../iam/oauth2/oauth2-core/src/main/java/org/eclipse/edc/iam/oauth2/Oauth2ServiceExtension.java
Outdated
Show resolved
Hide resolved
57a840c
to
5f6c547
Compare
Oh, I had that overlooked. Should be fixed now. |
...re/src/main/java/org/eclipse/edc/iam/oauth2/rule/Oauth2ExpirationIssuedAtValidationRule.java
Outdated
Show resolved
Hide resolved
.../oauth2/oauth2-core/src/main/java/org/eclipse/edc/iam/oauth2/Oauth2ServiceConfiguration.java
Outdated
Show resolved
Hide resolved
I shortened the variables in question. |
.../iam/oauth2/oauth2-core/src/main/java/org/eclipse/edc/iam/oauth2/Oauth2ServiceExtension.java
Outdated
Show resolved
Hide resolved
.../iam/oauth2/oauth2-core/src/main/java/org/eclipse/edc/iam/oauth2/Oauth2ServiceExtension.java
Outdated
Show resolved
Hide resolved
The The Apache 2.0 license headers of files that I touched were also updated, I hope correctly. Is this still the way things are done? |
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.
as long as checkstyle does not complain about the headers, they are ok.
please update the dependencies file then we'll be ready to go (@jimmarino already approved)
The DEPENDENCIES file was updated with the contents output by the CI. |
What this PR changes/adds
As discussed here, added a configurable leeway to the validation of the
issuedAt
claim inoauth2-core
.Why it does that
The validation was added due to the sensitivity to clock skew of the aforementioned
issuedAt
claim.See the #3692 for more detail.
Further notes
expiresAt
claim as it is less sensitive to clock skew.Linked Issue(s)
Closes #3692