Documentation ¶
Index ¶
Constants ¶
View Source
const ( // AccountTypeAdmin define account type ADMIN AccountTypeAdmin = AccountType("ADMIN") // AccountTypeDevice define account type DEVICE AccountTypeDevice = AccountType("DEVICE") // AccountTypeOrg define account type ORG AccountTypeOrg = AccountType("ORG") // AccountTypeService define account type SERVICE AccountTypeService = AccountType("SERVICE") // AccountTypeUser define account type USER AccountTypeUser = AccountType("USER") // AccountTypeSessionUser define account type SESSION AccountTypeSessionUser = AccountType("SESSION") // AccountTypeClient define account type CLIENT AccountTypeClient = AccountType("CLIENT") // AccountTypeService define account type SERVICE AccountTypeResource = AccountType("RESOURCE") // RoleTypeUser role for users RoleTypeUser = RolesType("user") // RoleTypeService role for services RoleTypeService = RolesType("service") // RoleTypeResource role for resources RoleTypeResource = RolesType("resource") // RoleTypeAdmin role for admin actions RoleTypeAdmin = RolesType("admin") )
View Source
const AccountServicePrn = "accounts"
View Source
const TokenServicePrn = "tokens"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct { helpermodels.Timestamp `json:",inline" bson:",inline"` helpermodels.Identification `json:",inline" bson:",inline"` helpermodels.Ownership `json:"-" bson:"-"` Email string `json:"email" bson:"email"` Nick string `json:"username" bson:"nick"` Password string `json:"password" bson:"password"` Type AccountType `json:"type" bson:"type"` Role RolesType `json:"role" bson:"role"` }
Account account information all the structure
func (*Account) GetServicePrn ¶
type AccountToken ¶
type AccountToken struct { jwt.StandardClaims `json:",inline" bson:",inline"` ID string `json:"id"` Nick string `json:"nick"` Scopes string `json:"scopes"` Prn prnx.Prn `json:"prn"` Roles RolesType `json:"roles"` Type AccountType `json:"type"` }
AccountToken Token payload
type Token ¶
type Token struct { helpermodels.Identificable `json:",inline" bson:",inline"` helpermodels.Timestamp `json:",inline" bson:",inline"` helpermodels.Ownership `json:",inline" bson:",inline"` ExpiresAt *time.Time `json:"expires_at" bson:"expires_at"` Nick string `json:"nick" bson:"nick"` Scopes string `json:"scopes" bson:"scopes"` Roles RolesType `json:"roles" bson:"roles"` Type AccountType `json:"type" bson:"type"` Raw string `json:"token" bson:"raw"` }
Token database token
func (*Token) GetServicePrn ¶
type TokenPayload ¶
type TokenPayload struct { Token string `json:"token"` TokenType string `json:"token_type,omitempty"` Scopes string `json:"scopes,omitempty"` }
TokenPayload login token payload
Click to show internal directories.
Click to hide internal directories.