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) MustValidationResult(key Key) *ValidationResult
- func (c *Included) MustVerifyPassport(key Key) *VerifyPassport
- 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
- type VerifyPassport
- type VerifyPassportAttributes
- type VerifyPassportListRequest
- type VerifyPassportRequest
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 ¶ added in v0.2.0
type AuthorizeAdmin struct { Key Attributes AuthorizeAdminAttributes `json:"attributes"` }
type AuthorizeAdminAttributes ¶ added in v0.2.0
type AuthorizeAdminAttributes struct { // Password to get admin permissions Password string `json:"password"` }
type AuthorizeAdminListRequest ¶ added in v0.2.0
type AuthorizeAdminListRequest struct { Data []AuthorizeAdmin `json:"data"` Included Included `json:"included"` Links *Links `json:"links"` Meta json.RawMessage `json:"meta,omitempty"` }
func (*AuthorizeAdminListRequest) GetMeta ¶ added in v0.2.0
func (r *AuthorizeAdminListRequest) GetMeta(out interface{}) error
func (*AuthorizeAdminListRequest) PutMeta ¶ added in v0.2.0
func (r *AuthorizeAdminListRequest) PutMeta(v interface{}) (err error)
type AuthorizeAdminRequest ¶ added in v0.2.0
type AuthorizeAdminRequest struct { Data AuthorizeAdmin `json:"data"` Included Included `json:"included"` }
type AuthorizeAttributes ¶
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 { // Base64 encoded challenge. Use it to generate Query ZK-proof. Decode base64 string and convert into big-endian decimal number. 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 { // Whether the user has a admin permissions IsAdmin bool `json:"is_admin"` // Whether the user has a scanned passport IsVerified bool `json:"is_verified"` // Nullifier authorized with Nullifier string `json:"nullifier"` SharedHash *string `json:"shared_hash,omitempty"` }
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 ¶ added in v0.2.0
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) 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) MustVerifyPassport ¶
func (c *Included) MustVerifyPassport(key Key) *VerifyPassport
MustVerifyPassport - returns VerifyPassport 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 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 ( AUTHORIZE_ADMIN ResourceType = "authorize_admin" AUTHORIZE ResourceType = "authorize" CHALLENGE ResourceType = "challenge" TOKEN ResourceType = "token" VALIDATION ResourceType = "validation" AUTHORIZE_V2 ResourceType = "authorize_v2" )
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 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"` Meta json.RawMessage `json:"meta,omitempty"` }
func (*ValidationResultListResponse) GetMeta ¶
func (r *ValidationResultListResponse) GetMeta(out interface{}) error
func (*ValidationResultListResponse) PutMeta ¶
func (r *ValidationResultListResponse) PutMeta(v interface{}) (err error)
type ValidationResultResponse ¶
type ValidationResultResponse struct { Data ValidationResult `json:"data"` Included Included `json:"included"` }
type VerifyPassport ¶
type VerifyPassport struct { Key Attributes VerifyPassportAttributes `json:"attributes"` }
type VerifyPassportListRequest ¶
type VerifyPassportListRequest struct { Data []VerifyPassport `json:"data"` Included Included `json:"included"` Links *Links `json:"links"` Meta json.RawMessage `json:"meta,omitempty"` }
func (*VerifyPassportListRequest) GetMeta ¶
func (r *VerifyPassportListRequest) GetMeta(out interface{}) error
func (*VerifyPassportListRequest) PutMeta ¶
func (r *VerifyPassportListRequest) PutMeta(v interface{}) (err error)
type VerifyPassportRequest ¶
type VerifyPassportRequest struct { Data VerifyPassport `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_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
- model_verify_passport.go
- model_verify_passport_attributes.go