Documentation
¶
Index ¶
- type Authorize
- 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) MustChallenge(key Key) *Challenge
- func (c *Included) MustToken(key Key) *Token
- func (c *Included) MustValidationResult(key Key) *ValidationResult
- func (c *Included) UnmarshalJSON(data []byte) error
- type Jwt
- type Key
- type Links
- type Proof
- type Relation
- type RelationCollection
- type Resource
- type ResourceType
- type Token
- type TokenAttributes
- type TokenListResponse
- type TokenResponse
- type ValidationResult
- type ValidationResultAttributes
- type ValidationResultListResponse
- type ValidationResultResponse
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 AuthorizeAttributes ¶
type AuthorizeAttributes struct {
// JSON encoded ZK proof AuthV2 proof.
Proof json.RawMessage `json:"proof"`
}
type AuthorizeListRequest ¶
type AuthorizeRequest ¶
type Challenge ¶
type Challenge struct {
Key
Attributes ChallengeAttributes `json:"attributes"`
}
type ChallengeAttributes ¶
type ChallengeAttributes struct {
// Base64 encoded challenge. Use it to generate AuthV2 ZK proof. Decode base64 string and convert into big-endian decimal number.
Challenge string `json:"challenge"`
}
type ChallengeListResponse ¶
type ChallengeResponse ¶
type Claim ¶
type Claim struct {
// User EVM address hex-encoded
Address *string `json:"address,omitempty"`
// User DID authorized with
User string `json:"user"`
}
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) 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) MustValidationResult ¶
func (c *Included) MustValidationResult(key Key) *ValidationResult
MustValidationResult - returns ValidationResult 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:"tokenType"`
}
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 Proof ¶
type Proof struct {
// User EVM address hex-encoded
Address string `json:"address"`
// JSON encoded ZK proof AuthV2 proof.
Proof json.RawMessage `json:"proof"`
}
Auth proof
type RelationCollection ¶
func (RelationCollection) MarshalJSON ¶
func (r RelationCollection) MarshalJSON() ([]byte, error)
type ResourceType ¶
type ResourceType string
const ( REQUEST_AUTHORIZE ResourceType = "request-authorize" REQUEST_CHALLENGE ResourceType = "request-challenge" TOKEN ResourceType = "token" VALIDATION ResourceType = "validation" CHALLENGE ResourceType = "challenge" )
List of ResourceType
type Token ¶
type Token struct {
Key
Attributes TokenAttributes `json:"attributes"`
}
type TokenAttributes ¶
type TokenListResponse ¶
type TokenResponse ¶
type ValidationResult ¶
type ValidationResult struct {
Key
Attributes ValidationResultAttributes `json:"attributes"`
}
type ValidationResultAttributes ¶
type ValidationResultAttributes struct {
Claims []Claim `json:"claims"`
}
type ValidationResultListResponse ¶
type ValidationResultListResponse struct {
Data []ValidationResult `json:"data"`
Included Included `json:"included"`
Links *Links `json:"links"`
}
type ValidationResultResponse ¶
type ValidationResultResponse struct {
Data ValidationResult `json:"data"`
Included Included `json:"included"`
}
Source Files
¶
- db.go
- flag.go
- included.go
- links.go
- model_authorize.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_proof.go
- model_relation.go
- model_relation_collection.go
- model_resource_type.go
- model_token.go
- model_token_attributes.go
- model_validation_result.go
- model_validation_result_attributes.go