Documentation ¶
Index ¶
- Constants
- func AddProvider(p Provider)
- func AuthenticateUser(w http.ResponseWriter, username string, password string) bool
- func CreateInitialUser(p Provider)
- func Logout(w http.ResponseWriter, r *http.Request)
- func SetSessionStore(ss SessionStore)
- func UserTypeName(ut int) string
- type Authenticator
- type LDAPAuthenticator
- func (ldap *LDAPAuthenticator) AddUser(username string, password string, usertype int) error
- func (ldap *LDAPAuthenticator) AddUserToGroup(username string, group string) error
- func (ldap *LDAPAuthenticator) GetName() string
- func (ldap *LDAPAuthenticator) GetUser(username string) (User, error)
- func (ldap *LDAPAuthenticator) GetWritable() bool
- func (ldap *LDAPAuthenticator) LoginUser(username string, password string) (User, error)
- type MemorySessionStore
- type Provider
- type RedisProvider
- func (rp *RedisProvider) AddUser(username string, password string, usertype int) error
- func (rp *RedisProvider) AddUserToGroup(username string, group string) error
- func (rp *RedisProvider) GetName() string
- func (rp *RedisProvider) GetUser(username string) (User, error)
- func (rp *RedisProvider) GetWritable() bool
- func (rp *RedisProvider) LoginUser(username string, password string) (User, error)
- type RedisSessionStore
- type SessionStore
- type User
Constants ¶
View Source
const ( UserType_User = iota UserType_Machine = iota )
Variables ¶
This section is empty.
Functions ¶
func AddProvider ¶
func AddProvider(p Provider)
func AuthenticateUser ¶
func AuthenticateUser(w http.ResponseWriter, username string, password string) bool
func CreateInitialUser ¶
func CreateInitialUser(p Provider)
func SetSessionStore ¶
func SetSessionStore(ss SessionStore)
func UserTypeName ¶
Types ¶
type Authenticator ¶
type Authenticator struct {
// contains filtered or unexported fields
}
Authenticator Right now at least, this is a singleton
func GetAuthenticator ¶
func GetAuthenticator() *Authenticator
type LDAPAuthenticator ¶
type LDAPAuthenticator struct {
// contains filtered or unexported fields
}
func GetLDAPAuthenticator ¶
func GetLDAPAuthenticator(conf *config.Config) LDAPAuthenticator
func (*LDAPAuthenticator) AddUser ¶
func (ldap *LDAPAuthenticator) AddUser(username string, password string, usertype int) error
func (*LDAPAuthenticator) AddUserToGroup ¶
func (ldap *LDAPAuthenticator) AddUserToGroup(username string, group string) error
func (*LDAPAuthenticator) GetName ¶
func (ldap *LDAPAuthenticator) GetName() string
func (*LDAPAuthenticator) GetUser ¶
func (ldap *LDAPAuthenticator) GetUser(username string) (User, error)
func (*LDAPAuthenticator) GetWritable ¶
func (ldap *LDAPAuthenticator) GetWritable() bool
type MemorySessionStore ¶
type MemorySessionStore struct {
// contains filtered or unexported fields
}
func CreateMemorySessionStore ¶
func CreateMemorySessionStore() *MemorySessionStore
func (*MemorySessionStore) AddUser ¶
func (mss *MemorySessionStore) AddUser(u *User) string
func (*MemorySessionStore) GetUser ¶
func (mss *MemorySessionStore) GetUser(cookie string) *User
func (*MemorySessionStore) RemoveUser ¶
func (mss *MemorySessionStore) RemoveUser(cookie string)
type RedisProvider ¶
type RedisProvider struct {
// contains filtered or unexported fields
}
func CreateRedisProvider ¶
func CreateRedisProvider(conn *redis.Client) *RedisProvider
func (*RedisProvider) AddUser ¶
func (rp *RedisProvider) AddUser(username string, password string, usertype int) error
func (*RedisProvider) AddUserToGroup ¶
func (rp *RedisProvider) AddUserToGroup(username string, group string) error
func (*RedisProvider) GetName ¶
func (rp *RedisProvider) GetName() string
func (*RedisProvider) GetWritable ¶
func (rp *RedisProvider) GetWritable() bool
type RedisSessionStore ¶
type RedisSessionStore struct {
// contains filtered or unexported fields
}
func CreateRedisSessionStore ¶
func CreateRedisSessionStore(conn *redis.Client) *RedisSessionStore
func (*RedisSessionStore) AddUser ¶
func (rss *RedisSessionStore) AddUser(u *User) string
func (*RedisSessionStore) GetUser ¶
func (rss *RedisSessionStore) GetUser(cookie string) *User
func (*RedisSessionStore) RemoveUser ¶
func (rss *RedisSessionStore) RemoveUser(cookie string)
type SessionStore ¶
type User ¶
type User struct { UserType int Name string `json:"name"` UserName string `json:"username"` Groups []string `json:"groups"` // contains filtered or unexported fields }
func CheckAuthAPI ¶
CheckAuthAPI Check for auth - either for a (human) user, or an API user
func CheckAuthUser ¶
CheckAuthUser Check for auth - endpoint only for (human) user use
Click to show internal directories.
Click to hide internal directories.