stytch

package
v6.5.3 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2023 License: MIT Imports: 11 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 AmazonOAuthFactor added in v6.4.0

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

type AppleOAuthFactor

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

type Argon2Config

type Argon2Config struct {
	Salt            string `json:"salt"`
	IterationAmount int    `json:"iteration_amount"`
	Memory          int    `json:"memory"`
	Threads         int    `json:"threads"`
	KeyLength       int    `json:"key_length"`
}

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"`
	AmazonOAuthFactor      AmazonOAuthFactor      `json:"amazon_oauth_factor,omitempty"`
	BitbucketOAuthFactor   BitbucketOAuthFactor   `json:"bitbucket_oauth_factor,omitempty"`
	CoinbaseOAuthFactor    CoinbaseOAuthFactor    `json:"coinbase_oauth_factor,omitempty"`
	DiscordOAuthFactor     DiscordOAuthFactor     `json:"discord_oauth_factor,omitempty"`
	FigmaOAuthFactor       FigmaOAuthFactor       `json:"figma_oauth_factor,omitempty"`
	LinkedInOAuthFactor    LinkedInOAuthFactor    `json:"linkedin_oauth_factor,omitempty"`
	SlackOAuthFactor       SlackOAuthFactor       `json:"slack_oauth_factor,omitempty"`
	SnapchatOAuthFactor    SnapchatOAuthFactor    `json:"snapchat_oauth_factor,omitempty"`
	SpotifyOAuthFactor     SpotifyOAuthFactor     `json:"spotify_oauth_factor,omitempty"`
	TikTokOAuthFactor      TikTokOAuthFactor      `json:"tiktok_oauth_factor,omitempty"`
	TwitchOAuthFactor      TwitchOAuthFactor      `json:"twitch_oauth_factor,omitempty"`
	TwitterOAuthFactor     TwitterOAuthFactor     `json:"twitter_oauth_factor,omitempty"`
	WebAuthnFactor         WebAuthnFactor         `json:"webauthn_factor,omitempty"`
	BiometricFactor        BiometricFactor        `json:"biometric_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 BiometricFactor

type BiometricFactor struct {
	BiometricRegistrationID string `json:"biometric_registration_id,omitempty"`
}

type BitbucketOAuthFactor added in v6.4.0

type BitbucketOAuthFactor struct {
	ID              string `json:"id,omitempty"`
	EmailID         string `json:"email_id,omitempty"`
	ProviderSubject string `json:"provider_subject,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 ClaimsWrapper

type ClaimsWrapper struct {
	Claims interface{} `json:"custom_claims"`
}

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

func (*Client) RawRequest

func (c *Client) RawRequest(
	method string,
	path string,
	queryParams map[string]string,
	body []byte,
) ([]byte, error)

RawRequest sends the request and returns the successful response body as bytes. If the response is an error, the response body will be parsed and returned as (nil, stytcherror.Error).

Prefer using NewRequest (which unmarshals the response JSON) unless you need the actual bytes.

type CoinbaseOAuthFactor added in v6.4.0

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

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"`
	SessionCustomClaims    map[string]interface{} `json:"session_custom_claims,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"`
	SessionToken        string `json:"session_token,omitempty"`
	SessionJWT          string `json:"session_jwt,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 DiscordOAuthFactor added in v6.4.0

type DiscordOAuthFactor struct {
	ID              string `json:"id,omitempty"`
	EmailID         string `json:"email_id,omitempty"`
	ProviderSubject string `json:"provider_subject,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 Feedback

type Feedback struct {
	Warning          string           `json:"warning,omitempty"`
	Suggestions      []string         `json:"suggestions,omitempty"`
	LUDSRequirements LUDSRequirements `json:"luds_requirements,omitempty"`
}

type FigmaOAuthFactor added in v6.4.0

type FigmaOAuthFactor 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 HashType

