-
Notifications
You must be signed in to change notification settings - Fork 27
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
Feature/generate user data #140
Conversation
Signed-off-by: Kai Helbig <[email protected]>
Signed-off-by: Kai Helbig <[email protected]>
Signed-off-by: Kai Helbig <[email protected]>
Signed-off-by: Kai Helbig <[email protected]>
Signed-off-by: Kai Helbig <[email protected]>
Kudos, SonarCloud Quality Gate passed! |
@@ -27,7 +27,7 @@ | |||
* <p>Example usage: | |||
* | |||
* <pre>{@code | |||
* TokenConfig config = TokenConfig.aTokenConfig().withSubject("subject).build(); |
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.
was this not broken?
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'm not quite sure what you mean. If you're talking about the missing quotation mark: yes, that was broken.
@@ -56,12 +55,41 @@ public String getToken( | |||
.claim("scope", tokenConfig.getScope()) | |||
.claim("typ", "Bearer") | |||
.claim("azp", tokenConfig.getAuthorizedParty()); | |||
Optional<UserData> generatedUserData; |
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.
Could use ternary
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.
Hm, yes. But it's not significantly shorter, and the google formatting looks weird:
Optional<UserData> generatedUserData =
tokenConfig.isGenerateUserDataFromSubject() ? Optional.of(
UserData.fromUsernameAndHostname(
tokenConfig.getSubject(), requestConfiguration.getHostname())) : Optional.empty();
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.
Had to change account to submit review. See comments by space-hawk ...
Since #121 did not see any update for a long time, I decided to implement the desired feature myself.