-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Remove dependency on oauth2-oidc-sdk inside NimbusOpaqueTokenIntrospector #16634
Remove dependency on oauth2-oidc-sdk inside NimbusOpaqueTokenIntrospector #16634
Conversation
Signed-off-by: Andreas Svanberg <[email protected]>
The tests that went through opaque token introspection rely on mocking a specific method in the RestOperations interface which is very brittle and hampers the ability to refactor internals. They are changed to instead make actual HTTP requests to a MockWebServer instead allowing refactoring changes. This is necessary to allow the implementation to be swapped from NimbusOpaqueTokenIntrospector to SpringOpaqueTokenIntrospector because the latter uses RestOperations#exchange(String, ParameterizedType) instead of RestOperations#exchange(String, String) of the former. Signed-off-by: Andreas Svanberg <[email protected]>
Signed-off-by: Andreas Svanberg <[email protected]>
The tests that went through opaque token introspection rely on mocking a specific method in the RestOperations interface which is very brittle and hampers the ability to refactor internals. They are changed to instead make actual HTTP requests to a MockWebServer instead allowing refactoring changes. This is necessary to allow the implementation to be swapped from NimbusOpaqueTokenIntrospector to SpringOpaqueTokenIntrospector because the latter uses RestOperations#exchange(String, ParameterizedType) instead of RestOperations#exchange(String, String) of the former. Signed-off-by: Andreas Svanberg <[email protected]>
Signed-off-by: Andreas Svanberg <[email protected]>
Signed-off-by: Andreas Svanberg <[email protected]>
They require the implementation to call a specific method on the RestOperations interface. Change to use a MockWebServer to allow refactoring without the tests breaking. Signed-off-by: Andreas Svanberg <[email protected]>
There is no verification of issuer at all. The only reason the test still "passes" is because the JSON response has the active attribute as the JSON string "true" rather than the boolean true which is not accepted. Choose to remove the test rather than adding issuer verification since the class is deprecated and will most likely be removed in a future release. Signed-off-by: Andreas Svanberg <[email protected]>
Signed-off-by: Andreas Svanberg <[email protected]>
Signed-off-by: Andreas Svanberg <[email protected]>
Thanks for the PR, @asvanberg, however |
NimbusOpaqueTokenIntrospector
now delegates toSpringOpaqueTokenIntrospector
.Required a lot of test changes since they are all mock-based relying on the implementation calling a specific method in the
RestOperations
interface and the two implementations differ in which method they call even though they are functionally the same. Tests were changed to use aMockWebServer
and make real HTTP requests to enable the internals to be freely refactored.One step of gh-14245