type HashType string
const (
	HashTypeBcrypt   HashType = "bcrypt"
	HashTypeMD5      HashType = "md_5"
	HashTypeArgon2I  HashType = "argon_2i"
	HashTypeArgon2ID HashType = "argon_2id"
	HashTypeSHA1     HashType = "sha_1"
	HashTypeScrypt   HashType = "scrypt"
	HashTypePHPass   HashType = "phpass"
)

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"`
	AmazonOAuthFactor      AmazonOAuthFactor      `json:"amazon_oauth_factor,omitempty"`
	BitbucketOAuthFactor   BitbucketOAuthFactor   `json:"bitbucket_oauth_factor,omitempty"`
	CoinbaseOAuthFactor    CoinbaseOAuthFactor    `json:"coinbase_oauth_factor,omitempty"`
	DiscordOAuthFactor     DiscordOAuthFactor     `json:"discord_oauth_factor,omitempty"`
	FigmaOAuthFactor       FigmaOAuthFactor       `json:"figma_oauth_factor,omitempty"`
	LinkedInOAuthFactor    LinkedInOAuthFactor    `json:"linkedin_oauth_factor,omitempty"`
	SlackOAuthFactor       SlackOAuthFactor       `json:"slack_oauth_factor,omitempty"`
	SnapchatOAuthFactor    SnapchatOAuthFactor    `json:"snapchat_oauth_factor,omitempty"`
	SpotifyOAuthFactor     SpotifyOAuthFactor     `json:"spotify_oauth_factor,omitempty"`
	TikTokOAuthFactor      TikTokOAuthFactor      `json:"tiktok_oauth_factor,omitempty"`
	TwitchOAuthFactor      TwitchOAuthFactor      `json:"twitch_oauth_factor,omitempty"`
	TwitterOAuthFactor     TwitterOAuthFactor     `json:"twitter_oauth_factor,omitempty"`
	WebAuthnFactor         WebAuthnFactor         `json:"webauthn_factor,omitempty"`
	BiometricFactor        BiometricFactor        `json:"biometric_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 LUDSRequirements added in v6.5.2

type LUDSRequirements struct {
	HasLowerCase      bool `json:"has_lower_case,omitempty"`
	HasUpperCase      bool `json:"has_upper_case,omitempty"`
	HasDigit          bool `json:"has_digit,omitempty"`
	HasSymbol         bool `json:"has_symbol,omitempty"`
	MissingComplexity int  `json:"missing_complexity,omitempty"`
	MissingCharacters int  `json:"missing_characters,omitempty"`
}

type LinkedInOAuthFactor added in v6.4.0

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

type MD5Config

type MD5Config struct {
	PrependSalt string `json:"prepend_salt,omitempty"`
	AppendSalt  string `json:"append_salt,omitempty"`
}

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"`
	SessionCustomClaims    map[string]interface{} `json:"session_custom_claims,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"`
	ResetSessions bool    `json:"reset_sessions,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"`
	InviteTemplateID        string     `json:"invite_template_id,omitempty"`
	Name                    Name       `json:"name,omitempty"`
	Attributes              Attributes `json:"attributes,omitempty"`
	Locale                  string     `json:"locale,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"`
	LoginTemplateID         string     `json:"login_template_id,omitempty"`
	SignupTemplateID        string     `json:"signup_template_id,omitempty"`
	CreateUserAsPending     bool       `json:"create_user_as_pending,omitempty"`
	Attributes              Attributes `json:"attributes,omitempty"`
	CodeChallenge           string     `json:"code_challenge,omitempty"`
	Locale                  string     `json:"locale,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"`
	LoginTemplateID         string     `json:"login_template_id,omitempty"`
	SignupTemplateID        string     `json:"signup_template_id,omitempty"`
	Attributes              Attributes `json:"attributes,omitempty"`
	CodeChallenge           string     `json:"code_challenge,omitempty"`
	UserID                  string     `json:"user_id,omitempty"`
	SessionToken            string     `json:"session_token,omitempty"`
	SessionJWT              string     `json:"session_jwt,omitempty"`
	Locale                  string     `json:"locale,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 OAuthAttachParams added in v6.4.0

type OAuthAttachParams struct {
	Provider string `json:"provider,omitempty"`

	// Exactly one of UserID, SessionToken, and SessionJWT must be populated.
	UserID       string `json:"user_id,omitempty"`
	SessionToken string `json:"session_token,omitempty"`
	SessionJWT   string `json:"session_jwt,omitempty"`
}

type OAuthAttachResponse added in v6.4.0

type OAuthAttachResponse struct {
	RequestID        string `json:"request_id,omitempty"`
	StatusCode       int    `json:"status_code,omitempty"`
	OAuthAttachToken string `json:"oauth_attach_token,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"`
	SessionCustomClaims    map[string]interface{} `json:"session_custom_claims,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"`
	OAuthUserRegistrationID string         `json:"oauth_user_registration_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"`
	ResetSessions           bool           `json:"reset_sessions,omitempty"`
}

type OAuthProvider

type OAuthProvider struct {
	OAuthUserRegistrationID string `json:"oauth_user_registration_id,omitempty"`
	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"`
	SessionCustomClaims    map[string]interface{} `json:"session_custom_claims,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"`
	ResetSessions bool    `json:"reset_sessions,omitempty"`
}

