| 2586 | } |
| 2587 | |
| 2588 | func applyOAuthModelAliasForAuth(cfg *config.Config, provider, authKind string, attributes map[string]string, models []*ModelInfo) []*ModelInfo { |
| 2589 | if len(models) == 0 { |
| 2590 | return models |
| 2591 | } |
| 2592 | channel := coreauth.OAuthModelAliasChannel(provider, authKind) |
| 2593 | if channel == "" { |
| 2594 | return models |
| 2595 | } |
| 2596 | aliases := oauthModelAliasesForAuth(cfg, channel, attributes) |
| 2597 | if len(aliases) == 0 { |
| 2598 | return models |
| 2599 | } |
| 2600 | return applyOAuthModelAliasEntries(aliases, models) |
| 2601 | } |
| 2602 | |
| 2603 | func oauthModelAliasesForAuth(cfg *config.Config, channel string, attributes map[string]string) []config.OAuthModelAlias { |
| 2604 | perAuthAliases := coreauth.OAuthModelAliasesFromAttributes(attributes) |