Skip to content

add ability to add custom hosts to BaseAuthenticationProvider - #484

Merged
Ramses Sanchez-Hernandez (ramsessanchez) merged 7 commits into
devfrom
feature/AuthProviderWithHosts
Apr 22, 2022
Merged

add ability to add custom hosts to BaseAuthenticationProvider#484
Ramses Sanchez-Hernandez (ramsessanchez) merged 7 commits into
devfrom
feature/AuthProviderWithHosts

Conversation

@ramsessanchez

@ramsessanchez Ramses Sanchez-Hernandez (ramsessanchez) commented Apr 20, 2022

Copy link
Copy Markdown
Contributor

Fixes #483

Copy link
Copy Markdown
Contributor

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 Vincent Biret (baywet) left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown

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
Copy Markdown
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
Ramses Sanchez-Hernandez (ramsessanchez) deleted the feature/AuthProviderWithHosts branch April 22, 2022 17:19
@ramsessanchez Ramses Sanchez-Hernandez (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

3 participants