stytch

package
v5.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 14, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvTest = config.EnvTest
	EnvLive = config.EnvLive
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AppleOAuthFactor

type AppleOAuthFactor struct {
	ID              string `json:"id,omitempty"`
	EmailID         string `json:"email_id,omitempty"`
	ProviderSubject string `json:"provider_subject,omitempty"`
}

type Attributes

type Attributes struct {
	// The ip address of the user.
	IPAddress string `json:"ip_address,omitempty"`
	// The user agent of the user.
	UserAgent string `json:"user_agent,omitempty"`
}

* Structure for the custom type Attributes

type AuthenticationFactor

type AuthenticationFactor struct {
	Type                string `json:"type,omitempty"`
	DeliveryMethod      string `json:"delivery_method,omitempty"`
	LastAuthenticatedAt string `json:"last_authenticated_at,omitempty"`

	EmailFactor            EmailFactor            `json:"email_factor,omitempty"`
	PhoneNumberFactor      PhoneNumberFactor      `json:"phone_number_factor,omitempty"`
	GoogleOAuthFactor      GoogleOAuthFactor      `json:"google_oauth_factor,omitempty"`
	MicrosoftOAuthFactor   MicrosoftOAuthFactor   `json:"microsoft_oauth_factor,omitempty"`
	AppleOAuthFactor       AppleOAuthFactor       `json:"apple_oauth_factor,omitempty"`
	GithubOAuthFactor      GithubOAuthFactor      `json:"github_oauth_factor,omitempty"`
	GitLabOAuthFactor      GitLabOAuthFactor      `json:"gitlab_oauth_factor,omitempty"`
	FacebookOAuthFactor    FacebookOAuthFactor    `json:"facebook_oauth_factor,omitempty"`
	WebAuthnFactor         WebAuthnFactor         `json:"webauthn_factor,omitempty"`
	AuthenticatorAppFactor AuthenticatorAppFactor `json:"authenticator_app_factor,omitempty"`
	RecoveryCodeFactor     RecoveryCodeFactor     `json:"recovery_code_factor,omitempty"`
	CryptoWalletFactor     CryptoWalletFactor     `json:"crypto_wallet_factor,omitempty"`
}

type AuthenticatorAppFactor

type AuthenticatorAppFactor struct {
	TOTPID string `json:"totp_id,omitempty"`
}

type Claims

type Claims struct {
	StytchSession SessionClaim `json:"https://stytch.com/session"`
	jwt.RegisteredClaims
}

func (Claims) IsValid

func (c Claims) IsValid(projectID string) error

Validation options in GoJWT are currently unexported. Once they're exported, we can define this as a Valid() function, see https://github.com/golang-jwt/jwt/blob/1096e506e671d6d6fe134cc997bbd475937392c8/validator_option.go#L9-L11 //nolint:lll

type Client

type Client struct {
	Config     *config.Config
	HTTPClient *http.Client
}

func New

func New(env config.Env, projectID string, secret string) *Client

func (*Client) NewRequest

func (c *Client) NewRequest(method string, path string, queryParams map[string]string,
	body []byte, v interface{},
) error

newRequest is used by Call to generate and Do a http.Request

type CryptoWallet

type CryptoWallet struct {
	CryptoWalletID      string `json:"crypto_wallet_id,omitempty"`
	CryptoWalletAddress string `json:"crypto_wallet_address,omitempty"`
	CryptoWalletType    string `json:"crypto_wallet_type,omitempty"`
	Verified            bool   `json:"verified,omitempty"`
}

type CryptoWalletAuthenticateParams

type CryptoWalletAuthenticateParams struct {
	CryptoWalletAddress    string `json:"crypto_wallet_address,omitempty"`
	CryptoWalletType       string `json:"crypto_wallet_type,omitempty"`
	Signature              string `json:"signature,omitempty"`
	SessionToken           string `json:"session_token,omitempty"`
	SessionJWT             string `json:"session_jwt,omitempty"`
	SessionDurationMinutes int32  `json:"session_duration_minutes,omitempty"`
}

type CryptoWalletAuthenticateResponse

type CryptoWalletAuthenticateResponse struct {
	RequestID    string  `json:"request_id,omitempty"`
	StatusCode   int     `json:"status_code,omitempty"`
	UserID       string  `json:"user_id,omitempty"`
	SessionToken string  `json:"session_token,omitempty"`
	SessionJWT   string  `json:"session_jwt,omitempty"`
	Session      Session `json:"session,omitempty"`
	User         User    `json:"user,omitempty"`
}

type CryptoWalletAuthenticateStartParams

type CryptoWalletAuthenticateStartParams struct {
	CryptoWalletAddress string `json:"crypto_wallet_address,omitempty"`
	CryptoWalletType    string `json:"crypto_wallet_type,omitempty"`
	UserID              string `json:"user_id,omitempty"`
}

type CryptoWalletAuthenticateStartResponse

type CryptoWalletAuthenticateStartResponse struct {
	RequestID   string `json:"request_id,omitempty"`
	StatusCode  int    `json:"status_code,omitempty"`
	UserID      string `json:"user_id,omitempty"`
	Challenge   string `json:"challenge,omitempty"`
	UserCreated bool   `json:"user_created,omitempty"`
}

type CryptoWalletFactor

type CryptoWalletFactor struct {
	CryptoWalletID      string `json:"crypto_wallet_id,omitempty"`
	CryptoWalletAddress string `json:"crypto_wallet_address,omitempty"`
	CryptoWalletType    string `json:"crypto_wallet_type,omitempty"`
}

type CryptoWalletString

type CryptoWalletString struct {
	CryptoWalletAddress string `json:"crypto_wallet_address,omitempty"`
	CryptoWalletType    string `json:"crypto_wallet_type,omitempty"`
}

type Email

