Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAuth ¶
func NewAuth(provider OAuthProvider, config oauth2.Config, skipTlsVerify bool) *auth
NewAuth creates a new auth handler
func NewAuthInterceptor ¶
func NewAuthInterceptor(groups []string) grpc.ServerOption
func RegisterOAuthProvider ¶
func RegisterOAuthProvider(provier OAuthProvider)
Types ¶
type OAuthProvider ¶
type OAuthProvider interface {
AllScopes() []string
MinimalScopes() []string
GetName() string
GetServer() string
SetServer(string)
GetTokenURL() string
GetAuthURL() string
GetUserInfoURL() string
}
func GetOAuthProvider ¶
func GetOAuthProvider(name string) OAuthProvider
type UserInfo ¶
type UserInfo struct {
Sub string `json:"sub"`
Name string `json:"name"`
PreferredUsername string `json:"preferred_username"`
Email string `json:"email"`
Picture string `json:"picture"`
Groups []string `json:"groups"`
}
func GetUserFromContext ¶
func GetUserInfo ¶
func GetUserInfo(server OAuthProvider, token string, skipTlsVerify bool) (userInfo *UserInfo, err error)
Click to show internal directories.
Click to hide internal directories.