| 1 |
package types |
| 2 |
|
| 3 |
import ( |
| 4 |
"golang.org/x/oauth2" |
| 5 |
) |
| 6 |
|
| 7 |
type UserInfo struct { |
| 8 |
Subject string `json:"sub"` |
| 9 |
Email string `json:"email"` |
| 10 |
Username string `json:"preferred_username"` //nolint:tagliatelle // preferred_username is the standard claim for the username. |
| 11 |
Groups []string `json:"groups"` |
| 12 |
Roles []string `json:"roles"` |
| 13 |
} |
| 14 |
|
| 15 |
// GetSubject returns the subject identifier from the UserInfo response. |
| 16 |
func (u UserInfo) GetSubject() string { |
| 17 |
return u.Subject |
| 18 |
} |
| 19 |
|
| 20 |
type ProviderConfig struct { |
| 21 |
oauth2.Endpoint |
| 22 |
|
| 23 |
AuthCodeOptions []oauth2.AuthCodeOption |
| 24 |
Scopes []string |
| 25 |
} |
| 26 |
|
| 27 |
type CtxNonce struct{} |