type OTPsEmailLoginOrCreateParams

type OTPsEmailLoginOrCreateParams struct {
	Email               string     `json:"email"`
	ExpirationMinutes   int32      `json:"expiration_minutes,omitempty"`
	LoginTemplateID     string     `json:"login_template_id,omitempty"`
	SignupTemplateID    string     `json:"signup_template_id,omitempty"`
	Attributes          Attributes `json:"attributes,omitempty"`
	CreateUserAsPending bool       `json:"create_user_as_pending,omitempty"`
	Locale              string     `json:"locale,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"`
	LoginTemplateID   string     `json:"login_template_id,omitempty"`
	SignupTemplateID  string     `json:"signup_template_id,omitempty"`
	Attributes        Attributes `json:"attributes,omitempty"`
	UserID            string     `json:"user_id,omitempty"`
	SessionToken      string     `json:"session_token,omitempty"`
	SessionJWT        string     `json:"session_jwt,omitempty"`
	Locale            string     `json:"locale,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"`
	Locale              string     `json:"locale,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"`
	UserID            string     `json:"user_id,omitempty"`
	SessionToken      string     `json:"session_token,omitempty"`
	SessionJWT        string     `json:"session_jwt,omitempty"`
	Locale            string     `json:"locale,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"`
	Locale              string     `json:"locale,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"`
	UserID            string     `json:"user_id,omitempty"`
	SessionToken      string     `json:"session_token,omitempty"`
	SessionJWT        string     `json:"session_jwt,omitempty"`
	Locale            string     `json:"locale,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 Password

type Password struct {
	PasswordID    string `json:"password_id,omitempty"`
	RequiresReset bool   `json:"requires_reset,omitempty"`
}

type PasswordEmailResetParams

type PasswordEmailResetParams struct {
	Token                  string                 `json:"token,omitempty"`
	Password               string                 `json:"password,omitempty"`
	SessionToken           string                 `json:"session_token,omitempty"`
	SessionJWT             string                 `json:"session_jwt,omitempty"`
	SessionDurationMinutes int32                  `json:"session_duration_minutes,omitempty"`
	SessionCustomClaims    map[string]interface{} `json:"session_custom_claims,omitempty"`
	Options                Options                `json:"options,omitempty"`
	Attributes             Attributes             `json:"attributes,omitempty"`
	CodeVerifier           string                 `json:"code_verifier,omitempty"`
}

type PasswordEmailResetResponse

type PasswordEmailResetResponse 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 PasswordEmailResetStartParams

type PasswordEmailResetStartParams struct {
	Email                          string     `json:"email"`
	LoginRedirectURL               string     `json:"login_redirect_url,omitempty"`
	ResetPasswordRedirectURL       string     `json:"reset_password_redirect_url,omitempty"`
	ResetPasswordExpirationMinutes int32      `json:"reset_password_expiration_minutes,omitempty"`
	ResetPasswordTemplateID        string     `json:"reset_password_template_id,omitempty"`
	Attributes                     Attributes `json:"attributes,omitempty"`
	CodeChallenge                  string     `json:"code_challenge,omitempty"`
	Locale                         string     `json:"locale,omitempty"`
}

PASSWORD - EMAIL

type PasswordEmailResetStartResponse

type PasswordEmailResetStartResponse 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 PasswordExistingPasswordResetParams

type PasswordExistingPasswordResetParams struct {
	Email                  string                 `json:"email,omitempty"`
	ExistingPassword       string                 `json:"existing_password,omitempty"`
	NewPassword            string                 `json:"new_password,omitempty"`
	SessionToken           string                 `json:"session_token,omitempty"`
	SessionJWT             string                 `json:"session_jwt,omitempty"`
	SessionDurationMinutes int32                  `json:"session_duration_minutes,omitempty"`
	SessionCustomClaims    map[string]interface{} `json:"session_custom_claims,omitempty"`
}

PASSWORD - EXISTING PASSWORD

type PasswordExistingPasswordResetResponse

type PasswordExistingPasswordResetResponse 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 PasswordSessionResetParams

type PasswordSessionResetParams struct {
	Password     string `json:"password,omitempty"`
	SessionToken string `json:"session_token,omitempty"`
	SessionJWT   string `json:"session_jwt,omitempty"`
}

PASSWORD - SESSION

type PasswordSessionResetResponse

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

type PasswordsAuthenticateParams

type PasswordsAuthenticateParams struct {
	Email                  string                 `json:"email"`
	Password               string                 `json:"password"`
	SessionToken           string                 `json:"session_token,omitempty"`
	SessionJWT             string                 `json:"session_jwt,omitempty"`
	SessionDurationMinutes int32                  `json:"session_duration_minutes,omitempty"`
	SessionCustomClaims    map[string]interface{} `json:"session_custom_claims,omitempty"`
}

type PasswordsAuthenticateResponse

type PasswordsAuthenticateResponse 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"`
	Session      Session `json:"session,omitempty"`
	SessionJWT   string  `json:"session_jwt,omitempty"`
	User         User    `json:"user,omitempty"`
}

type PasswordsCreateParams

type PasswordsCreateParams struct {
	Email                  string                 `json:"email"`
	Password               string                 `json:"password"`
	SessionDurationMinutes int32                  `json:"session_duration_minutes,omitempty"`
	SessionCustomClaims    map[string]interface{} `json:"session_custom_claims,omitempty"`
}

type PasswordsCreateResponse

type PasswordsCreateResponse 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"`
	SessionToken string  `json:"session_token,omitempty"`
	Session      Session `json:"session,omitempty"`
	SessionJWT   string  `json:"session_jwt,omitempty"`
	User         User    `json:"user,omitempty"`
}

type PasswordsMigrateParams

type PasswordsMigrateParams struct {
	Email        string       `json:"email"`
	Hash         string       `json:"hash"`
	HashType     HashType     `json:"hash_type"`
	MD5Config    MD5Config    `json:"md_5_config,omitempty"`
	Argon2Config Argon2Config `json:"argon_2_config,omitempty"`
	SHA1Config   SHA1Config   `json:"sha_1_config,omitempty"`
	ScryptConfig ScryptConfig `json:"scrypt_config,omitempty"`
}

type PasswordsMigrateResponse

type PasswordsMigrateResponse 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 PasswordsStrengthCheckParams

type PasswordsStrengthCheckParams struct {
	Email    string `json:"email"`
	Password string `json:"password,omitempty"`
}

type PasswordsStrengthCheckResponse

type PasswordsStrengthCheckResponse struct {
	RequestID               string   `json:"request_id,omitempty"`
	StatusCode              int      `json:"status_code,omitempty"`
	ValidPassword           bool     `json:"valid_password,omitempty"`
	Score                   int      `json:"score,omitempty"`
	BreachedPassword        bool     `json:"breached_password,omitempty"`
	Feedback                Feedback `json:"feedback,omitempty"`
	StrengthPolicy          string   `json:"strength_policy,omitempty"`
	BreachDetectionOnCreate bool     `json:"breach_detection_on_create,omitempty"`
}

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"`
	Password      Password       `json:"password,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 (
	ProviderTypeAmazon    ProviderType = "Amazon"
	ProviderTypeApple     ProviderType = "Apple"
	ProviderTypeBitbucket ProviderType = "Bitbucket"
	ProviderTypeCoinbase  ProviderType = "Coinbase"
	ProviderTypeDiscord   ProviderType = "Discord"
	ProviderTypeFacebook  ProviderType = "Facebook"
	ProviderTypeFigma     ProviderType = "Figma"
	ProviderTypeGithub    ProviderType = "Github"
	ProviderTypeGitlab    ProviderType = "GitLab"
	ProviderTypeGoogle    ProviderType = "Google"
	ProviderTypeLinkedIn  ProviderType = "LinkedIn"
	ProviderTypeMicrosoft ProviderType = "Microsoft"
	ProviderTypeSlack     ProviderType = "Slack"
	ProviderTypeSnapchat  ProviderType = "Snapchat"
	ProviderTypeSpotify   ProviderType = "Spotify"
	ProviderTypeTikTok    ProviderType = "TikTok"
	ProviderTypeTwitch    ProviderType = "Twitch"
	ProviderTypeTwitter   ProviderType = "Twitter"
)

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 SHA1Config

type SHA1Config struct {
	PrependSalt string `json:"prepend_salt,omitempty"`
	AppendSalt  string `json:"append_salt,omitempty"`
}

type ScryptConfig

type ScryptConfig struct {
	Salt       string `json:"salt"`
	NParameter int    `json:"n_parameter"`
	RParameter int    `json:"r_parameter"`
	PParameter int    `json:"p_parameter"`
	KeyLength  int    `json:"key_length"`
}

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"`
	CustomClaims          interface{}             `json:"custom_claims"`
}

