mirror of
https://github.com/grafana/grafana.git
synced 2025-02-20 11:48:34 -06:00
Adds support for Generic OAuth role mapping. A new configuration setting for generic oauth is added named role_attribute_path which accepts a JMESPath expression. Only Grafana roles named Viewer, Editor or Admin are accepted. Closes #9766
28 lines
754 B
Go
28 lines
754 B
Go
package setting
|
|
|
|
type OAuthInfo struct {
|
|
ClientId, ClientSecret string
|
|
Scopes []string
|
|
AuthUrl, TokenUrl string
|
|
Enabled bool
|
|
EmailAttributeName string
|
|
EmailAttributePath string
|
|
RoleAttributePath string
|
|
AllowedDomains []string
|
|
HostedDomain string
|
|
ApiUrl string
|
|
AllowSignup bool
|
|
Name string
|
|
TlsClientCert string
|
|
TlsClientKey string
|
|
TlsClientCa string
|
|
TlsSkipVerify bool
|
|
SendClientCredentialsViaPost bool
|
|
}
|
|
|
|
type OAuther struct {
|
|
OAuthInfos map[string]*OAuthInfo
|
|
}
|
|
|
|
var OAuthService *OAuther
|