type Email struct {
	EmailID  string `json:"email_id,omitempty"`
	Email    string `json:"email,omitempty"`
	Verified bool   `json:"verified,omitempty"`
}

type EmailFactor

type EmailFactor struct {
	EmailID      string `json:"email_id,omitempty"`
	EmailAddress string `json:"email_address,omitempty"`
}

type EmailString

type EmailString struct {
	Email string `json:"email,omitempty"`
}

type FacebookOAuthFactor

type FacebookOAuthFactor struct {
	ID              string `json:"id,omitempty"`
	EmailID         string `json:"email_id,omitempty"`
	ProviderSubject string `json:"provider_subject,omitempty"`
}

type GitLabOAuthFactor

type GitLabOAuthFactor struct {
	ID              string `json:"id,omitempty"`
	EmailID         string `json:"email_id,omitempty"`
	ProviderSubject string `json:"provider_subject,omitempty"`
}

type GithubOAuthFactor

type GithubOAuthFactor struct {
	ID              string `json:"id,omitempty"`
	EmailID         string `json:"email_id,omitempty"`
	ProviderSubject string `json:"provider_subject,omitempty"`
}

type GoogleOAuthFactor

type GoogleOAuthFactor struct {
	ID              string `json:"id,omitempty"`
	EmailID         string `json:"email_id,omitempty"`
	ProviderSubject string `json:"provider_subject,omitempty"`
}

type JWTAuthenticationFactor

type JWTAuthenticationFactor struct {
	Type                string           `json:"type,omitempty"`
	DeliveryMethod      string           `json:"delivery_method,omitempty"`
	LastAuthenticatedAt *jwt.NumericDate `json:"last_authenticated_at,omitempty"`

	EmailFactor            EmailFactor            `json:"email_factor,omitempty"`
	PhoneNumberFactor      PhoneNumberFactor      `json:"phone_number_factor,omitempty"`
	GoogleOAuthFactor      GoogleOAuthFactor      `json:"google_oauth_factor,omitempty"`
	MicrosoftOAuthFactor   MicrosoftOAuthFactor   `json:"microsoft_oauth_factor,omitempty"`
	AppleOAuthFactor       AppleOAuthFactor       `json:"apple_oauth_factor,omitempty"`
	GithubOAuthFactor      GithubOAuthFactor      `json:"github_oauth_factor,omitempty"`
	FacebookOAuthFactor    FacebookOAuthFactor    `json:"facebook_oauth_factor,omitempty"`
	WebAuthnFactor         WebAuthnFactor         `json:"webauthn_factor,omitempty"`
	AuthenticatorAppFactor AuthenticatorAppFactor `json:"authenticator_app_factor,omitempty"`
	RecoveryCodeFactor     RecoveryCodeFactor     `json:"recovery_code_factor,omitempty"`
	CryptoWalletFactor     CryptoWalletFactor     `json:"crypto_wallet_factor,omitempty"`
}

type Key

type Key struct {
	Typ     string   `json:"kty"`
	Use     string   `json:"use"`
	KeyOps  []string `json:"key_ops"`
	Alg     string   `json:"alg"`
	KeyID   string   `json:"kid"`
	X5C     []string `json:"x5c"`
	X5TS256 string   `json:"x5tS256"`
	N       string   `json:"n"`
	E       string   `json:"e"`
}

type MagicLinksAuthenticateParams

type MagicLinksAuthenticateParams struct {
	Token                  string     `json:"token,omitempty"`
	Options                Options    `json:"options,omitempty"`
	Attributes             Attributes `json:"attributes,omitempty"`
	SessionToken           string     `json:"session_token,omitempty"`
	SessionJWT             string     `json:"session_jwt,omitempty"`
	SessionDurationMinutes int32      `json:"session_duration_minutes,omitempty"`
	CodeVerifier           string     `json:"code_verifier,omitempty"`
}

type MagicLinksAuthenticateResponse

type MagicLinksAuthenticateResponse struct {
	RequestID    string  `json:"request_id,omitempty"`
	StatusCode   int     `json:"status_code,omitempty"`
	UserID       string  `json:"user_id,omitempty"`
	MethodID     string  `json:"method_id,omitempty"`
	SessionToken string  `json:"session_token,omitempty"`
	SessionJWT   string  `json:"session_jwt,omitempty"`
	Session      Session `json:"session,omitempty"`
	User         User    `json:"user,omitempty"`
}

type MagicLinksCreateParams

type MagicLinksCreateParams struct {
	UserID            string     `json:"user_id,omitempty"`
	ExpirationMinutes int32      `json:"expiration_minutes,omitempty"`
	Attributes        Attributes `json:"attributes,omitempty"`
}

type MagicLinksCreateResponse

type MagicLinksCreateResponse struct {
	RequestID  string `json:"request_id,omitempty"`
	StatusCode int    `json:"status_code,omitempty"`
	UserID     string `json:"user_id,omitempty"`
	Token      string `json:"token,omitempty"`
}

type MagicLinksEmailInviteParams

type MagicLinksEmailInviteParams struct {
	Email                   string     `json:"email"`
	InviteMagicLinkURL      string     `json:"invite_magic_link_url,omitempty"`
	InviteExpirationMinutes int32      `json:"invite_expiration_minutes,omitempty"`
	Name                    Name       `json:"name,omitempty"`
	Attributes              Attributes `json:"attributes,omitempty"`
}

type MagicLinksEmailInviteResponse

type MagicLinksEmailInviteResponse struct {
	RequestID  string `json:"request_id,omitempty"`
	StatusCode int    `json:"status_code,omitempty"`
	UserID     string `json:"user_id,omitempty"`
	EmailID    string `json:"email_id,omitempty"`
}

type MagicLinksEmailLoginOrCreateParams

