Documentation ¶
Index ¶
- Constants
- type ActiveBody
- type AuthenticateOptions
- type AuthenticationPayload
- type AuthenticationPayloadData
- type AuthenticationPayloadDataInput
- type GenerateOptions
- type LoginOptions
- type LoginPayload
- type LoginPayloadBody
- type LoginPayloadData
- type PayloadBody
- type RefreshOptions
- type SignVerifier
- type Signer
- type ThirdwebAuthConfig
- type ThirdwebAuthConfigAuthOptions
- type ThirdwebAuthConfigCallbacks
- type ThirdwebAuthConfigCookieOptions
- type ThirdwebAuthOptions
- type ThirdwebAuthUser
- type User
- type Verifier
- type VerifyOptions
Constants ¶
View Source
const ( AuthTokenCookiePrefix = "thirdweb_auth_token" AuthActiveAccountCookie = "thirdweb_auth_active_account" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActiveBody ¶
type ActiveBody struct {
Address string `json:"address" validate:"required"`
}
type AuthenticateOptions ¶
type AuthenticationPayload ¶
type AuthenticationPayload struct { Payload *AuthenticationPayloadData `json:"payload" validate:"required"` Signature string `json:"signature" validate:"required"` }
type AuthenticationPayloadData ¶
type AuthenticationPayloadData struct { ISS string `json:"iss" validate:"required"` SUB string `json:"sub" validate:"required"` AUD string `json:"aud" validate:"required"` EXP int64 `json:"exp" validate:"required"` NBF int64 `json:"nbf" validate:"required"` IAT int64 `json:"iat" validate:"required"` JTI string `json:"jti" validate:"required"` CTX interface{} `json:"ctx"` }
type AuthenticationPayloadDataInput ¶
type AuthenticationPayloadDataInput struct { ISS string `json:"iss" validate:"required"` SUB string `json:"sub" validate:"required"` AUD string `json:"aud" validate:"required"` EXP time.Time `json:"exp" validate:"required"` NBF time.Time `json:"nbf" validate:"required"` IAT time.Time `json:"iat" validate:"required"` JTI string `json:"jti" validate:"required"` CTX interface{} `json:"ctx"` }
func DefaultAuthenticationPayloadDataInput ¶
func DefaultAuthenticationPayloadDataInput() *AuthenticationPayloadDataInput
func (*AuthenticationPayloadDataInput) ToData ¶
func (input *AuthenticationPayloadDataInput) ToData() *AuthenticationPayloadData
type GenerateOptions ¶
type GenerateOptions struct { Domain string `json:"domain,omitempty"` TokenId string `json:"tokenId,omitempty"` ExpirationTime time.Time `json:"expirationTime"` InvalidBefore time.Time `json:"invalidBefore,omitempty"` Session func(string) interface{} `json:"session,omitempty"` VerifyOptions VerifyOptions `json:"verifyOptions,omitempty"` }
func DefaultGenerateOptions ¶
func DefaultGenerateOptions() *GenerateOptions
type LoginOptions ¶
type LoginOptions struct { Domain string `json:"domain,omitempty"` Address string `json:"address,omitempty"` Statement string `json:"statement,omitempty"` URI string `json:"uri,omitempty"` Version string `json:"version,omitempty"` ChainID string `json:"chainId,omitempty"` Nonce string `json:"nonce,omitempty"` ExpirationTime time.Time `json:"expirationTime,omitempty"` InvalidBefore time.Time `json:"invalidBefore,omitempty"` Resources []string `json:"resources,omitempty"` }
func DefaultLoginOptions ¶
func DefaultLoginOptions() *LoginOptions
type LoginPayload ¶
type LoginPayload struct { Payload *LoginPayloadData `json:"payload" validate:"required"` Signature string `json:"signature" validate:"required"` }
type LoginPayloadBody ¶
type LoginPayloadBody struct {
Payload LoginPayload `json:"payload" validate:"required"`
}
type LoginPayloadData ¶
type LoginPayloadData struct { Type string `json:"type" validate:"required"` Domain string `json:"domain" validate:"required"` Address string `json:"address" validate:"required"` Statement string `json:"statement" validate:"required"` URI string `json:"uri,omitempty"` Version string `json:"version" validate:"required"` ChainID string `json:"chain_id,omitempty"` Nonce string `json:"nonce" validate:"required"` IssuedAt string `json:"issued_at" validate:"required"` ExpirationTime string `json:"expiration_time,omitempty"` InvalidBefore string `json:"invalid_before" validate:"required"` Resources []string `json:"resources,omitempty"` }
func DefaultLoginPayloadData ¶
func DefaultLoginPayloadData() *LoginPayloadData
type PayloadBody ¶
type RefreshOptions ¶
func DefaultRefreshOptions ¶
func DefaultRefreshOptions() *RefreshOptions
type SignVerifier ¶
type ThirdwebAuthConfig ¶
type ThirdwebAuthConfig struct { Domain string Verifier SignVerifier AuthOptions ThirdwebAuthConfigAuthOptions CookieOptions ThirdwebAuthConfigCookieOptions Callbacks ThirdwebAuthConfigCallbacks ThirdwebAuthOptions ThirdwebAuthOptions }
type ThirdwebAuthConfigAuthOptions ¶
type ThirdwebAuthConfigAuthOptions struct { Statement string `json:"statement,omitempty"` URI string `json:"uri,omitempty"` Version string `json:"version,omitempty"` ChainID string `json:"chainId,omitempty"` Resources []string `json:"resources,omitempty"` ValidateNonce func(string) error `json:"-"` ValidateTokenId func(string) error `json:"-"` LoginPayloadDuration time.Duration `json:"loginPayloadDuration,omitempty"` TokenDuration time.Duration `json:"tokenDuration,omitempty"` RefreshInterval time.Duration `json:"refreshInterval,omitempty"` }
type ThirdwebAuthOptions ¶
func NewThirdwebAuthOptions ¶
func NewThirdwebAuthOptions() *ThirdwebAuthOptions
func (*ThirdwebAuthOptions) WithClientID ¶
func (o *ThirdwebAuthOptions) WithClientID(clientID string) *ThirdwebAuthOptions
func (*ThirdwebAuthOptions) WithClientSecret ¶
func (o *ThirdwebAuthOptions) WithClientSecret(clientSecret string) *ThirdwebAuthOptions
func (*ThirdwebAuthOptions) WithJwtISS ¶
func (o *ThirdwebAuthOptions) WithJwtISS(jwtISS string) *ThirdwebAuthOptions
type ThirdwebAuthUser ¶
type ThirdwebAuthUser struct { Address string `json:"address" validate:"required"` Session interface{} `json:"session,omitempty"` Data interface{} `json:"data,omitempty"` }
type User ¶
type User struct { Address string `json:"address" validate:"required"` Session interface{} `json:"session,omitempty"` }
type VerifyOptions ¶
type VerifyOptions struct { Domain string `json:"domain,omitempty"` Statement string `json:"statement,omitempty"` URI string `json:"uri,omitempty"` Version string `json:"version,omitempty"` ChainID string `json:"chainId,omitempty"` Resources []string `json:"resources,omitempty"` ValidateNonce func(string) error `json:"-"` }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.