Documentation ¶
Index ¶
- func ValidEntityId(entityId string) bool
- func ValidPassword(password string) bool
- type Entity
- func (u *Entity) Enable()
- func (u *Entity) GenerateTotp() (code string, err error)
- func (u *Entity) HasPassword(password string) bool
- func (u *Entity) Invalidate()
- func (u *Entity) IsAdmin() bool
- func (u *Entity) IsEnabled() bool
- func (u *Entity) IsMachine() bool
- func (u *Entity) IsTotpToConfigure() bool
- func (u *Entity) IsUser() bool
- func (u *Entity) ResetTotp(config config.TotpConfig) error
- func (u *Entity) SetPassword(password string) (err error)
- func (u *Entity) SetTotpConfigured(configured bool)
- func (u *Entity) Suspend()
- func (u *Entity) Validate()
- func (u *Entity) ValidateTotp(code string) (bool, error)
- type EntityMetadata
- type EntityType
- type TotpParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidEntityId ¶
func ValidPassword ¶
Types ¶
type Entity ¶
type Entity struct { Id string `json:"id" bson:"_id"` Type EntityType `json:"type" bson:"type"` PasswordHash []byte `json:"passwordHash" bson:"passwordHash"` Validated bool `json:"validated" bson:"validated"` Suspended bool `json:"suspended" bson:"suspended"` TotpConfigured bool `json:"totpConfigured" bson:"totpConfigured"` TotpUri string `json:"totpUri" bson:"totpUri"` RecoveryTokens []string `json:"recoveryTokens" bson:"recoveryTokens"` Roles roles.Roles `json:"roles" bson:"roles"` }
func NewEntity ¶
func NewEntity(typ EntityType, entityId string, password string, totpConfig config.TotpConfig) (u Entity, err error)
func (*Entity) GenerateTotp ¶
func (*Entity) HasPassword ¶
func (*Entity) Invalidate ¶
func (u *Entity) Invalidate()
func (*Entity) IsTotpToConfigure ¶
func (*Entity) SetPassword ¶
func (*Entity) SetTotpConfigured ¶
type EntityMetadata ¶
type EntityType ¶
type EntityType int
const ( TypeUndefined EntityType = iota TypeUser TypeMachine TypeAdmin )
type TotpParams ¶
Click to show internal directories.
Click to hide internal directories.