type MagicLinksEmailLoginOrCreateParams struct {
	Email                   string     `json:"email"`
	LoginMagicLinkURL       string     `json:"login_magic_link_url,omitempty"`
	SignupMagicLinkURL      string     `json:"signup_magic_link_url,omitempty"`
	LoginExpirationMinutes  int32      `json:"login_expiration_minutes,omitempty"`
	SignupExpirationMinutes int32      `json:"signup_expiration_minutes,omitempty"`
	CreateUserAsPending     bool       `json:"create_user_as_pending,omitempty"`
	Attributes              Attributes `json:"attributes,omitempty"`
	CodeChallenge           string     `json:"code_challenge,omitempty"`
}

type MagicLinksEmailLoginOrCreateResponse

type MagicLinksEmailLoginOrCreateResponse struct {
	RequestID   string `json:"request_id,omitempty"`
	StatusCode  int    `json:"status_code,omitempty"`
	UserID      string `json:"user_id,omitempty"`
	EmailID     string `json:"email_id,omitempty"`
	UserCreated bool   `json:"user_created,omitempty"`
}

type MagicLinksEmailRevokeInviteParams

type MagicLinksEmailRevokeInviteParams struct {
	Email string `json:"email"`
}

type MagicLinksEmailRevokeInviteResponse

type MagicLinksEmailRevokeInviteResponse struct {
	RequestID  string `json:"request_id,omitempty"`
	StatusCode int    `json:"status_code,omitempty"`
}

type MagicLinksEmailSendParams

type MagicLinksEmailSendParams struct {
	Email                   string     `json:"email"`
	LoginMagicLinkURL       string     `json:"login_magic_link_url,omitempty"`
	SignupMagicLinkURL      string     `json:"signup_magic_link_url,omitempty"`
	LoginExpirationMinutes  int32      `json:"login_expiration_minutes,omitempty"`
	SignupExpirationMinutes int32      `json:"signup_expiration_minutes,omitempty"`
	Attributes              Attributes `json:"attributes,omitempty"`
	CodeChallenge           string     `json:"code_challenge,omitempty"`
}

MAGIC LINK - EMAIL

type MagicLinksEmailSendResponse

type MagicLinksEmailSendResponse struct {
	RequestID  string `json:"request_id,omitempty"`
	StatusCode int    `json:"status_code,omitempty"`
	UserID     string `json:"user_id,omitempty"`
	EmailID    string `json:"email_id,omitempty"`
}

type MicrosoftOAuthFactor

type MicrosoftOAuthFactor struct {
	ID              string `json:"id,omitempty"`
	EmailID         string `json:"email_id,omitempty"`
	ProviderSubject string `json:"provider_subject,omitempty"`
}

type Name

type Name struct {
	FirstName  string `json:"first_name,omitempty"`
	MiddleName string `json:"middle_name,omitempty"`
	LastName   string `json:"last_name,omitempty"`
}

type OAuthAuthenticateParams

type OAuthAuthenticateParams struct {
	Token                  string `json:"token,omitempty"`
	SessionToken           string `json:"session_token,omitempty"`
	SessionJWT             string `json:"session_jwt,omitempty"`
	SessionDurationMinutes int32  `json:"session_duration_minutes,omitempty"`
	CodeVerifier           string `json:"code_verifier,omitempty"`
}

type OAuthAuthenticateResponse

type OAuthAuthenticateResponse struct {
	RequestID       string         `json:"request_id,omitempty"`
	StatusCode      int            `json:"status_code,omitempty"`
	UserID          string         `json:"user_id,omitempty"`
	ProviderSubject string         `json:"provider_subject,omitempty"`
	ProviderType    ProviderType   `json:"provider_type,omitempty"`
	Session         *Session       `json:"session,omitempty"`
	SessionToken    string         `json:"session_token,omitempty"`
	SessionJWT      string         `json:"session_jwt,omitempty"`
	ProviderValues  ProviderValues `json:"provider_values,omitempty"`
}

type OAuthProvider

type OAuthProvider struct {
	ProviderType      string `json:"provider_type,omitempty"`
	ProviderSubject   string `json:"provider_subject,omitempty"`
	ProfilePictureURL string `json:"profile_picture_url,omitempty"`
	Locale            string `json:"locale,omitempty"`
}

type OTPsAuthenticateParams

type OTPsAuthenticateParams struct {
	MethodID               string     `json:"method_id"`
	Code                   string     `json:"code"`
	Options                Options    `json:"options,omitempty"`
	Attributes             Attributes `json:"attributes,omitempty"`
	SessionToken           string     `json:"session_token,omitempty"`
	SessionDurationMinutes int32      `json:"session_duration_minutes,omitempty"`
	SessionJWT             string     `json:"session_jwt,omitempty"`
}

type OTPsAuthenticateResponse

type OTPsAuthenticateResponse struct {
	RequestID    string  `json:"request_id,omitempty"`
	StatusCode   int     `json:"status_code,omitempty"`
	UserID       string  `json:"user_id,omitempty"`
	MethodID     string  `json:"method_id,omitempty"`
	SessionToken string  `json:"session_token,omitempty"`
	Session      Session `json:"session,omitempty"`
	SessionJWT   string  `json:"session_jwt,omitempty"`
	User         User    `json:"user,omitempty"`
}

type OTPsEmailLoginOrCreateParams

type OTPsEmailLoginOrCreateParams struct {
	Email               string     `json:"email"`
	ExpirationMinutes   int32      `json:"expiration_minutes,omitempty"`
	Attributes          Attributes `json:"attributes,omitempty"`
	CreateUserAsPending bool       `json:"create_user_as_pending,omitempty"`
}

type OTPsEmailLoginOrCreateResponse

type OTPsEmailLoginOrCreateResponse struct {
	RequestID   string `json:"request_id,omitempty"`
	StatusCode  int    `json:"status_code,omitempty"`
	UserID      string `json:"user_id,omitempty"`
	EmailID     string `json:"email_id,omitempty"`
	UserCreated bool   `json:"user_created,omitempty"`
}

