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

Fix cryptic 'The supplier returned null' message if OIDC server connection fails #26661

Merged
merged 1 commit into from
Jul 12, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,11 @@ public Uni<Tokens> get() {
.onFailure(ConnectException.class)
.retry()
.atMost(oidcConfig.connectionRetryCount)
.onFailure().transform(t -> t.getCause());
.onFailure().transform(t -> {
LOG.warn("OIDC Server is not available:", t.getCause() != null ? t.getCause() : t);
// don't wrap t to avoid information leak
return new OidcClientException("OIDC Server is not available");
Copy link
Member Author

@famod famod Jul 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I chose OidcClientException instead of OIDCException because this class already throws OidcClientException in multiple places, but not OIDCException.
Please let me know in case you prefer OIDCException.

Copy link
Member

@sberyozkin sberyozkin Jul 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@famod Ha-ha, I've only now realized you are fixing OidcClientImpl and not OidcRecorder :-), but your update is still important IMHO, I think it looks fine now, thanks

});
return response.onItem()
.transform(resp -> emitGrantTokens(resp, refresh));
}
Expand Down