Documentation ¶
Index ¶
- type Client
- type ClientQuery
- type Contact
- type Contacts
- type LoginRequest
- type Profile
- type QueryRequest
- type Resource
- type Role
- type User
- func (u User) ClientRole(profileID string) roletype.Enum
- func (u User) GetEmail() string
- func (u User) GetName() string
- func (u User) IsVerified() bool
- func (u User) ProvideClaim(claim string) (string, error)
- func (u User) ResourceAllowed(name string) bool
- func (u User) Valid() error
- func (u User) VerifyPassword(password string) bool
- type Userer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Name string `hsk:"size(30)"` Secret string Url string `hsk:"size(128)"` AllowedResources []string TermsEnabled bool CodesEnabled bool }
func (Client) ResourceAllowed ¶
func (Client) VerifySecret ¶
type ClientQuery ¶ added in v1.0.8
ClientQuery is the response from QueryRequest
type Contact ¶
type Contact struct { Icon string `hsk:"size(15)"` Name string `hsk:"size(20)"` Value string `hsk:"size(256)"` }
Contact holds information like email, facebook, cellphone
type LoginRequest ¶ added in v1.0.2
type Profile ¶
type Profile struct { Title string `hsk:"size(128)"` Description string `hsk:"size(512)" json:",omitempty"` Contacts Contacts ImageKey hsk.Key `hsk:"null"` Clients []Client Endpoints dict.Map Codes dict.Map Terms dict.Map }
func (Profile) GetClientClaims ¶ added in v1.5.3
func (Profile) ProvideClaim ¶
type QueryRequest ¶ added in v1.0.8
type QueryRequest struct { Token string Claims interface{} }
func (QueryRequest) GetRequirements ¶ added in v1.5.9
func (q QueryRequest) GetRequirements() (map[string]bool, error)
type Resource ¶
type Resource struct { Name string `hsk:"size(25)"` DisplayName string `hsk:"size(50)"` Secret string Needs []string }
func NewResource ¶ added in v1.0.26
func (Resource) VerifySecret ¶
type User ¶
type User struct { Name string `hsk:"size(75)"` Verified bool `hsk:"default(false)"` Email string `hsk:"size(128)"` Password string `hsk:"min(6)"` Contacts Contacts Resources []string Roles []Role }
func (User) IsVerified ¶
func (User) ResourceAllowed ¶ added in v1.0.6
func (User) VerifyPassword ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.