type OTPsEmailSendParams

type OTPsEmailSendParams struct {
	Email             string     `json:"email"`
	ExpirationMinutes int32      `json:"expiration_minutes,omitempty"`
	Attributes        Attributes `json:"attributes,omitempty"`
}

OTP - Email

type OTPsEmailSendResponse

type OTPsEmailSendResponse struct {
	RequestID  string `json:"request_id,omitempty"`
	StatusCode int    `json:"status_code,omitempty"`
	UserID     string `json:"user_id,omitempty"`
	EmailID    string `json:"email_id,omitempty"`
}

type OTPsSMSLoginOrCreateParams

type OTPsSMSLoginOrCreateParams struct {
	PhoneNumber         string     `json:"phone_number"`
	ExpirationMinutes   int32      `json:"expiration_minutes,omitempty"`
	Attributes          Attributes `json:"attributes,omitempty"`
	CreateUserAsPending bool       `json:"create_user_as_pending,omitempty"`
}

type OTPsSMSLoginOrCreateResponse

type OTPsSMSLoginOrCreateResponse struct {
	RequestID   string `json:"request_id,omitempty"`
	StatusCode  int    `json:"status_code,omitempty"`
	UserID      string `json:"user_id,omitempty"`
	PhoneID     string `json:"phone_id,omitempty"`
	UserCreated bool   `json:"user_created,omitempty"`
}

type OTPsSMSSendParams

type OTPsSMSSendParams struct {
	PhoneNumber       string     `json:"phone_number"`
	ExpirationMinutes int32      `json:"expiration_minutes,omitempty"`
	Attributes        Attributes `json:"attributes,omitempty"`
}

OTP - SMS

type OTPsSMSSendResponse

type OTPsSMSSendResponse struct {
	RequestID  string `json:"request_id,omitempty"`
	StatusCode int    `json:"status_code,omitempty"`
	UserID     string `json:"user_id,omitempty"`
	PhoneID    string `json:"phone_id,omitempty"`
}

type OTPsWhatsAppLoginOrCreateParams

type OTPsWhatsAppLoginOrCreateParams struct {
	PhoneNumber         string     `json:"phone_number"`
	ExpirationMinutes   int32      `json:"expiration_minutes,omitempty"`
	Attributes          Attributes `json:"attributes,omitempty"`
	CreateUserAsPending bool       `json:"create_user_as_pending,omitempty"`
}

type OTPsWhatsAppLoginOrCreateResponse

type OTPsWhatsAppLoginOrCreateResponse struct {
	RequestID   string `json:"request_id,omitempty"`
	StatusCode  int    `json:"status_code,omitempty"`
	UserID      string `json:"user_id,omitempty"`
	PhoneID     string `json:"phone_id,omitempty"`
	UserCreated bool   `json:"user_created,omitempty"`
}

type OTPsWhatsAppSendParams

type OTPsWhatsAppSendParams struct {
	PhoneNumber       string     `json:"phone_number"`
	ExpirationMinutes int32      `json:"expiration_minutes,omitempty"`
	Attributes        Attributes `json:"attributes,omitempty"`
}

OTP - WhatsApp

type OTPsWhatsAppSendResponse

type OTPsWhatsAppSendResponse struct {
	RequestID  string `json:"request_id,omitempty"`
	StatusCode int    `json:"status_code,omitempty"`
	UserID     string `json:"user_id,omitempty"`
	PhoneID    string `json:"phone_id,omitempty"`
}

type Options

type Options struct {
	// Require that the ip address the magic link was requested from
	// matches the ip address it's clicked from.
	IPMatchRequired bool `json:"ip_match_required,omitempty"`
	// Require that the user agent the magic link was requested from
	// matches the user agent it's clicked from.
	UserAgentMatchRequired bool `json:"user_agent_match_required,omitempty"`
}

* Structure for the custom type Options

type PendingUsers

type PendingUsers struct {
	UserID        string         `json:"user_id,omitempty"`
	Name          Name           `json:"name,omitempty"`
	Emails        []Email        `json:"emails,omitempty"`
	PhoneNumbers  []PhoneNumber  `json:"phone_numbers,omitempty"`
	TOTPs         []UserTOTP     `json:"totps,omitempty"`
	CryptoWallets []CryptoWallet `json:"crypto_wallets,omitempty"`
	Status        string         `json:"status,omitempty"`
	InvitedAt     string         `json:"invited_at,omitempty"`
}

type PhoneNumber

type PhoneNumber struct {
	PhoneID     string `json:"phone_id,omitempty"`
	PhoneNumber string `json:"phone_number,omitempty"`
	Verified    bool   `json:"verified,omitempty"`
}

type PhoneNumberFactor

type PhoneNumberFactor struct {
	PhoneID     string `json:"phone_id,omitempty"`
	PhoneNumber string `json:"phone_number,omitempty"`
}

type PhoneNumberString

type PhoneNumberString struct {
	PhoneNumber string `json:"phone_number,omitempty"`
}

type ProviderType

type ProviderType string
const (
	ProviderTypeGoogle    ProviderType = "Google"
	ProviderTypeFacebook  ProviderType = "Facebook"
	ProviderTypeApple     ProviderType = "Apple"
	ProviderTypeMicrosoft ProviderType = "Microsoft"
	ProviderTypeGithub    ProviderType = "Github"
	ProviderTypeGitlab    ProviderType = "GitLab"
)

type ProviderValues

type ProviderValues struct {
	AccessToken  string     `json:"access_token,omitempty"`
	RefreshToken string     `json:"refresh_token,omitempty"`
	IDToken      string     `json:"id_token,omitempty"`
	ExpiresAt    *time.Time `json:"expires_at,omitempty"`
	Scopes       []string   `json:"scopes,omitempty"`
}

type RecoveryCodeFactor

