| 85 | } |
| 86 | |
| 87 | func normalizeAuthSourceKind(source string) string { |
| 88 | switch strings.ToLower(strings.TrimSpace(source)) { |
| 89 | case AuthSourceConfig: |
| 90 | return AuthSourceConfig |
| 91 | case AuthSourceFile, "filesystem": |
| 92 | return AuthSourceFile |
| 93 | case AuthSourceGit: |
| 94 | return AuthSourceGit |
| 95 | case AuthSourceMemory, "runtime", "runtime_only": |
| 96 | return AuthSourceMemory |
| 97 | case AuthSourceObjectStore, "object-store": |
| 98 | return AuthSourceObjectStore |
| 99 | case AuthSourcePostgres, "postgresql", "database", "db": |
| 100 | return AuthSourcePostgres |
| 101 | default: |
| 102 | return "" |
| 103 | } |
| 104 | } |
| 105 | |
| 106 | func authHasOAuthMetadata(auth *Auth) bool { |
| 107 | if auth == nil || len(auth.Metadata) == 0 { |