Skip to content

Conversation

@ramsessanchez
Copy link
Contributor

@ramsessanchez ramsessanchez commented Apr 20, 2022

Fixes #483

MIchaelMainer
MIchaelMainer previously approved these changes Apr 20, 2022
Copy link
Contributor

@MIchaelMainer MIchaelMainer left a comment

Choose a reason for hiding this comment

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

nit: missing param description for customHosts.

baywet
baywet previously requested changes Apr 20, 2022
Copy link
Member

@baywet baywet left a comment

Choose a reason for hiding this comment

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

This would be a breaking change. Add getters and setters on the base auth provider instead. And rely on instance field, not static. Existing value being the default.
Revert changes to the should method. Revert changes to the token auth provider

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 4 Code Smells

92.3% 92.3% Coverage
0.0% 0.0% Duplication

this.customHosts = new HashSet<String>();
}
for(String host: customHosts){
this.customHosts.add(host.toLowerCase(Locale.ROOT));
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: According to this SO post, we should set this to Locale.ENGLISH in the very rare case we get to country specific endpoints (Turkey in the example) to avoid potential language specific user input error. With that stated, MG will likely define the host names in English so we should be safe even with Locale.ROOT.

No action required as I don't see this scenario happening, just thought I'd share my learning.

@ramsessanchez ramsessanchez merged commit 734e96e into dev Apr 22, 2022
@ramsessanchez ramsessanchez deleted the feature/AuthProviderWithHosts branch April 22, 2022 17:19
@ramsessanchez ramsessanchez changed the title add ability to add custom hosts to TokenCredentialAuthProvider add ability to add custom hosts to BaseAuthenticationProvider Apr 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ability to add a hostname to the authentication provider

4 participants