type RecoveryCodeFactor struct {
	TOTPRecoveryCodeID string `json:"totp_recovery_code_id,omitempty"`
}

type Session

type Session struct {
	SessionID             string                  `json:"session_id,omitempty"`
	UserID                string                  `json:"user_id,omitempty"`
	StartedAt             string                  `json:"started_at,omitempty"`
	LastAccessedAt        string                  `json:"last_accessed_at,omitempty"`
	ExpiresAt             string                  `json:"expires_at,omitempty"`
	Attributes            Attributes              `json:"attributes,omitempty"`
	AuthenticationFactors []*AuthenticationFactor `json:"authentication_factors,omitempty"`
}

* Structure for the custom type Session

type SessionClaim

type SessionClaim struct {
	ID                    string                 `json:"id"`
	StartedAt             string                 `json:"started_at"`
	LastAccessedAt        string                 `json:"last_accessed_at"`
	ExpiresAt             string                 `json:"expires_at"`
	Attributes            Attributes             `json:"attributes"`
	AuthenticationFactors []AuthenticationFactor `json:"authentication_factors"`
}

type SessionsAuthenticateParams

type SessionsAuthenticateParams struct {
	SessionToken           string `json:"session_token,omitempty"`
	SessionDurationMinutes int32  `json:"session_duration_minutes,omitempty"`
	SessionJWT             string `json:"session_jwt,omitempty"`
}

type SessionsAuthenticateResponse

type SessionsAuthenticateResponse struct {
	RequestID    string  `json:"request_id,omitempty"`
	Session      Session `json:"session,omitempty"`
	SessionToken string  `json:"session_token,omitempty"`
	SessionJWT   string  `json:"session_jwt,omitempty"`
	User         User    `json:"user,omitempty"`
}

type SessionsGetJWKSParams

type SessionsGetJWKSParams struct {
	ProjectID string `json:"project_id"`
}

type SessionsGetJWKSResponse

type SessionsGetJWKSResponse struct {
	RequestID string `json:"request_id,omitempty"`
	Keys      []Key  `json:"keys,omitempty"`
}

type SessionsGetParams

type SessionsGetParams struct {
	UserID string `json:"user_id"`
}

type SessionsGetResponse

type SessionsGetResponse struct {
	RequestID string    `json:"request_id,omitempty"`
	Sessions  []Session `json:"sessions,omitempty"`
}

type SessionsRevokeParams

type SessionsRevokeParams struct {
	SessionID    string `json:"session_id,omitempty"`
	SessionToken string `json:"session_token,omitempty"`
}

type SessionsRevokeResponse

type SessionsRevokeResponse struct {
	RequestID string `json:"request_id,omitempty"`
}

type TOTP

type TOTP struct {
	TOTPID        string   `json:"totp_id,omitempty"`
	Verified      bool     `json:"verified,omitempty"`
	RecoveryCodes []string `json:"recovery_codes,omitempty"`
}

type TOTPsAuthenticateParams

type TOTPsAuthenticateParams struct {
	UserID                 string `json:"user_id"`
	TOTPCode               string `json:"totp_code"`
	SessionToken           string `json:"session_token,omitempty"`
	SessionJWT             string `json:"session_jwt,omitempty"`
	SessionDurationMinutes int32  `json:"session_duration_minutes,omitempty"`
}

type TOTPsAuthenticateResponse

type TOTPsAuthenticateResponse struct {
	RequestID    string  `json:"request_id,omitempty"`
	StatusCode   int     `json:"status_code,omitempty"`
	UserID       string  `json:"user_id,omitempty"`
	TOTPID       string  `json:"totp_id,omitempty"`
	SessionToken string  `json:"session_token,omitempty"`
	SessionJWT   string  `json:"session_jwt,omitempty"`
	Session      Session `json:"session,omitempty"`
	User         User    `json:"user,omitempty"`
}

type TOTPsCreateParams

type TOTPsCreateParams struct {
	UserID            string `json:"user_id"`
	ExpirationMinutes int32  `json:"expiration_minutes,omitempty"`
}

type TOTPsCreateResponse

type TOTPsCreateResponse struct {
	RequestID     string   `json:"request_id,omitempty"`
	StatusCode    int      `json:"status_code,omitempty"`
	Secret        string   `json:"secret,omitempty"`
	TOTPID        string   `json:"totp_id,omitempty"`
	QRCode        string   `json:"qr_code,omitempty"`
	RecoveryCodes []string `json:"recovery_codes,omitempty"`
}

type TOTPsRecoverParams

type TOTPsRecoverParams struct {
	UserID                 string `json:"user_id"`
	RecoveryCode           string `json:"recovery_code"`
	SessionToken           string `json:"session_token,omitempty"`
	SessionJWT             string `json:"session_jwt,omitempty"`
	SessionDurationMinutes int32  `json:"session_duration_minutes,omitempty"`
}

type TOTPsRecoverResponse

type TOTPsRecoverResponse struct {
	RequestID    string  `json:"request_id,omitempty"`
	StatusCode   int     `json:"status_code,omitempty"`
	UserID       string  `json:"user_id,omitempty"`
	TOTPID       string  `json:"totp_id,omitempty"`
	SessionToken string  `json:"session_token,omitempty"`
	SessionJWT   string  `json:"session_jwt,omitempty"`
	Session      Session `json:"session,omitempty"`
	User         User    `json:"user,omitempty"`
}

type TOTPsRecoveryCodesParams

type TOTPsRecoveryCodesParams struct {
	UserID string `json:"user_id"`
}

type TOTPsRecoveryCodesResponse

type TOTPsRecoveryCodesResponse struct {
	RequestID  string `json:"request_id,omitempty"`
	StatusCode int    `json:"status_code,omitempty"`
	UserID     string `json:"user_id,omitempty"`
	TOTPs      []TOTP `json:"totps,omitempty"`
}

type User

type User struct {
	UserID                string                 `json:"user_id,omitempty"`
	Name                  Name                   `json:"name,omitempty"`
	Emails                []Email                `json:"emails,omitempty"`
	PhoneNumbers          []PhoneNumber          `json:"phone_numbers,omitempty"`
	WebAuthnRegistrations []WebAuthnRegistration `json:"webauthn_registrations,omitempty"`
	OAuthProviders        []OAuthProvider        `json:"providers,omitempty"`
	TOTPs                 []UserTOTP             `json:"totps,omitempty"`
	Status                string                 `json:"status,omitempty"`
	CreatedAt             time.Time              `json:"created_at,omitempty"`
}

type UserTOTP

type UserTOTP struct {
	TOTPID   string `json:"totp_id,omitempty"`
	Verified bool   `json:"verified,omitempty"`
}

type UsersCreateParams

type UsersCreateParams struct {
	Email               string     `json:"email,omitempty"`
	PhoneNumber         string     `json:"phone_number,omitempty"`
	Name                Name       `json:"name,omitempty"`
	CreateUserAsPending bool       `json:"create_user_as_pending,omitempty"`
	Attributes          Attributes `json:"attributes,omitempty"`
}

type UsersCreateResponse

type UsersCreateResponse struct {
	RequestID  string `json:"request_id,omitempty"`
	StatusCode int    `json:"status_code,omitempty"`
	UserID     string `json:"user_id,omitempty"`
	EmailID    string `json:"email_id,omitempty"`
	PhoneID    string `json:"phone_id,omitempty"`
	Status     string `json:"status,omitempty"`
	User       User   `json:"user,omitempty"`
}

type UsersDeleteCryptoWalletResponse

type UsersDeleteCryptoWalletResponse struct {
	RequestID  string `json:"request_id,omitempty"`
	StatusCode int    `json:"status_code,omitempty"`
	UserID     string `json:"user_id,omitempty"`
	User       User   `json:"user,omitempty"`
}

type UsersDeleteEmailResponse

type UsersDeleteEmailResponse struct {
	RequestID  string `json:"request_id,omitempty"`
	StatusCode int    `json:"status_code,omitempty"`
	UserID     string `json:"user_id,omitempty"`
	User       User   `json:"user,omitempty"`
}

type UsersDeletePhoneNumberResponse

type UsersDeletePhoneNumberResponse struct {
	RequestID  string `json:"request_id,omitempty"`
	StatusCode int    `json:"status_code,omitempty"`
	UserID     string `json:"user_id,omitempty"`
	User       User   `json:"user,omitempty"`
}

type UsersDeleteResponse

type UsersDeleteResponse struct {
	RequestID  string `json:"request_id,omitempty"`
	StatusCode int    `json:"status_code,omitempty"`
	UserID     string `json:"user_id,omitempty"`
}

type UsersDeleteTOTPResponse

type UsersDeleteTOTPResponse struct {
	RequestID  string `json:"request_id,omitempty"`
	StatusCode int    `json:"status_code,omitempty"`
	UserID     string `json:"user_id,omitempty"`
	User       User   `json:"user,omitempty"`
}

type UsersDeleteWebAuthnRegistrationResponse

type UsersDeleteWebAuthnRegistrationResponse struct {
	RequestID  string `json:"request_id,omitempty"`
	StatusCode int    `json:"status_code,omitempty"`
	UserID     string `json:"user_id,omitempty"`
	User       User   `json:"user,omitempty"`
}

type UsersGetPendingParams

type UsersGetPendingParams struct {
	Limit           int32  `json:"limit,omitempty"`
	StartingAfterID string `json:"starting_after_id,omitempty"`
}

type UsersGetPendingResponse

type UsersGetPendingResponse struct {
	RequestID       string         `json:"request_id,omitempty"`
	StatusCode      int            `json:"status_code,omitempty"`
	Users           []PendingUsers `json:"users,omitempty"`
	HasMore         bool           `json:"has_more,omitempty"`
	StartingAfterID string         `json:"starting_after_id,omitempty"`
	Total           int            `json:"total,omitempty"`
}

type UsersGetResponse

type UsersGetResponse struct {
	RequestID             string                 `json:"request_id,omitempty"`
	StatusCode            int                    `json:"status_code,omitempty"`
	UserID                string                 `json:"user_id,omitempty"`
	Name                  Name                   `json:"name,omitempty"`
	Emails                []Email                `json:"emails,omitempty"`
	PhoneNumbers          []PhoneNumber          `json:"phone_numbers,omitempty"`
	WebAuthnRegistrations []WebAuthnRegistration `json:"webauthn_registrations,omitempty"`
	OAuthProviders        []OAuthProvider        `json:"providers,omitempty"`
	TOTPs                 []UserTOTP             `json:"totps,omitempty"`
	CryptoWallets         []CryptoWallet         `json:"crypto_wallets,omitempty"`
	Status                string                 `json:"status,omitempty"`
	CreatedAt             time.Time              `json:"created_at,omitempty"`
}

type UsersSearchOperator

type UsersSearchOperator string
const (
	UserSearchOperatorOR  UsersSearchOperator = "OR"
	UserSearchOperatorAND UsersSearchOperator = "AND"
)

type UsersSearchParams

type UsersSearchParams struct {
	Limit  int32             `json:"limit,omitempty"`
	Query  *UsersSearchQuery `json:"query,omitempty"`
	Cursor string            `json:"cursor,omitempty"`
}

User Search

type UsersSearchQuery

type UsersSearchQuery struct {
	Operator UsersSearchOperator `json:"operator,omitempty"`
	Operands []json.Marshaler    `json:"operands,omitempty"`
}

type UsersSearchQueryCreatedAtBetweenFilter

type UsersSearchQueryCreatedAtBetweenFilter struct {
	GreaterThan time.Time
	LessThan    time.Time
}

