fixup! Add new providers.

This commit is contained in:
2025-09-26 23:16:35 +01:00
parent 7c8917bf6f
commit 60841eb121
16 changed files with 1162 additions and 14 deletions
+16 -1
View File
@@ -117,7 +117,7 @@ func (p *BaseProvider) BuildAuthParams(baseParams url.Values, scopes []string) (
return &AuthParams{
URLValues: baseParams,
Scopes: scopes,
Scopes: deduplicateScopes(scopes),
}, nil
}
@@ -127,6 +127,21 @@ func (p *BaseProvider) HandleTokenRefresh(tokenData *TokenResult) error {
return nil
}
// deduplicateScopes removes duplicate scopes from a slice while preserving order.
func deduplicateScopes(scopes []string) []string {
seen := make(map[string]bool)
result := make([]string, 0, len(scopes))
for _, scope := range scopes {
if !seen[scope] {
seen[scope] = true
result = append(result, scope)
}
}
return result
}
// ValidateConfig checks provider-specific configuration requirements.
// By default, it assumes the configuration is valid.
func (p *BaseProvider) ValidateConfig() error {