Documentation ¶
Index ¶
- Constants
- Variables
- func NewACLModule(c *etcd.Client, loggedInUser string) admincli.CLIModule
- type ACLEngine
- func (e *ACLEngine) AddCapabilityToGroup(group string, capability string) error
- func (e *ACLEngine) AddGroup(name string) error
- func (e *ACLEngine) AddPrefixToGroup(group string, prefix string) error
- func (e *ACLEngine) AddUserToGroup(user string, group string) error
- func (e *ACLEngine) AuthenticateUser(name string, password string) (bool, *User, error)
- func (e *ACLEngine) AuthenticateUserByKey(apikey string) (bool, *User, error)
- func (e *ACLEngine) CreateDefaultAdminUser(password string) error
- func (e *ACLEngine) CreateUser(username, password string) error
- func (e *ACLEngine) DeleteGroup(name string) error
- func (e *ACLEngine) DeleteUser(username string) error
- func (e *ACLEngine) GetAPIKey(username string) (string, error)
- func (e *ACLEngine) GetAllUsers() ([]string, error)
- func (e *ACLEngine) GetBuiltinUser(name string) (*User, error)
- func (e *ACLEngine) GetGroup(name string) (*Group, error)
- func (e *ACLEngine) GetGroups() ([]*Group, error)
- func (e *ACLEngine) GetIDP() (IdentityProvider, error)
- func (e *ACLEngine) GetPublicUser() (*User, error)
- func (e *ACLEngine) RemoveCapabilityFromGroup(group string, capability string) error
- func (e *ACLEngine) RemovePrefixFromGroup(group string, prefix string) error
- func (e *ACLEngine) RemoveUserFromGroup(user string, group string) error
- func (e *ACLEngine) ResetAPIKey(username string) (string, error)
- func (e *ACLEngine) SetIDP(p IdentityProvider) error
- func (e *ACLEngine) SetPassword(username, password string) error
- func (e *ACLEngine) UserFromAPIKey(apik string) (string, error)
- func (e *ACLEngine) WatchForAuthChanges(ctx context.Context) (chan struct{}, error)
- type BuiltinUser
- type CachedUser
- type CachedUserKey
- type Capability
- type Group
- type IdentityProvider
- type User
Constants ¶
View Source
const DefaultPrefix = "btrdb"
View Source
const UserCacheTime = 3 * time.Minute
Variables ¶
Functions ¶
Types ¶
type ACLEngine ¶
type ACLEngine struct {
// contains filtered or unexported fields
}
func (*ACLEngine) AddCapabilityToGroup ¶
func (*ACLEngine) AddPrefixToGroup ¶
func (*ACLEngine) AddUserToGroup ¶
func (*ACLEngine) AuthenticateUser ¶
Returns false, nil, nil if password is incorrect or user does not exist
func (*ACLEngine) AuthenticateUserByKey ¶
func (*ACLEngine) CreateDefaultAdminUser ¶
func (*ACLEngine) CreateUser ¶
func (*ACLEngine) DeleteGroup ¶
func (*ACLEngine) DeleteUser ¶
func (*ACLEngine) GetAllUsers ¶
func (e *ACLEngine) ConstructUser(groups []string) (*User, error) { rv := &User{ Groups: groups, } pfxs := make(map[string]bool) caps := make(map[string]bool) for _, gs := range groups { g, err := e.GetGroup(gs) if err != nil { return nil, err } for _, p := range g.Prefixes { pfxs[p] = true } for _, p := range g.Capabilities { caps[p] = true } } for cap, _ := range caps { rv.Capabilities = append(rv.Capabilities, cap) } for pfx, _ := range pfxs { rv.Prefixes = append(rv.Prefixes, pfx) } return rv, nil }
func (*ACLEngine) GetIDP ¶
func (e *ACLEngine) GetIDP() (IdentityProvider, error)
func (*ACLEngine) GetPublicUser ¶
func (*ACLEngine) RemoveCapabilityFromGroup ¶
func (*ACLEngine) RemovePrefixFromGroup ¶
func (*ACLEngine) RemoveUserFromGroup ¶
func (*ACLEngine) SetIDP ¶
func (e *ACLEngine) SetIDP(p IdentityProvider) error
func (*ACLEngine) SetPassword ¶
type BuiltinUser ¶
type CachedUser ¶
type CachedUserKey ¶
type Capability ¶
type Capability string
type IdentityProvider ¶
type IdentityProvider string
var IDP_Builtin IdentityProvider = "BuiltIn"
var IDP_Invalid IdentityProvider = "invalid"
var IDP_LDAP IdentityProvider = "LDAP"
Click to show internal directories.
Click to hide internal directories.