func (UsersSearchQueryCreatedAtBetweenFilter) MarshalJSON

func (q UsersSearchQueryCreatedAtBetweenFilter) MarshalJSON() ([]byte, error)

type UsersSearchQueryCreatedAtGreaterThanFilter

type UsersSearchQueryCreatedAtGreaterThanFilter struct {
	CreatedAtGreaterThan time.Time
}

Created At Filters

func (UsersSearchQueryCreatedAtGreaterThanFilter) MarshalJSON

type UsersSearchQueryCreatedAtLessThanFilter

type UsersSearchQueryCreatedAtLessThanFilter struct {
	CreatedAtLessThan time.Time
}

func (UsersSearchQueryCreatedAtLessThanFilter) MarshalJSON

func (q UsersSearchQueryCreatedAtLessThanFilter) MarshalJSON() ([]byte, error)

type UsersSearchQueryCryptoWalletAddressFilter

type UsersSearchQueryCryptoWalletAddressFilter struct {
	CryptoWalletAddresses []string
}

func (UsersSearchQueryCryptoWalletAddressFilter) MarshalJSON

type UsersSearchQueryCryptoWalletIDFilter

type UsersSearchQueryCryptoWalletIDFilter struct {
	CryptoWalletIDs []string
}

func (UsersSearchQueryCryptoWalletIDFilter) MarshalJSON

func (q UsersSearchQueryCryptoWalletIDFilter) MarshalJSON() ([]byte, error)

type UsersSearchQueryCryptoWalletVerifiedFilter

type UsersSearchQueryCryptoWalletVerifiedFilter struct {
	CryptoWalletVerified bool
}

func (UsersSearchQueryCryptoWalletVerifiedFilter) MarshalJSON

type UsersSearchQueryEmailAddressFilter

type UsersSearchQueryEmailAddressFilter struct {
	EmailAddresses []string
}

func (UsersSearchQueryEmailAddressFilter) MarshalJSON

func (q UsersSearchQueryEmailAddressFilter) MarshalJSON() ([]byte, error)

type UsersSearchQueryEmailAddressFuzzyFilter

type UsersSearchQueryEmailAddressFuzzyFilter struct {
	EmailAddressFuzzy string
}

func (UsersSearchQueryEmailAddressFuzzyFilter) MarshalJSON

func (q UsersSearchQueryEmailAddressFuzzyFilter) MarshalJSON() ([]byte, error)

type UsersSearchQueryEmailIDFilter

type UsersSearchQueryEmailIDFilter struct {
	EmailIDs []string
}

func (UsersSearchQueryEmailIDFilter) MarshalJSON

func (q UsersSearchQueryEmailIDFilter) MarshalJSON() ([]byte, error)

type UsersSearchQueryEmailVerifiedFilter

type UsersSearchQueryEmailVerifiedFilter struct {
	EmailVerified bool
}

func (UsersSearchQueryEmailVerifiedFilter) MarshalJSON

func (q UsersSearchQueryEmailVerifiedFilter) MarshalJSON() ([]byte, error)

type UsersSearchQueryFullNameFuzzyFilter

type UsersSearchQueryFullNameFuzzyFilter struct {
	FullNameFuzzy string
}

func (UsersSearchQueryFullNameFuzzyFilter) MarshalJSON

func (q UsersSearchQueryFullNameFuzzyFilter) MarshalJSON() ([]byte, error)

type UsersSearchQueryOAuthProviderFilter

type UsersSearchQueryOAuthProviderFilter struct {
	OAuthProviders []string
}

func (UsersSearchQueryOAuthProviderFilter) MarshalJSON

func (q UsersSearchQueryOAuthProviderFilter) MarshalJSON() ([]byte, error)

type UsersSearchQueryPhoneIDFilter

type UsersSearchQueryPhoneIDFilter struct {
	PhoneIDs []string
}

func (UsersSearchQueryPhoneIDFilter) MarshalJSON

func (q UsersSearchQueryPhoneIDFilter) MarshalJSON() ([]byte, error)

type UsersSearchQueryPhoneNumberFilter

type UsersSearchQueryPhoneNumberFilter struct {
	PhoneNumbers []string
}

func (UsersSearchQueryPhoneNumberFilter) MarshalJSON

func (q UsersSearchQueryPhoneNumberFilter) MarshalJSON() ([]byte, error)

type UsersSearchQueryPhoneNumberFuzzyFilter

type UsersSearchQueryPhoneNumberFuzzyFilter struct {
	PhoneNumberFuzzy string
}

func (UsersSearchQueryPhoneNumberFuzzyFilter) MarshalJSON

func (q UsersSearchQueryPhoneNumberFuzzyFilter) MarshalJSON() ([]byte, error)

type UsersSearchQueryPhoneVerifiedFilter

type UsersSearchQueryPhoneVerifiedFilter struct {
	PhoneVerified bool
}

func (UsersSearchQueryPhoneVerifiedFilter) MarshalJSON

func (q UsersSearchQueryPhoneVerifiedFilter) MarshalJSON() ([]byte, error)

type UsersSearchQueryStatusFilter

type UsersSearchQueryStatusFilter struct {
	Status string
}

User Filters

func (UsersSearchQueryStatusFilter) MarshalJSON

func (q UsersSearchQueryStatusFilter) MarshalJSON() ([]byte, error)

type UsersSearchQueryTOTPIDFilter

type UsersSearchQueryTOTPIDFilter struct {
	TOTPIDs []string
}

func (UsersSearchQueryTOTPIDFilter) MarshalJSON

func (q UsersSearchQueryTOTPIDFilter) MarshalJSON() ([]byte, error)

type UsersSearchQueryTOTPVerifiedFilter

type UsersSearchQueryTOTPVerifiedFilter struct {
	TOTPVerified bool
}

func (UsersSearchQueryTOTPVerifiedFilter) MarshalJSON

