Documentation ¶
Index ¶
- type Authorize
- type AuthorizeAdmin
- type AuthorizeAdminAttributes
- type AuthorizeAdminListRequest
- type AuthorizeAdminRequest
- type AuthorizeAttributes
- type AuthorizeListRequest
- type AuthorizeRequest
- type Challenge
- type ChallengeAttributes
- type ChallengeListResponse
- type ChallengeResponse
- type Claim
- type Details
- type Flag
- type Flagger
- type Flags
- type Included
- func (c *Included) Add(includes ...Resource)
- func (c Included) MarshalJSON() ([]byte, error)
- func (c *Included) MustAuthorize(key Key) *Authorize
- func (c *Included) MustAuthorizeAdmin(key Key) *AuthorizeAdmin
- func (c *Included) MustChallenge(key Key) *Challenge
- func (c *Included) MustToken(key Key) *Token
- func (c *Included) MustValidation(key Key) *Validation
- func (c *Included) UnmarshalJSON(data []byte) error
- type Jwt
- type Key
- type Links
- type Relation
- type RelationCollection
- type Resource
- type ResourceType
- type Token
- type TokenAttributes
- type TokenListResponse
- type TokenResponse
- type Validation
- type ValidationAttributes
- type ValidationListResponse
- type ValidationResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Authorize ¶
type Authorize struct { Key Attributes AuthorizeAttributes `json:"attributes"` }
type AuthorizeAdmin ¶
type AuthorizeAdmin struct { Key Attributes AuthorizeAdminAttributes `json:"attributes"` }
type AuthorizeAdminAttributes ¶
type AuthorizeAdminAttributes struct { // Password to get admin permissions Password string `json:"password"` }
type AuthorizeAdminListRequest ¶
type AuthorizeAdminListRequest struct { Data []AuthorizeAdmin `json:"data"` Included Included `json:"included"` Links *Links `json:"links"` Meta json.RawMessage `json:"meta,omitempty"` }
func (*AuthorizeAdminListRequest) GetMeta ¶
func (r *AuthorizeAdminListRequest) GetMeta(out interface{}) error
func (*AuthorizeAdminListRequest) PutMeta ¶
func (r *AuthorizeAdminListRequest) PutMeta(v interface{}) (err error)
type AuthorizeAdminRequest ¶
type AuthorizeAdminRequest struct { Data AuthorizeAdmin `json:"data"` Included Included `json:"included"` }
type AuthorizeAttributes ¶
type AuthorizeAttributes struct { // Backend-generated challenge, signed by user Signature string `json:"signature"` }
type AuthorizeListRequest ¶
type AuthorizeListRequest struct { Data []Authorize `json:"data"` Included Included `json:"included"` Links *Links `json:"links"` Meta json.RawMessage `json:"meta,omitempty"` }
func (*AuthorizeListRequest) GetMeta ¶
func (r *AuthorizeListRequest) GetMeta(out interface{}) error
func (*AuthorizeListRequest) PutMeta ¶
func (r *AuthorizeListRequest) PutMeta(v interface{}) (err error)
type AuthorizeRequest ¶
type Challenge ¶
type Challenge struct { Key Attributes ChallengeAttributes `json:"attributes"` }
type ChallengeAttributes ¶
type ChallengeAttributes struct { // Random hex strings challenge which must be signed by user to authorize Challenge string `json:"challenge"` }
type ChallengeListResponse ¶
type ChallengeListResponse struct { Data []Challenge `json:"data"` Included Included `json:"included"` Links *Links `json:"links"` Meta json.RawMessage `json:"meta,omitempty"` }
func (*ChallengeListResponse) GetMeta ¶
func (r *ChallengeListResponse) GetMeta(out interface{}) error
func (*ChallengeListResponse) PutMeta ¶
func (r *ChallengeListResponse) PutMeta(v interface{}) (err error)
type ChallengeResponse ¶
type Claim ¶
type Claim struct { // Address authorized with Address string `json:"address"` // Whether the user has a admin permissions IsAdmin bool `json:"is_admin"` }
Authorized user personal data
type Details ¶
type Details json.RawMessage
func (Details) MarshalJSON ¶
MarshalJSON - casts Details to []byte
func (*Details) UnmarshalJSON ¶
UnmarshalJSON - casts data to Details
type Included ¶
type Included struct {
// contains filtered or unexported fields
}
Included - an array of Resource objects that are related to the primary data and/or each other (“included resources”).
func (Included) MarshalJSON ¶
MarshalJSON - marshals include collection as array of json objects
func (*Included) MustAuthorize ¶
MustAuthorize - returns Authorize from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics
func (*Included) MustAuthorizeAdmin ¶
func (c *Included) MustAuthorizeAdmin(key Key) *AuthorizeAdmin
MustAuthorizeAdmin - returns AuthorizeAdmin from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics
func (*Included) MustChallenge ¶
MustChallenge - returns Challenge from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics
func (*Included) MustToken ¶
MustToken - returns Token from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics
func (*Included) MustValidation ¶
func (c *Included) MustValidation(key Key) *Validation
MustValidation - returns Validation from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics
func (*Included) UnmarshalJSON ¶
UnmarshalJSON - unmarshal array of json objects into include collection
type Jwt ¶
type Jwt struct { // Base64 encoded JWT Token string `json:"token"` TokenType string `json:"token_type"` }
JWT token
type Key ¶
type Key struct { ID string `json:"id"` Type ResourceType `json:"type"` }
func NewKeyInt64 ¶
func NewKeyInt64(id int64, resourceType ResourceType) Key
func (Key) AsRelation ¶
type RelationCollection ¶
func (RelationCollection) MarshalJSON ¶
func (r RelationCollection) MarshalJSON() ([]byte, error)
type ResourceType ¶
type ResourceType string
const ( AUTHORIZE ResourceType = "authorize" CHALLENGE ResourceType = "challenge" TOKEN ResourceType = "token" VALIDATION ResourceType = "validation" )
List of ResourceType
type Token ¶
type Token struct { Key Attributes TokenAttributes `json:"attributes"` }
type TokenAttributes ¶
type TokenListResponse ¶
type TokenListResponse struct { Data []Token `json:"data"` Included Included `json:"included"` Links *Links `json:"links"` Meta json.RawMessage `json:"meta,omitempty"` }
func (*TokenListResponse) GetMeta ¶
func (r *TokenListResponse) GetMeta(out interface{}) error
func (*TokenListResponse) PutMeta ¶
func (r *TokenListResponse) PutMeta(v interface{}) (err error)
type TokenResponse ¶
type Validation ¶
type Validation struct { Key Attributes ValidationAttributes `json:"attributes"` }
type ValidationAttributes ¶
type ValidationAttributes struct {
Claims []Claim `json:"claims"`
}
type ValidationListResponse ¶
type ValidationListResponse struct { Data []Validation `json:"data"` Included Included `json:"included"` Links *Links `json:"links"` Meta json.RawMessage `json:"meta,omitempty"` }
func (*ValidationListResponse) GetMeta ¶
func (r *ValidationListResponse) GetMeta(out interface{}) error
func (*ValidationListResponse) PutMeta ¶
func (r *ValidationListResponse) PutMeta(v interface{}) (err error)
type ValidationResponse ¶
type ValidationResponse struct { Data Validation `json:"data"` Included Included `json:"included"` }
Source Files ¶
- db.go
- flag.go
- included.go
- links.go
- model_authorize.go
- model_authorize_admin.go
- model_authorize_admin_attributes.go
- model_authorize_attributes.go
- model_challenge.go
- model_challenge_attributes.go
- model_claim.go
- model_details.go
- model_jwt.go
- model_key.go
- model_relation.go
- model_relation_collection.go
- model_resource_type.go
- model_token.go
- model_token_attributes.go
- model_validation.go
- model_validation_attributes.go