Documentation ¶
Index ¶
- Constants
- type Error
- type Permissions
- type Role
- type Store
- func (s *Store) AllRoles() ([]string, error)
- func (s *Store) AllUsers() ([]string, error)
- func (s *Store) AuthEnabled() bool
- func (s *Store) CreateOrUpdateUser(user User) (out User, created bool, err error)
- func (s *Store) CreateRole(role Role) error
- func (s *Store) CreateUser(user User) (User, error)
- func (s *Store) DeleteRole(name string) error
- func (s *Store) DeleteUser(name string) error
- func (s *Store) DisableAuth() error
- func (s *Store) EnableAuth() error
- func (s *Store) GetRole(name string) (Role, error)
- func (s *Store) GetUser(name string) (User, error)
- func (s *Store) UpdateRole(role Role) (Role, error)
- func (s *Store) UpdateUser(user User) (User, error)
- type User
Constants ¶
View Source
const ( // StorePermsPrefix is the internal prefix of the storage layer dedicated to storing user data. StorePermsPrefix = "/2" // RootRoleName is the name of the ROOT role, with privileges to manage the cluster. RootRoleName = "root" // GuestRoleName is the name of the role that defines the privileges of an unauthenticated user. GuestRoleName = "guest" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
func (Error) HTTPStatus ¶
type Permissions ¶
type Permissions struct {
KV rwPermission `json:"kv"`
}
func (Permissions) Grant ¶
func (p Permissions) Grant(n *Permissions) (Permissions, error)
Grant adds a set of permissions to the permission object on which it is called, returning a new permission object.
func (*Permissions) IsEmpty ¶
func (p *Permissions) IsEmpty() bool
func (Permissions) Revoke ¶
func (p Permissions) Revoke(n *Permissions) (Permissions, error)
Revoke removes a set of permissions to the permission object on which it is called, returning a new permission object.
type Role ¶
type Role struct { Role string `json:"role"` Permissions Permissions `json:"permissions"` Grant *Permissions `json:"grant,omitempty"` Revoke *Permissions `json:"revoke,omitempty"` }
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) AuthEnabled ¶
func (*Store) CreateOrUpdateUser ¶
CreateOrUpdateUser should be only used for creating the new user or when you are not sure if it is a create or update. (When only password is passed in, we are not sure if it is a update or create)
func (*Store) CreateRole ¶
func (*Store) DeleteRole ¶
func (*Store) DeleteUser ¶
func (*Store) DisableAuth ¶
func (*Store) EnableAuth ¶
Click to show internal directories.
Click to hide internal directories.