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

Issue #12644 - use builder API to construct OpenIdConfiguration #12682

Open
wants to merge 3 commits into
base: jetty-12.1.x
Choose a base branch
from

Conversation

lachlan-roberts
Copy link
Contributor

closes #12644

Copy link
Contributor

@gregw gregw left a comment

Choose a reason for hiding this comment

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

Mostly good, but a few suggestions:

Comment on lines 77 to 81
{
issuer(issuer);
clientId(clientId);
clientSecret(clientSecret);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I like this alternative best I think

Suggested change
{
issuer(issuer);
clientId(clientId);
clientSecret(clientSecret);
}
{
this();
issuer(issuer);
clientId(clientId);
clientSecret(clientSecret);
}

Comment on lines 311 to 321
private OpenIdConfiguration(@Name("issuer") String issuer,
@Name("clientId") String clientId,
@Name("clientSecret") String clientSecret,
@Name("authorizationEndpoint") String authorizationEndpoint,
@Name("tokenEndpoint") String tokenEndpoint,
@Name("endSessionEndpoint") String endSessionEndpoint,
@Name("authenticationMethod") String authenticationMethod,
@Name("httpClient") HttpClient httpClient,
@Name("authenticateNewUsers") boolean authenticateNewUsers,
@Name("logoutWhenIdTokenIsExpired") boolean logoutWhenIdTokenIsExpired,
@Name("scopes") List<String> scopes)
Copy link
Contributor

Choose a reason for hiding this comment

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

You don't need the @name annotation on a private constructor as it will never be used in XML

Comment on lines +80 to +81
.authorizationEndpoint("")
.tokenEndpoint("")
Copy link
Contributor

Choose a reason for hiding this comment

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

If there is a semantic difference between "", null and not set at all, then you need to say so in the javadoc

Copy link
Contributor Author

Choose a reason for hiding this comment

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

A value of null means it hasn't been set. And it already says in the javadoc if this has not been set it will search for the OpenID metadata at .well-known/openid-configuration.

The authorizationEndpoint/tokenEndpoint value of "" has no special meaning, and will not actually work. In this test I just need a non-null value.

So there is no point mentioning "" specifically in the javadoc because it means nothing and is just an incorrect value.

Copy link
Contributor

Choose a reason for hiding this comment

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

Could you set it to "test" instead? That avoids the confusion if "" is unsetting it or not

Signed-off-by: Lachlan Roberts <[email protected]>
@lachlan-roberts lachlan-roberts requested a review from gregw January 13, 2025 05:06
Comment on lines +80 to +81
.authorizationEndpoint("")
.tokenEndpoint("")
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you set it to "test" instead? That avoids the confusion if "" is unsetting it or not

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants