Documentation ¶
Index ¶
Constants ¶
View Source
const ( SAMLAuthModule = "auth.saml" LDAPAuthModule = "ldap" AuthProxyAuthModule = "authproxy" )
View Source
const ( ExporterName = "grafana" MetricsCollectionInterval = time.Hour * 4 // every 4 hours, indication of duplicate users )
Variables ¶
View Source
var ( ErrInvalidCredentials = errors.New("invalid username or password") ErrUsersQuotaReached = errors.New("users quota reached") ErrGettingUserQuota = errors.New("error getting user quota") ErrSignupNotAllowed = errors.New("system administrator has disabled signup") )
View Source
var ( // MStatDuplicateUserEntries is a indication metric gauge for number of users with duplicate emails or logins MStatDuplicateUserEntries prometheus.Gauge // MStatHasDuplicateEntries is a metric for if there is duplicate users MStatHasDuplicateEntries prometheus.Gauge // MStatMixedCasedUsers is a metric for if there is duplicate users MStatMixedCasedUsers prometheus.Gauge Once sync.Once Initialised bool = false )
Functions ¶
func GetAuthProviderLabel ¶
Types ¶
type AuthInfoService ¶
type AuthInfoService interface { LookupAndUpdate(ctx context.Context, query *models.GetUserByAuthInfoQuery) (*user.User, error) GetAuthInfo(ctx context.Context, query *models.GetAuthInfoQuery) error GetExternalUserInfoByLogin(ctx context.Context, query *models.GetExternalUserInfoByLoginQuery) error SetAuthInfo(ctx context.Context, cmd *models.SetAuthInfoCommand) error UpdateAuthInfo(ctx context.Context, cmd *models.UpdateAuthInfoCommand) error }
type LoginStats ¶
type Service ¶
type Service interface { CreateUser(cmd user.CreateUserCommand) (*user.User, error) UpsertUser(ctx context.Context, cmd *models.UpsertUserCommand) error DisableExternalUser(ctx context.Context, username string) error SetTeamSyncFunc(TeamSyncFunc) }
type Store ¶
type Store interface { GetExternalUserInfoByLogin(ctx context.Context, query *models.GetExternalUserInfoByLoginQuery) error GetAuthInfo(ctx context.Context, query *models.GetAuthInfoQuery) error SetAuthInfo(ctx context.Context, cmd *models.SetAuthInfoCommand) error UpdateAuthInfo(ctx context.Context, cmd *models.UpdateAuthInfoCommand) error UpdateAuthInfoDate(ctx context.Context, authInfo *models.UserAuth) error DeleteAuthInfo(ctx context.Context, cmd *models.DeleteAuthInfoCommand) error GetUserById(ctx context.Context, id int64) (*user.User, error) GetUserByLogin(ctx context.Context, login string) (*user.User, error) GetUserByEmail(ctx context.Context, email string) (*user.User, error) CollectLoginStats(ctx context.Context) (map[string]interface{}, error) RunMetricsCollection(ctx context.Context) error GetLoginStats(ctx context.Context) (LoginStats, error) }
type TeamSyncFunc ¶
type TeamSyncFunc func(user *user.User, externalUser *models.ExternalUserInfo) error
Click to show internal directories.
Click to hide internal directories.