* 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 SessionWrapper

type SessionWrapper struct {
	Session ClaimsWrapper `json:"session"`
}

SessionWrapper wraps a session object with a custom_claims field so that we can unmarshal custom claims from authenticate responses

type SessionsAuthenticateParams

type SessionsAuthenticateParams struct {
	SessionToken           string                 `json:"session_token,omitempty"`
	SessionDurationMinutes int32                  `json:"session_duration_minutes,omitempty"`
	SessionJWT             string                 `json:"session_jwt,omitempty"`
	SessionCustomClaims    map[string]interface{} `json:"session_custom_claims,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"`
	SessionJWT   string `json:"session_jwt,omitempty"`
}

type SessionsRevokeResponse

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

type SlackOAuthFactor added in v6.4.0

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

type SnapchatOAuthFactor added in v6.4.0

type SnapchatOAuthFactor struct {
	ID              string `json:"id,omitempty"`
	ProviderSubject string `json:"provider_subject,omitempty"`
}

type SpotifyOAuthFactor added in v6.4.0

type SpotifyOAuthFactor struct {
	ID              string `json:"id,omitempty"`
	ProviderSubject string `json:"provider_subject,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"`
	SessionCustomClaims    map[string]interface{} `json:"session_custom_claims,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"`
	User          User     `json:"user,omitempty"`
	UserID        string   `json:"user_id,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"`
	SessionCustomClaims    map[string]interface{} `json:"session_custom_claims,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 TikTokOAuthFactor added in v6.4.0

type TikTokOAuthFactor struct {
	ID              string `json:"id,omitempty"`
	ProviderSubject string `json:"provider_subject,omitempty"`
}

type TwitchOAuthFactor added in v6.4.0

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

type TwitterOAuthFactor added in v6.4.0

type TwitterOAuthFactor struct {
	ID              string `json:"id,omitempty"`
	ProviderSubject string `json:"provider_subject,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"`
	Password              Password               `json:"password,omitempty"`
	Status                string                 `json:"status,omitempty"`
	CreatedAt             time.Time              `json:"created_at,omitempty"`
	TrustedMetadata       map[string]interface{} `json:"trusted_metadata,omitempty"`
	UntrustedMetadata     map[string]interface{} `json:"untrusted_metadata,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"`
	TrustedMetadata     map[string]interface{} `json:"trusted_metadata,omitempty"`
	UntrustedMetadata   map[string]interface{} `json:"untrusted_metadata,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 UsersDeleteBiometricRegistrationResponse

type UsersDeleteBiometricRegistrationResponse 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 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 UsersDeleteOAuthRegistrationResponse added in v6.1.0

type UsersDeleteOAuthRegistrationResponse 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 UsersDeletePasswordResponse

type UsersDeletePasswordResponse 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"`
	Password              Password               `json:"password,omitempty"`
	CryptoWallets         []CryptoWallet         `json:"crypto_wallets,omitempty"`
	Status                string                 `json:"status,omitempty"`
	CreatedAt             time.Time              `json:"created_at,omitempty"`
	TrustedMetadata       map[string]interface{} `json:"trusted_metadata,omitempty"`
	UntrustedMetadata     map[string]interface{} `json:"untrusted_metadata,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 UsersSearchQueryPasswordExistsFilter

type UsersSearchQueryPasswordExistsFilter struct {
	PasswordExists bool
}

func (UsersSearchQueryPasswordExistsFilter) MarshalJSON

func (q UsersSearchQueryPasswordExistsFilter) 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"`
	TrustedMetadata   map[string]interface{} `json:"trusted_metadata,omitempty"`
	UntrustedMetadata map[string]interface{} `json:"untrusted_metadata,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"`
	SessionCustomClaims    map[string]interface{} `json:"session_custom_claims,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"`
}

Jump to

Keyboard shortcuts

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