-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Add CSOT to OIDC. #1741
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 CSOT to OIDC. #1741
Conversation
JAVA-5357
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.
One question and one nit
driver-core/src/main/com/mongodb/internal/connection/SaslAuthenticator.java
Outdated
Show resolved
Hide resolved
if (timeoutContext.hasTimeoutMS()) { | ||
return assertNotNull(timeoutContext.getTimeout()).call(TimeUnit.MILLISECONDS, | ||
() -> { | ||
Assertions.fail(); |
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.
From the tests it looks like it should fall back to serverSelectionTimeoutMS
- if theres an infinite timeout - so how does that logic work?
Also it might be best to put an assertion message incase a future regression means this code path is hit - potentially would make debugging it easier.
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 initially assumed, based on the spec, that serverSelectionTimeoutMS
couldn’t be infinite, so I added the assertion. However, our implementation allows infinite timeouts for serverSelectionTimeoutMS
. Given this, i see two options:
- If both
timeoutMs
andserverSelectionTimeoutMS
are infinite, throw an exception. - The OIDC spec doesn’t specify behavior for infinite timeouts, but we could pass the maximum
Duration
value (usingChronoUnit.FOREVER.getDuration()
) to the OIDC callback. While not technically infinite, it’s large enough to represent an infinite timeout, aligning with both the OIDC spec (as it is technicallyLong.MAX_VALUE
and not infinite) and our current API for infiniteserverSelectionTimeoutMS
.
I think option 2 is preferable, so I’ve added it in this commit: cc5469d. Let me know your thoughts.
…nticator.java Co-authored-by: Ross Lawley <ross.lawley@gmail.com>
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.
LGTM!
Note:
The correct ticket for this PR is JAVA-5337.
Ticket JAVA-5357 was incorrectly linked.