func (q UsersSearchQueryTOTPVerifiedFilter) MarshalJSON() ([]byte, error)

type UsersSearchQueryUserIDFilter

type UsersSearchQueryUserIDFilter struct {
	UserIDs []string
}

func (UsersSearchQueryUserIDFilter) MarshalJSON

func (q UsersSearchQueryUserIDFilter) MarshalJSON() ([]byte, error)

type UsersSearchQueryWebAuthnRegistrationIDFilter

type UsersSearchQueryWebAuthnRegistrationIDFilter struct {
	WebAuthnRegistrationIDs []string
}

func (UsersSearchQueryWebAuthnRegistrationIDFilter) MarshalJSON

type UsersSearchQueryWebAuthnRegistrationVerifiedFilter

type UsersSearchQueryWebAuthnRegistrationVerifiedFilter struct {
	WebAuthnRegistrationVerified bool
}

func (UsersSearchQueryWebAuthnRegistrationVerifiedFilter) MarshalJSON

type UsersSearchResponse

type UsersSearchResponse struct {
	RequestID       string `json:"request_id,omitempty"`
	StatusCode      int    `json:"status_code,omitempty"`
	Results         []User `json:"results,omitempty"`
	ResultsMetadata struct {
		NextCursor string `json:"next_cursor,omitempty"`
		Total      int    `json:"total,omitempty"`
	} `json:"results_metadata,omitempty"`
}

type UsersUpdateParams

type UsersUpdateParams struct {
	Name          Name                 `json:"name,omitempty"`
	Emails        []EmailString        `json:"emails,omitempty"`
	PhoneNumbers  []PhoneNumberString  `json:"phone_numbers,omitempty"`
	CryptoWallets []CryptoWalletString `json:"crypto_wallets,omitempty"`
	Attributes    Attributes           `json:"attributes,omitempty"`
}

type UsersUpdateResponse

type UsersUpdateResponse struct {
	RequestID     string         `json:"request_id,omitempty"`
	StatusCode    int            `json:"status_code,omitempty"`
	UserID        string         `json:"user_id,omitempty"`
	Emails        []Email        `json:"emails,omitempty"`
	PhoneNumbers  []PhoneNumber  `json:"phone_numbers,omitempty"`
	CryptoWallets []CryptoWallet `json:"crypto_wallets,omitempty"`
	User          User           `json:"user,omitempty"`
}

type WebAuthnAuthenticateParams

type WebAuthnAuthenticateParams struct {
	PublicKeyCredential    string `json:"public_key_credential,omitempty"`
	SessionToken           string `json:"session_token,omitempty"`
	SessionJWT             string `json:"session_jwt,omitempty"`
	SessionDurationMinutes int32  `json:"session_duration_minutes,omitempty"`
}

type WebAuthnAuthenticateResponse

type WebAuthnAuthenticateResponse struct {
	RequestID              string  `json:"request_id,omitempty"`
	StatusCode             int     `json:"status_code,omitempty"`
	UserID                 string  `json:"user_id,omitempty"`
	WebAuthnRegistrationID string  `json:"webauthn_registration_id,omitempty"`
	SessionToken           string  `json:"session_token,omitempty"`
	SessionJWT             string  `json:"session_jwt,omitempty"`
	Session                Session `json:"session,omitempty"`
	User                   User    `json:"user,omitempty"`
}

type WebAuthnAuthenticateStartParams

type WebAuthnAuthenticateStartParams struct {
	UserID string `json:"user_id,omitempty"`
	Domain string `json:"domain,omitempty"`
}

type WebAuthnAuthenticateStartResponse

type WebAuthnAuthenticateStartResponse struct {
	RequestID                         string `json:"request_id,omitempty"`
	StatusCode                        int    `json:"status_code,omitempty"`
	UserID                            string `json:"user_id,omitempty"`
	PublicKeyCredentialRequestOptions string `json:"public_key_credential_request_options,omitempty"`
}

type WebAuthnFactor

type WebAuthnFactor struct {
	WebAuthnRegistrationID string `json:"webauthn_registration_id,omitempty"`
	Domain                 string `json:"domain,omitempty"`
	UserAgent              string `json:"user_agent,omitempty"`
}

type WebAuthnRegisterParams

type WebAuthnRegisterParams struct {
	UserID              string `json:"user_id,omitempty"`
	PublicKeyCredential string `json:"public_key_credential,omitempty"`
}

type WebAuthnRegisterResponse

type WebAuthnRegisterResponse struct {
	RequestID              string `json:"request_id,omitempty"`
	StatusCode             int    `json:"status_code,omitempty"`
	UserID                 string `json:"user_id,omitempty"`
	WebAuthnRegistrationID string `json:"webauthn_registration_id,omitempty"`
}

type WebAuthnRegisterStartParams

type WebAuthnRegisterStartParams struct {
	UserID            string `json:"user_id,omitempty"`
	Domain            string `json:"domain,omitempty"`
	UserAgent         string `json:"user_agent,omitempty"`
	AuthenticatorType string `json:"authenticator_type,omitempty"`
}

type WebAuthnRegisterStartResponse

type WebAuthnRegisterStartResponse struct {
	RequestID                          string `json:"request_id,omitempty"`
	StatusCode                         int    `json:"status_code,omitempty"`
	UserID                             string `json:"user_id,omitempty"`
	PublicKeyCredentialCreationOptions string `json:"public_key_credential_creation_options,omitempty"`
}

type WebAuthnRegistration

type WebAuthnRegistration struct {
	WebAuthnRegistrationID string `json:"webauthn_registration_id,omitempty"`
	Domain                 string `json:"domain,omitempty"`
	UserAgent              string `json:"user_agent,omitempty"`
	Verified               bool   `json:"verified,omitempty"`
	AuthenticatorType      string `json:"authenticator_type,omitempty"`
}

Directories

Path Synopsis
otp
sms

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL