auth
auth copied to clipboard
added constants for builtin providers
Added type safety for builtin providers names
Thank you for the pull request. Unfortunately, it seems that the changes made do not provide the type safety described in the description. Currently, the BuiltinProviderName
type will happily accept a "naked string", meaning that there is nothing preventing a user from passing a regular string as the provider name.
Generally speaking, this PR is OK as it deduplicates usage of string constants but doesn't do what the PR description says.
Please update the description to reflect these changes and address the minor linter issue. Once that has been done, I will be happy to merge the pull request.
Just added real type safety and fixed the lint issue
This really is type-safe, but it breaks back compatibility for all the existing users. The previous method wasn't type-safe but was less destructive. Making such a change will require a new major version, and I see no reason to start v2 just for this thing.
Yes, you are right, this change is not that important to remove the backwards compatibility. Should I left it as it was before (Changing the commit message)?
yep, just revert it to accept naked string and change the PR description
Pull Request Test Coverage Report for Build 3877687112
- 13 of 14 (92.86%) changed or added relevant lines in 1 file are covered.
- No unchanged relevant lines lost coverage.
- Overall coverage increased (+0.03%) to 95.72%
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % |
---|---|---|---|
auth.go | 13 | 14 | 92.86% |
<!-- | Total: | 13 | 14 |
Totals | |
---|---|
Change from base Build 3832831444: | 0.03% |
Covered Lines: | 246 |
Relevant Lines: | 257 |