fix: case-insensitive auth_method comparison for IDC tokens #137
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
The background refresher was skipping token files with
auth_methodvalues like"IdC"or"IDC"because the comparison was case-sensitive and only matched lowercase"idc".This caused the background refresher to skip your token file entirely because
"IdC" != "idc".Solution
This fix normalizes the
auth_methodto lowercase before comparison in two places:token_repository.go: InreadTokenFile()when filtering tokens to refreshbackground_refresh.go: InrefreshSingle()when selecting the appropriate refresh methodChanges
strings.ToLower()to normalizeauth_methodbefore case-sensitive comparisonsstringsimport tobackground_refresh.goTesting
The fix ensures that all case variations of IDC auth method (
"idc","IdC","IDC", etc.) are properly recognized and refreshed.