Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidCredentials = errors.New("invalid authentication credentials") ErrInvalidOrgId = errors.New("invalid orgId") ErrInvalidInstanceID = errors.New("invalid instanceID") ErrInvalidRole = errors.New("invalid authentication credentials, role unable to publish") AdminKey string AdminUser = &User{ ID: 1, IsAdmin: true, Role: gcom.ROLE_ADMIN, } )
Functions ¶
This section is empty.
Types ¶
type AuthPlugin ¶
type AuthPlugin interface { // Auth returns whether a api_key is a valid and if the user has access to a certain instance Auth(username, password string) (*User, error) Stop() }
AuthPlugin is used to validate access
func GetAuthPlugin ¶
func GetAuthPlugin(name string) AuthPlugin
type FileAuth ¶
type FileAuth struct {
// contains filtered or unexported fields
}
Reads an ini file containing a section for each auth Key. Each section contains the user details associated with that key.
example: ------------------ [aaeipgnq] orgId = 1 isAdmin = true
[wpirgn123] orgId = 23 isAdmin = false instances = 1,2,4 -------------------
func NewFileAuth ¶
func NewFileAuth() *FileAuth
type GrafanaComAuth ¶
type GrafanaComAuth struct{}
func NewGrafanaComAuth ¶
func NewGrafanaComAuth() *GrafanaComAuth
func (*GrafanaComAuth) Auth ¶
func (a *GrafanaComAuth) Auth(username, password string) (*User, error)
func (*GrafanaComAuth) Stop ¶
func (a *GrafanaComAuth) Stop()
type GrafanaComInstanceAuth ¶
type GrafanaComInstanceAuth struct{}
func NewGrafanaComInstanceAuth ¶
func NewGrafanaComInstanceAuth() *GrafanaComInstanceAuth
func (*GrafanaComInstanceAuth) Auth ¶
func (a *GrafanaComInstanceAuth) Auth(username, password string) (*User, error)
func (*GrafanaComInstanceAuth) Stop ¶
func (a *GrafanaComInstanceAuth) Stop()
Click to show internal directories.
Click to hide internal directories.