IsConfigAPIKeyAuth reports whether the auth entry is synthesized from config *-api-key lists.
(auth *Auth)
| 2 | |
| 3 | // IsConfigAPIKeyAuth reports whether the auth entry is synthesized from config *-api-key lists. |
| 4 | func IsConfigAPIKeyAuth(auth *Auth) bool { |
| 5 | if auth == nil { |
| 6 | return false |
| 7 | } |
| 8 | if auth.AuthKind() != AuthKindAPIKey { |
| 9 | return false |
| 10 | } |
| 11 | if auth.AuthSourceKind() != AuthSourceConfig { |
| 12 | return false |
| 13 | } |
| 14 | return authAttribute(auth, AttributeAPIKey) != "" |
| 15 | } |