Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( UserRoles = []Role{RoleUser} ManagerRoles = []Role{RoleUser, RoleManager} )
Functions ¶
func Fingerprint ¶
Types ¶
type CheckedUser ¶
type CheckedUser func(f UserFunction) restful.RouteFunction
type Key ¶
type User ¶
type User struct { Id string `json:"id"` Name string `json:"name"` Keys []Key `json:"keys"` Roles Roles `json:"roles"` Aliases []string `json:"aliases"` Use2FA bool `json:"use2fa"` AutologinAfter2FA int `json:"autologinafter2FA"` Allowance *Allowance `json:"allowance,omitempty"` IdToken string `json:"idtoken"` }
type UserFunction ¶
type UserFunction func(usr *User, request *restful.Request, response *restful.Response)
Signature for a restful function which needs an authorized user
type Users ¶
type Users interface { Create(network, id, name string, rolzs Roles) (*User, error) AddAlias(id, network, alias string) (*User, error) NewIdToken(uid string) (*User, error) ByIdToken(idtok string) (*User, error) RemoveAlias(id, network, alias string) (*User, error) GetAll() ([]User, error) Get(id string) (*User, error) AddKey(uid, kid string, pubkey string, fp string) (*Key, error) RemoveKey(uid, kid string) (*Key, error) Update(uid, username string, rolz Roles) (*User, error) Permit(a Allowance, ttlSecs uint64) error Delete(uid string) (*User, error) GetByKey(pubkey string) (*User, *Key, error) Create2FAToken(domain, uid string) (string, error) SetAutologinAfter2FA(uid string, duration int) (*User, error) Use2FAToken(uid string, use bool) error CheckToken(uid, token string) error CheckAndAllowToken(uid, token string, maxAllowance int) error Close() error }
type UsersService ¶
func (*UsersService) Register ¶
func (t *UsersService) Register(root string, c *restful.Container)
func (*UsersService) Shutdown ¶
func (t *UsersService) Shutdown() error
Click to show internal directories.
Click to hide internal directories.