passage

package module
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: MIT Imports: 13 Imported by: 3

README

Passage Go

Go Reference

✨ Easily authenticate requests and manage Passage users.

📚 See examples in the Passage docs.

🔎 Reference detailed documentation in the Go Reference.

Documentation

Overview

Package passage provides primitives to interact with the openapi HTTP API.

Code generated by github.com/deepmap/oapi-codegen version v1.16.2 DO NOT EDIT.

Index

Constants

View Source
const (
	UserIDDoesNotExist     string = "passage User with ID \"%v\" does not exist"
	IdentifierDoesNotExist string = "passage User with Identifier \"%v\" does not exist"
)
View Source
const (
	BearerAuthScopes = "bearerAuth.Scopes"
)

Variables

This section is empty.

Functions

func NewActivateUserRequest added in v1.6.0

func NewActivateUserRequest(server string, appID AppID, userID UserID) (*http.Request, error)

NewActivateUserRequest generates requests for ActivateUser

func NewCreateMagicLinkRequest added in v1.6.0

func NewCreateMagicLinkRequest(server string, appID AppID, body CreateMagicLinkJSONRequestBody) (*http.Request, error)

NewCreateMagicLinkRequest calls the generic CreateMagicLink builder with application/json body

func NewCreateMagicLinkRequestWithBody added in v1.6.0

func NewCreateMagicLinkRequestWithBody(server string, appID AppID, contentType string, body io.Reader) (*http.Request, error)

NewCreateMagicLinkRequestWithBody generates requests for CreateMagicLink with any type of body

func NewCreateUserRequest added in v1.6.0

func NewCreateUserRequest(server string, appID AppID, body CreateUserJSONRequestBody) (*http.Request, error)

NewCreateUserRequest calls the generic CreateUser builder with application/json body

func NewCreateUserRequestWithBody added in v1.6.0

func NewCreateUserRequestWithBody(server string, appID AppID, contentType string, body io.Reader) (*http.Request, error)

NewCreateUserRequestWithBody generates requests for CreateUser with any type of body

func NewDeactivateUserRequest added in v1.6.0

func NewDeactivateUserRequest(server string, appID AppID, userID UserID) (*http.Request, error)

NewDeactivateUserRequest generates requests for DeactivateUser

func NewDeleteUserDevicesRequest added in v1.6.0

func NewDeleteUserDevicesRequest(server string, appID AppID, userID UserID, deviceID string) (*http.Request, error)

NewDeleteUserDevicesRequest generates requests for DeleteUserDevices

func NewDeleteUserRequest added in v1.6.0

func NewDeleteUserRequest(server string, appID AppID, userID UserID) (*http.Request, error)

NewDeleteUserRequest generates requests for DeleteUser

func NewGetAppRequest added in v1.6.0

func NewGetAppRequest(server string, appID AppID) (*http.Request, error)

NewGetAppRequest generates requests for GetApp

func NewGetUserRequest added in v1.6.0

func NewGetUserRequest(server string, appID AppID, userID UserID) (*http.Request, error)

NewGetUserRequest generates requests for GetUser

func NewListPaginatedUsersRequest added in v1.11.0

func NewListPaginatedUsersRequest(server string, appID AppID, params *ListPaginatedUsersParams) (*http.Request, error)

NewListPaginatedUsersRequest generates requests for ListPaginatedUsers

func NewListUserDevicesRequest added in v1.6.0

func NewListUserDevicesRequest(server string, appID AppID, userID UserID) (*http.Request, error)

NewListUserDevicesRequest generates requests for ListUserDevices

func NewRevokeUserRefreshTokensRequest added in v1.6.0

func NewRevokeUserRefreshTokensRequest(server string, appID AppID, userID UserID) (*http.Request, error)

NewRevokeUserRefreshTokensRequest generates requests for RevokeUserRefreshTokens

func NewUpdateUserRequest added in v1.6.0

func NewUpdateUserRequest(server string, appID AppID, userID UserID, body UpdateUserJSONRequestBody) (*http.Request, error)

NewUpdateUserRequest calls the generic UpdateUser builder with application/json body

func NewUpdateUserRequestWithBody added in v1.6.0

func NewUpdateUserRequestWithBody(server string, appID AppID, userID UserID, contentType string, body io.Reader) (*http.Request, error)

NewUpdateUserRequestWithBody generates requests for UpdateUser with any type of body

Types

type ActivateUserResponse added in v1.6.0

type ActivateUserResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *UserResponse
	JSON401      *N401Error
	JSON404      *N404Error
	JSON500      *N500Error
}

func ParseActivateUserResponse added in v1.6.0

func ParseActivateUserResponse(rsp *http.Response) (*ActivateUserResponse, error)

ParseActivateUserResponse parses an HTTP response from a ActivateUserWithResponse call

func (ActivateUserResponse) Status added in v1.6.0

func (r ActivateUserResponse) Status() string

Status returns HTTPResponse.Status

func (ActivateUserResponse) StatusCode added in v1.6.0

func (r ActivateUserResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type App

type App struct {
	ID     string
	JWKS   jwkLibrary.Set
	Config *Config
	// contains filtered or unexported fields
}

func New

func New(appID string, config *Config) (*App, error)

func (*App) ActivateUser added in v1.1.1

func (a *App) ActivateUser(userID string) (*User, error)

ActivateUser activates a user using their userID returns user on success, error on failure

func (*App) AuthenticateRequest

func (a *App) AuthenticateRequest(r *http.Request) (string, error)

AuthenticateRequest determines whether or not to authenticate via header or cookie authentication returns the userID (string) on success, error on failure

func (*App) AuthenticateRequestWithCookie

func (a *App) AuthenticateRequestWithCookie(r *http.Request) (string, error)

AuthenticateRequestWithCookie fetches a cookie from the request and uses it to authenticate returns the userID (string) on success, error on failure

func (*App) AuthenticateRequestWithHeader

func (a *App) AuthenticateRequestWithHeader(r *http.Request) (string, error)

AuthenticateRequestWithCookie fetches the bearer token from the authorization header and uses it to authenticate returns the userID (string) on success, error on failure

func (a *App) CreateMagicLink(createMagicLinkBody CreateMagicLinkBody) (*MagicLink, error)

CreateMagicLink receives a CreateMagicLinkBody struct, creating a magic link with provided values returns MagicLink on success, error on failure

func (*App) CreateUser added in v1.1.3

func (a *App) CreateUser(createUserBody CreateUserBody) (*User, error)

CreateUser receives a CreateUserBody struct, creating a user with provided values returns user on success, error on failure

func (*App) DeactivateUser added in v1.1.1

func (a *App) DeactivateUser(userID string) (*User, error)

DeactivateUser deactivates a user using their userID returns user on success, error on failure

func (*App) DeleteUser added in v1.1.3

func (a *App) DeleteUser(userID string) (bool, error)

DeleteUser receives a userID (string), and deletes the corresponding user returns true on success, false and error on failure (bool, err)

func (*App) GetApp added in v1.1.10

func (a *App) GetApp() (*AppInfo, error)

GetApp gets information about an app returns App on success, error on failure

func (*App) GetUser

func (a *App) GetUser(userID string) (*User, error)

GetUser gets a user using their userID returns user on success, error on failure

func (*App) GetUserByIdentifier added in v1.11.0

func (a *App) GetUserByIdentifier(identifier string) (*User, error)

GetUserByIdentifier gets a user using their identifier returns user on success, error on failure

func (*App) ListUserDevices added in v1.1.7

func (a *App) ListUserDevices(userID string) ([]WebAuthnDevices, error)

ListUserDevices lists a user's devices returns a list of devices on success, error on failure

func (*App) RevokeUserDevice added in v1.1.7

func (a *App) RevokeUserDevice(userID, deviceID string) (bool, error)

RevokeUserDevice gets a user using their userID returns a true success, error on failure

func (*App) SignOut added in v1.2.2

func (a *App) SignOut(userID string) (bool, error)

Signout revokes a users refresh tokens returns true on success, error on failure

func (*App) UpdateUser added in v1.1.2

func (a *App) UpdateUser(userID string, updateBody UpdateBody) (*User, error)

UpdateUser receives an UpdateBody struct, updating the corresponding user's attribute(s) returns user on success, error on failure

func (*App) ValidateAuthToken

func (a *App) ValidateAuthToken(authToken string) (string, bool)

ValidateAuthToken determines whether a JWT is valid or not returns userID (string) on success, error on failure

type AppID added in v1.6.0

type AppID = string

AppID defines model for app_id.

type AppInfo added in v1.1.10

type AppInfo struct {
	AdditionalAuthOrigins []string `json:"additional_auth_origins"`

	// AllowedCallbackURLs The valid URLs where users can be redirected after authentication.
	AllowedCallbackURLs []string `json:"allowed_callback_urls"`
	AllowedIdentifier   string   `json:"allowed_identifier"`

	// AllowedLogoutURLs The valid URLs where users can be redirected after logging out.
	AllowedLogoutURLs []string `json:"allowed_logout_urls"`

	// ApplicationLoginURI A route within your application that redirects to the Authorization URL endpoint.
	ApplicationLoginURI string `json:"application_login_uri"`

	// AuthFallbackMethod Deprecated Property. Please refer to `auth_methods` to view settings for individual authentication methods.
	// Deprecated:
	AuthFallbackMethod string `json:"auth_fallback_method"`

	// AuthFallbackMethodTTL Deprecated Property. Please refer to `auth_methods` to view settings for individual authentication methods.
	// Deprecated:
	AuthFallbackMethodTTL int `json:"auth_fallback_method_ttl"`

	// AuthMethods Denotes what methods this app is allowed to use for authentication with configurations
	AuthMethods              AuthMethods          `json:"auth_methods"`
	AuthOrigin               string               `json:"auth_origin"`
	CreatedAt                time.Time            `json:"created_at"`
	DarkLogoURL              *string              `json:"dark_logo_url,omitempty"`
	DefaultLanguage          string               `json:"default_language"`
	ElementCustomization     ElementCustomization `json:"element_customization"`
	ElementCustomizationDark ElementCustomization `json:"element_customization_dark"`

	// Hosted whether or not the app's login page hosted by passage
	Hosted bool `json:"hosted"`

	// HostedSubdomain the subdomain of the app's hosted login page
	HostedSubdomain               string  `json:"hosted_subdomain"`
	ID                            string  `json:"id"`
	IDTokenLifetime               *int    `json:"id_token_lifetime,omitempty"`
	Layouts                       Layouts `json:"layouts"`
	LightLogoURL                  *string `json:"light_logo_url,omitempty"`
	LoginURL                      string  `json:"login_url"`
	Name                          string  `json:"name"`
	PassageBranding               bool    `json:"passage_branding"`
	ProfileManagement             bool    `json:"profile_management"`
	PublicSignup                  bool    `json:"public_signup"`
	RedirectURL                   string  `json:"redirect_url"`
	RefreshAbsoluteLifetime       int     `json:"refresh_absolute_lifetime"`
	RefreshEnabled                bool    `json:"refresh_enabled"`
	RefreshInactivityLifetime     int     `json:"refresh_inactivity_lifetime"`
	RequireEmailVerification      bool    `json:"require_email_verification"`
	RequireIdentifierVerification bool    `json:"require_identifier_verification"`
	RequiredIdentifier            string  `json:"required_identifier"`
	Role                          string  `json:"role"`
	RSAPublicKey                  string  `json:"rsa_public_key"`

	// Secret can only be retrieved by an app admin
	Secret               *string             `json:"secret,omitempty"`
	SessionTimeoutLength int                 `json:"session_timeout_length"`
	Technologies         []Technologies      `json:"technologies"`
	Type                 AppInfoType         `json:"type"`
	UserMetadataSchema   []UserMetadataField `json:"user_metadata_schema"`
}

AppInfo defines model for AppInfo.

type AppInfoType added in v1.6.0

type AppInfoType string

AppInfoType defines model for AppInfo.Type.

const (
	AppInfoTypeComplete AppInfoType = "complete"
	AppInfoTypeFlex     AppInfoType = "flex"
)

Defines values for AppInfoType.

type AppResponse added in v1.6.0

type AppResponse struct {
	App AppInfo `json:"app"`
}

AppResponse defines model for AppResponse.

type AppleUserSocialConnection added in v1.9.0

type AppleUserSocialConnection struct {
	CreatedAt   time.Time `json:"created_at"`
	LastLoginAt time.Time `json:"last_login_at"`

	// ProviderID The external ID of the Social Connection.
	ProviderID string `json:"provider_id"`

	// ProviderIdentifier The email of connected social user.
	ProviderIdentifier string `json:"provider_identifier"`
}

AppleUserSocialConnection defines model for AppleUserSocialConnection.

type AuthMethods added in v1.7.0

type AuthMethods struct {
	MagicLink MagicLinkAuthMethod `json:"magic_link"`
	Otp       OtpAuthMethod       `json:"otp"`
	Passkeys  PasskeysAuthMethod  `json:"passkeys"`
}

AuthMethods Denotes what methods this app is allowed to use for authentication with configurations

type ChannelType added in v1.1.6

type ChannelType string

ChannelType defines model for ChannelType.

const (
	EmailChannel ChannelType = "email"
	PhoneChannel ChannelType = "phone"
)

Defines values for MagicLinkChannel.

type Client added in v1.6.0

type Client struct {
	// The endpoint of the server conforming to this interface, with scheme,
	// https://api.deepmap.com for example. This can contain a path relative
	// to the server, such as https://api.deepmap.com/dev-test, and all the
	// paths in the swagger spec will be appended to the server.
	Server string

	// Doer for performing requests, typically a *http.Client with any
	// customized settings, such as certificate chains.
	Client HttpRequestDoer

	// A list of callbacks for modifying requests which are generated before sending over
	// the network.
	RequestEditors []RequestEditorFn
}

Client which conforms to the OpenAPI3 specification for this service.

func NewClient added in v1.6.0

func NewClient(server string, opts ...ClientOption) (*Client, error)

Creates a new Client, with reasonable defaults

func (*Client) ActivateUser added in v1.6.0

func (c *Client) ActivateUser(ctx context.Context, appID AppID, userID UserID, reqEditors ...RequestEditorFn) (*http.Response, error)
func (c *Client) CreateMagicLink(ctx context.Context, appID AppID, body CreateMagicLinkJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) CreateMagicLinkWithBody added in v1.6.0

func (c *Client) CreateMagicLinkWithBody(ctx context.Context, appID AppID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) CreateUser added in v1.6.0

func (c *Client) CreateUser(ctx context.Context, appID AppID, body CreateUserJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) CreateUserWithBody added in v1.6.0

func (c *Client) CreateUserWithBody(ctx context.Context, appID AppID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) DeactivateUser added in v1.6.0

func (c *Client) DeactivateUser(ctx context.Context, appID AppID, userID UserID, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) DeleteUser added in v1.6.0

func (c *Client) DeleteUser(ctx context.Context, appID AppID, userID UserID, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) DeleteUserDevices added in v1.6.0

func (c *Client) DeleteUserDevices(ctx context.Context, appID AppID, userID UserID, deviceID string, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetApp added in v1.6.0

func (c *Client) GetApp(ctx context.Context, appID AppID, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetUser added in v1.6.0

func (c *Client) GetUser(ctx context.Context, appID AppID, userID UserID, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) ListPaginatedUsers added in v1.11.0

func (c *Client) ListPaginatedUsers(ctx context.Context, appID AppID, params *ListPaginatedUsersParams, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) ListUserDevices added in v1.6.0

func (c *Client) ListUserDevices(ctx context.Context, appID AppID, userID UserID, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) RevokeUserRefreshTokens added in v1.6.0

func (c *Client) RevokeUserRefreshTokens(ctx context.Context, appID AppID, userID UserID, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) UpdateUser added in v1.6.0

func (c *Client) UpdateUser(ctx context.Context, appID AppID, userID UserID, body UpdateUserJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) UpdateUserWithBody added in v1.6.0

func (c *Client) UpdateUserWithBody(ctx context.Context, appID AppID, userID UserID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

type ClientInterface added in v1.6.0

type ClientInterface interface {
	// GetApp request
	GetApp(ctx context.Context, appID AppID, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CreateMagicLinkWithBody request with any body
	CreateMagicLinkWithBody(ctx context.Context, appID AppID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	CreateMagicLink(ctx context.Context, appID AppID, body CreateMagicLinkJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListPaginatedUsers request
	ListPaginatedUsers(ctx context.Context, appID AppID, params *ListPaginatedUsersParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CreateUserWithBody request with any body
	CreateUserWithBody(ctx context.Context, appID AppID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	CreateUser(ctx context.Context, appID AppID, body CreateUserJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// DeleteUser request
	DeleteUser(ctx context.Context, appID AppID, userID UserID, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetUser request
	GetUser(ctx context.Context, appID AppID, userID UserID, reqEditors ...RequestEditorFn) (*http.Response, error)

	// UpdateUserWithBody request with any body
	UpdateUserWithBody(ctx context.Context, appID AppID, userID UserID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	UpdateUser(ctx context.Context, appID AppID, userID UserID, body UpdateUserJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ActivateUser request
	ActivateUser(ctx context.Context, appID AppID, userID UserID, reqEditors ...RequestEditorFn) (*http.Response, error)

	// DeactivateUser request
	DeactivateUser(ctx context.Context, appID AppID, userID UserID, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListUserDevices request
	ListUserDevices(ctx context.Context, appID AppID, userID UserID, reqEditors ...RequestEditorFn) (*http.Response, error)

	// DeleteUserDevices request
	DeleteUserDevices(ctx context.Context, appID AppID, userID UserID, deviceID string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// RevokeUserRefreshTokens request
	RevokeUserRefreshTokens(ctx context.Context, appID AppID, userID UserID, reqEditors ...RequestEditorFn) (*http.Response, error)
}

The interface specification for the client above.

type ClientOption added in v1.6.0

type ClientOption func(*Client) error

ClientOption allows setting custom parameters during construction

func WithBaseURL added in v1.6.0

func WithBaseURL(baseURL string) ClientOption

WithBaseURL overrides the baseURL.

func WithHTTPClient added in v1.6.0

func WithHTTPClient(doer HttpRequestDoer) ClientOption

WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.

func WithRequestEditorFn added in v1.6.0

func WithRequestEditorFn(fn RequestEditorFn) ClientOption

WithRequestEditorFn allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.

type ClientWithResponses added in v1.6.0

type ClientWithResponses struct {
	ClientInterface
}

ClientWithResponses builds on ClientInterface to offer response payloads

func NewClientWithResponses added in v1.6.0

func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error)

NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling

func (*ClientWithResponses) ActivateUserWithResponse added in v1.6.0

func (c *ClientWithResponses) ActivateUserWithResponse(ctx context.Context, appID AppID, userID UserID, reqEditors ...RequestEditorFn) (*ActivateUserResponse, error)

ActivateUserWithResponse request returning *ActivateUserResponse

func (*ClientWithResponses) CreateMagicLinkWithBodyWithResponse added in v1.6.0

func (c *ClientWithResponses) CreateMagicLinkWithBodyWithResponse(ctx context.Context, appID AppID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateMagicLinkResponse, error)

CreateMagicLinkWithBodyWithResponse request with arbitrary body returning *CreateMagicLinkResponse

func (*ClientWithResponses) CreateMagicLinkWithResponse added in v1.6.0

func (c *ClientWithResponses) CreateMagicLinkWithResponse(ctx context.Context, appID AppID, body CreateMagicLinkJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateMagicLinkResponse, error)

func (*ClientWithResponses) CreateUserWithBodyWithResponse added in v1.6.0

func (c *ClientWithResponses) CreateUserWithBodyWithResponse(ctx context.Context, appID AppID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateUserResponse, error)

CreateUserWithBodyWithResponse request with arbitrary body returning *CreateUserResponse

func (*ClientWithResponses) CreateUserWithResponse added in v1.6.0

func (c *ClientWithResponses) CreateUserWithResponse(ctx context.Context, appID AppID, body CreateUserJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateUserResponse, error)

func (*ClientWithResponses) DeactivateUserWithResponse added in v1.6.0

func (c *ClientWithResponses) DeactivateUserWithResponse(ctx context.Context, appID AppID, userID UserID, reqEditors ...RequestEditorFn) (*DeactivateUserResponse, error)

DeactivateUserWithResponse request returning *DeactivateUserResponse

func (*ClientWithResponses) DeleteUserDevicesWithResponse added in v1.6.0

func (c *ClientWithResponses) DeleteUserDevicesWithResponse(ctx context.Context, appID AppID, userID UserID, deviceID string, reqEditors ...RequestEditorFn) (*DeleteUserDevicesResponse, error)

DeleteUserDevicesWithResponse request returning *DeleteUserDevicesResponse

func (*ClientWithResponses) DeleteUserWithResponse added in v1.6.0

func (c *ClientWithResponses) DeleteUserWithResponse(ctx context.Context, appID AppID, userID UserID, reqEditors ...RequestEditorFn) (*DeleteUserResponse, error)

DeleteUserWithResponse request returning *DeleteUserResponse

func (*ClientWithResponses) GetAppWithResponse added in v1.6.0

func (c *ClientWithResponses) GetAppWithResponse(ctx context.Context, appID AppID, reqEditors ...RequestEditorFn) (*GetAppResponse, error)

GetAppWithResponse request returning *GetAppResponse

func (*ClientWithResponses) GetUserWithResponse added in v1.6.0

func (c *ClientWithResponses) GetUserWithResponse(ctx context.Context, appID AppID, userID UserID, reqEditors ...RequestEditorFn) (*GetUserResponse, error)

GetUserWithResponse request returning *GetUserResponse

func (*ClientWithResponses) ListPaginatedUsersWithResponse added in v1.11.0

func (c *ClientWithResponses) ListPaginatedUsersWithResponse(ctx context.Context, appID AppID, params *ListPaginatedUsersParams, reqEditors ...RequestEditorFn) (*ListPaginatedUsersResponse, error)

ListPaginatedUsersWithResponse request returning *ListPaginatedUsersResponse

func (*ClientWithResponses) ListUserDevicesWithResponse added in v1.6.0

func (c *ClientWithResponses) ListUserDevicesWithResponse(ctx context.Context, appID AppID, userID UserID, reqEditors ...RequestEditorFn) (*ListUserDevicesResponse, error)

ListUserDevicesWithResponse request returning *ListUserDevicesResponse

func (*ClientWithResponses) RevokeUserRefreshTokensWithResponse added in v1.6.0

func (c *ClientWithResponses) RevokeUserRefreshTokensWithResponse(ctx context.Context, appID AppID, userID UserID, reqEditors ...RequestEditorFn) (*RevokeUserRefreshTokensResponse, error)

RevokeUserRefreshTokensWithResponse request returning *RevokeUserRefreshTokensResponse

func (*ClientWithResponses) UpdateUserWithBodyWithResponse added in v1.6.0

func (c *ClientWithResponses) UpdateUserWithBodyWithResponse(ctx context.Context, appID AppID, userID UserID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateUserResponse, error)

UpdateUserWithBodyWithResponse request with arbitrary body returning *UpdateUserResponse

func (*ClientWithResponses) UpdateUserWithResponse added in v1.6.0

func (c *ClientWithResponses) UpdateUserWithResponse(ctx context.Context, appID AppID, userID UserID, body UpdateUserJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateUserResponse, error)

type ClientWithResponsesInterface added in v1.6.0

type ClientWithResponsesInterface interface {
	// GetAppWithResponse request
	GetAppWithResponse(ctx context.Context, appID AppID, reqEditors ...RequestEditorFn) (*GetAppResponse, error)

	// CreateMagicLinkWithBodyWithResponse request with any body
	CreateMagicLinkWithBodyWithResponse(ctx context.Context, appID AppID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateMagicLinkResponse, error)

	CreateMagicLinkWithResponse(ctx context.Context, appID AppID, body CreateMagicLinkJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateMagicLinkResponse, error)

	// ListPaginatedUsersWithResponse request
	ListPaginatedUsersWithResponse(ctx context.Context, appID AppID, params *ListPaginatedUsersParams, reqEditors ...RequestEditorFn) (*ListPaginatedUsersResponse, error)

	// CreateUserWithBodyWithResponse request with any body
	CreateUserWithBodyWithResponse(ctx context.Context, appID AppID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateUserResponse, error)

	CreateUserWithResponse(ctx context.Context, appID AppID, body CreateUserJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateUserResponse, error)

	// DeleteUserWithResponse request
	DeleteUserWithResponse(ctx context.Context, appID AppID, userID UserID, reqEditors ...RequestEditorFn) (*DeleteUserResponse, error)

	// GetUserWithResponse request
	GetUserWithResponse(ctx context.Context, appID AppID, userID UserID, reqEditors ...RequestEditorFn) (*GetUserResponse, error)

	// UpdateUserWithBodyWithResponse request with any body
	UpdateUserWithBodyWithResponse(ctx context.Context, appID AppID, userID UserID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateUserResponse, error)

	UpdateUserWithResponse(ctx context.Context, appID AppID, userID UserID, body UpdateUserJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateUserResponse, error)

	// ActivateUserWithResponse request
	ActivateUserWithResponse(ctx context.Context, appID AppID, userID UserID, reqEditors ...RequestEditorFn) (*ActivateUserResponse, error)

	// DeactivateUserWithResponse request
	DeactivateUserWithResponse(ctx context.Context, appID AppID, userID UserID, reqEditors ...RequestEditorFn) (*DeactivateUserResponse, error)

	// ListUserDevicesWithResponse request
	ListUserDevicesWithResponse(ctx context.Context, appID AppID, userID UserID, reqEditors ...RequestEditorFn) (*ListUserDevicesResponse, error)

	// DeleteUserDevicesWithResponse request
	DeleteUserDevicesWithResponse(ctx context.Context, appID AppID, userID UserID, deviceID string, reqEditors ...RequestEditorFn) (*DeleteUserDevicesResponse, error)

	// RevokeUserRefreshTokensWithResponse request
	RevokeUserRefreshTokensWithResponse(ctx context.Context, appID AppID, userID UserID, reqEditors ...RequestEditorFn) (*RevokeUserRefreshTokensResponse, error)
}

ClientWithResponsesInterface is the interface specification for the client with responses above.

type Config

type Config struct {
	APIKey     string
	HeaderAuth bool
}

type CreateMagicLinkBody added in v1.1.6

type CreateMagicLinkBody struct {
	Channel ChannelType `json:"channel"`
	Email   string      `json:"email"`

	// Language language of the email to send (optional)
	Language      string        `json:"language,omitempty"`
	MagicLinkPath string        `json:"magic_link_path"`
	Phone         string        `json:"phone"`
	RedirectURL   string        `json:"redirect_url"`
	Send          bool          `json:"send"`
	TTL           int           `json:"ttl"`
	Type          MagicLinkType `json:"type,omitempty"`
	UserID        string        `json:"user_id"`
}

CreateMagicLinkBody defines model for CreateMagicLinkBody.

type CreateMagicLinkJSONRequestBody added in v1.6.0

type CreateMagicLinkJSONRequestBody = CreateMagicLinkBody

CreateMagicLinkJSONRequestBody defines body for CreateMagicLink for application/json ContentType.

type CreateMagicLinkResponse added in v1.6.0

type CreateMagicLinkResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON201      *MagicLinkResponse
	JSON400      *N400Error
	JSON401      *N401Error
	JSON403      *N403Forbidden
	JSON404      *N404Error
	JSON500      *N500Error
}

func ParseCreateMagicLinkResponse added in v1.6.0

func ParseCreateMagicLinkResponse(rsp *http.Response) (*CreateMagicLinkResponse, error)

ParseCreateMagicLinkResponse parses an HTTP response from a CreateMagicLinkWithResponse call

func (CreateMagicLinkResponse) Status added in v1.6.0

func (r CreateMagicLinkResponse) Status() string

Status returns HTTPResponse.Status

func (CreateMagicLinkResponse) StatusCode added in v1.6.0

func (r CreateMagicLinkResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type CreateUserBody added in v1.1.3

type CreateUserBody struct {
	// Email Email of the new user. Either this or `phone` is required; both may be provided.
	Email string `json:"email,omitempty"`

	// Phone Phone number of the new user. Either this or `email` is required; both may be provided.
	Phone        string                 `json:"phone,omitempty"`
	UserMetadata map[string]interface{} `json:"user_metadata,omitempty"`
}

CreateUserBody defines model for CreateUserBody.

type CreateUserJSONRequestBody added in v1.6.0

type CreateUserJSONRequestBody = CreateUserBody

CreateUserJSONRequestBody defines body for CreateUser for application/json ContentType.

type CreateUserResponse added in v1.6.0

type CreateUserResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON201      *UserResponse
	JSON400      *N400Error
	JSON401      *N401Error
	JSON404      *N404Error
	JSON500      *N500Error
}

func ParseCreateUserResponse added in v1.6.0

func ParseCreateUserResponse(rsp *http.Response) (*CreateUserResponse, error)

ParseCreateUserResponse parses an HTTP response from a CreateUserWithResponse call

func (CreateUserResponse) Status added in v1.6.0

func (r CreateUserResponse) Status() string

Status returns HTTPResponse.Status

func (CreateUserResponse) StatusCode added in v1.6.0

func (r CreateUserResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type DeactivateUserResponse added in v1.6.0

type DeactivateUserResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *UserResponse
	JSON401      *N401Error
	JSON404      *N404Error
	JSON500      *N500Error
}

func ParseDeactivateUserResponse added in v1.6.0

func ParseDeactivateUserResponse(rsp *http.Response) (*DeactivateUserResponse, error)

ParseDeactivateUserResponse parses an HTTP response from a DeactivateUserWithResponse call

func (DeactivateUserResponse) Status added in v1.6.0

func (r DeactivateUserResponse) Status() string

Status returns HTTPResponse.Status

func (DeactivateUserResponse) StatusCode added in v1.6.0

func (r DeactivateUserResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type DeleteUserDevicesResponse added in v1.6.0

type DeleteUserDevicesResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON401      *N401Error
	JSON404      *N404Error
	JSON500      *N500Error
}

func ParseDeleteUserDevicesResponse added in v1.6.0

func ParseDeleteUserDevicesResponse(rsp *http.Response) (*DeleteUserDevicesResponse, error)

ParseDeleteUserDevicesResponse parses an HTTP response from a DeleteUserDevicesWithResponse call

func (DeleteUserDevicesResponse) Status added in v1.6.0

func (r DeleteUserDevicesResponse) Status() string

Status returns HTTPResponse.Status

func (DeleteUserDevicesResponse) StatusCode added in v1.6.0

func (r DeleteUserDevicesResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type DeleteUserResponse added in v1.6.0

type DeleteUserResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON401      *N401Error
	JSON404      *N404Error
	JSON500      *N500Error
}

func ParseDeleteUserResponse added in v1.6.0

func ParseDeleteUserResponse(rsp *http.Response) (*DeleteUserResponse, error)

ParseDeleteUserResponse parses an HTTP response from a DeleteUserWithResponse call

func (DeleteUserResponse) Status added in v1.6.0

func (r DeleteUserResponse) Status() string

Status returns HTTPResponse.Status

func (DeleteUserResponse) StatusCode added in v1.6.0

func (r DeleteUserResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ElementCustomization added in v1.6.0

type ElementCustomization struct {
	// PassageBodyFontFamily Body font family
	PassageBodyFontFamily *FontFamily `json:"passage_body_font_family,omitempty"`

	// PassageBodyTextColor Body text color in hex.
	// Default is `#222222` in light mode & `#f3f3f3` in dark mode.
	PassageBodyTextColor *string `json:"passage_body_text_color,omitempty"`

	// PassageContainerBackgroundColor Container background color in hex.
	// Default is `#ffffff` in light mode & `#383838` in dark mode.
	PassageContainerBackgroundColor *string `json:"passage_container_background_color,omitempty"`

	// PassageContainerMaxWidth Maximum width of container (px)
	PassageContainerMaxWidth *int `json:"passage_container_max_width,omitempty"`

	// PassageHeaderFontFamily Body font family
	PassageHeaderFontFamily *FontFamily `json:"passage_header_font_family,omitempty"`

	// PassageHeaderTextColor Header text color in hex.
	// Default is `#222222` in light mode & `#f3f3f3` in dark mode.
	PassageHeaderTextColor *string `json:"passage_header_text_color,omitempty"`

	// PassageInputBoxBackgroundColor Input box background color in hex.
	// Default is `#ffffff` in light mode & `#4b4b4b` in dark mode.
	PassageInputBoxBackgroundColor *string `json:"passage_input_box_background_color,omitempty"`

	// PassageInputBoxBorderRadius Input box border radius (px)
	PassageInputBoxBorderRadius *int `json:"passage_input_box_border_radius,omitempty"`

	// PassagePrimaryButtonBackgroundColor Primary button background colour (hex)
	PassagePrimaryButtonBackgroundColor *string `json:"passage_primary_button_background_color,omitempty"`

	// PassagePrimaryButtonBorderColor Primary button border color
	PassagePrimaryButtonBorderColor *string `json:"passage_primary_button_border_color,omitempty"`

	// PassagePrimaryButtonBorderRadius Primary button border radius (px)
	PassagePrimaryButtonBorderRadius *int `json:"passage_primary_button_border_radius,omitempty"`

	// PassagePrimaryButtonBorderWidth Primary button border width (px)
	PassagePrimaryButtonBorderWidth *int `json:"passage_primary_button_border_width,omitempty"`

	// PassagePrimaryButtonHoverColor Primary button background on hover (hex)
	PassagePrimaryButtonHoverColor *string `json:"passage_primary_button_hover_color,omitempty"`

	// PassagePrimaryButtonTextColor Primary button font colour (hex)
	PassagePrimaryButtonTextColor *string `json:"passage_primary_button_text_color,omitempty"`

	// PassageSecondaryButtonBackgroundColor Secondary button background colour (hex)
	PassageSecondaryButtonBackgroundColor *string `json:"passage_secondary_button_background_color,omitempty"`

	// PassageSecondaryButtonBorderColor Secondary button border color
	PassageSecondaryButtonBorderColor *string `json:"passage_secondary_button_border_color,omitempty"`

	// PassageSecondaryButtonBorderRadius Secondary button border radius (px)
	PassageSecondaryButtonBorderRadius *int `json:"passage_secondary_button_border_radius,omitempty"`

	// PassageSecondaryButtonBorderWidth Secondary button border width (px)
	PassageSecondaryButtonBorderWidth *int `json:"passage_secondary_button_border_width,omitempty"`

	// PassageSecondaryButtonHoverColor Secondary button background on hover (hex)
	PassageSecondaryButtonHoverColor *string `json:"passage_secondary_button_hover_color,omitempty"`

	// PassageSecondaryButtonTextColor Secondary button font colour (hex)
	PassageSecondaryButtonTextColor *string `json:"passage_secondary_button_text_color,omitempty"`
}

ElementCustomization defines model for ElementCustomization.

type Error added in v1.3.0

type Error struct {
	Message    string
	StatusCode int
	StatusText string
	ErrorText  string
}

func (Error) Error added in v1.3.0

func (e Error) Error() string

type FontFamily added in v1.6.0

type FontFamily string

FontFamily Body font family

const (
	AndaléMono    FontFamily = "Andalé Mono"
	Arial         FontFamily = "Arial"
	ArialBlack    FontFamily = "Arial Black"
	Baskerville   FontFamily = "Baskerville"
	BradleyHand   FontFamily = "Bradley Hand"
	BrushScriptMT FontFamily = "Brush Script MT"
	ComicSansMS   FontFamily = "Comic Sans MS"
	Courier       FontFamily = "Courier"
	Georgia       FontFamily = "Georgia"
	GillSans      FontFamily = "Gill Sans"
	Helvetica     FontFamily = "Helvetica"
	Impact        FontFamily = "Impact"
	Lucida        FontFamily = "Lucida"
	Luminari      FontFamily = "Luminari"
	Monaco        FontFamily = "Monaco"
	Palatino      FontFamily = "Palatino"
	Tahoma        FontFamily = "Tahoma"
	TimesNewRoman FontFamily = "Times New Roman"
	TrebuchetMS   FontFamily = "Trebuchet MS"
	Verdana       FontFamily = "Verdana"
)

Defines values for FontFamily.

type GetAppResponse added in v1.6.0

type GetAppResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *AppResponse
	JSON401      *N401Error
	JSON404      *N404Error
	JSON500      *N500Error
}

func ParseGetAppResponse added in v1.6.0

func ParseGetAppResponse(rsp *http.Response) (*GetAppResponse, error)

ParseGetAppResponse parses an HTTP response from a GetAppWithResponse call

func (GetAppResponse) Status added in v1.6.0

func (r GetAppResponse) Status() string

Status returns HTTPResponse.Status

func (GetAppResponse) StatusCode added in v1.6.0

func (r GetAppResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetUserResponse added in v1.6.0

type GetUserResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *UserResponse
	JSON401      *N401Error
	JSON404      *N404Error
	JSON500      *N500Error
}

func ParseGetUserResponse added in v1.6.0

func ParseGetUserResponse(rsp *http.Response) (*GetUserResponse, error)

ParseGetUserResponse parses an HTTP response from a GetUserWithResponse call

func (GetUserResponse) Status added in v1.6.0

func (r GetUserResponse) Status() string

Status returns HTTPResponse.Status

func (GetUserResponse) StatusCode added in v1.6.0

func (r GetUserResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GithubUserSocialConnection added in v1.9.0

type GithubUserSocialConnection struct {
	CreatedAt   time.Time `json:"created_at"`
	LastLoginAt time.Time `json:"last_login_at"`

	// ProviderID The external ID of the Social Connection.
	ProviderID string `json:"provider_id"`

	// ProviderIdentifier The email of connected social user.
	ProviderIdentifier string `json:"provider_identifier"`
}

GithubUserSocialConnection defines model for GithubUserSocialConnection.

type GoogleUserSocialConnection added in v1.9.0

type GoogleUserSocialConnection struct {
	CreatedAt   time.Time `json:"created_at"`
	LastLoginAt time.Time `json:"last_login_at"`

	// ProviderID The external ID of the Social Connection.
	ProviderID string `json:"provider_id"`

	// ProviderIdentifier The email of connected social user.
	ProviderIdentifier string `json:"provider_identifier"`
}

GoogleUserSocialConnection defines model for GoogleUserSocialConnection.

type HTTPError added in v1.3.0

type HTTPError struct {
	ErrorText string `json:"error,omitempty"`
}

type HttpRequestDoer added in v1.6.0

type HttpRequestDoer interface {
	Do(req *http.Request) (*http.Response, error)
}

Doer performs HTTP requests.

The standard http.Client implements this interface.

type LayoutConfig added in v1.1.10

type LayoutConfig struct {
	H  int    `json:"h"`
	ID string `json:"id"`
	W  int    `json:"w"`
	X  int    `json:"x"`
	Y  int    `json:"y"`
}

LayoutConfig defines model for LayoutConfig.

type Layouts added in v1.1.10

type Layouts struct {
	Profile      []LayoutConfig `json:"profile"`
	Registration []LayoutConfig `json:"registration"`
}

Layouts defines model for Layouts.

type Link struct {
	Href string `json:"href"`
}

Link defines model for Link.

type ListDevicesResponse added in v1.6.0

type ListDevicesResponse struct {
	Devices []WebAuthnDevices `json:"devices"`
}

ListDevicesResponse defines model for ListDevicesResponse.

type ListPaginatedUsersItem added in v1.11.0

type ListPaginatedUsersItem struct {
	CreatedAt     time.Time               `json:"created_at"`
	Email         string                  `json:"email"`
	EmailVerified bool                    `json:"email_verified"`
	ID            string                  `json:"id"`
	LastLoginAt   time.Time               `json:"last_login_at"`
	LoginCount    int                     `json:"login_count"`
	Phone         string                  `json:"phone"`
	PhoneVerified bool                    `json:"phone_verified"`
	Status        UserStatus              `json:"status"`
	UpdatedAt     time.Time               `json:"updated_at"`
	UserMetadata  *map[string]interface{} `json:"user_metadata"`
}

ListPaginatedUsersItem defines model for ListPaginatedUsersItem.

type ListPaginatedUsersParams added in v1.11.0

type ListPaginatedUsersParams struct {
	// Page page to fetch (min=1)
	Page *int `form:"page,omitempty" json:"page,omitempty"`

	// Limit number of users to fetch per page (max=500)
	Limit *int `form:"limit,omitempty" json:"limit,omitempty"`

	// CreatedBefore Unix timestamp to anchor pagination results (fetches events that were created before the timestamp)
	CreatedBefore *int `form:"created_before,omitempty" json:"created_before,omitempty"`

	// OrderBy Comma separated list of <field>:<ASC/DESC> (example: order_by=id:DESC,created_at:ASC) **cannot order_by `identifier`
	OrderBy *string `form:"order_by,omitempty" json:"order_by,omitempty"`

	// Identifier search users email OR phone (pagination prepended operators identifier=<val>, identifier=<ne:val>, identifier=<gt:val>, identifier=<lt:val>, identifier=<like:val>, identifier=<not_like:val>)
	Identifier *string `form:"identifier,omitempty" json:"identifier,omitempty"`

	// ID search users id (pagination prepended operators id=<val>, id=<ne:val>, id=<gt:val>, id=<lt:val>, id=<like:val>, id=<not_like:val>)
	ID *string `form:"id,omitempty" json:"id,omitempty"`

	// LoginCount search users login_count (pagination prepended operators login_count=<val>, login_count=<ne:val>, login_count=<gt:val>, login_count=<lt:val>)
	LoginCount *int `form:"login_count,omitempty" json:"login_count,omitempty"`

	// Status search users by status (pagination prepended operators status=<val>, status=<ne:val>, status=<gt:val>, status=<lt:val>, status=<like:val>, status=<not_like:val>) -- valid values: (active, inactive, pending)
	Status *string `form:"status,omitempty" json:"status,omitempty"`

	// CreatedAt search users created_at (pagination prepended operators created_at=<val>, created_at=<ne:val>, created_at=<gt:val>, created_at=<lt:val> -- valid timestamp in the format: 2006-01-02T15:04:05.000000Z required
	CreatedAt *string `form:"created_at,omitempty" json:"created_at,omitempty"`

	// UpdatedAt search users updated_at (pagination prepended operators updated_at=<val>, updated_at=<ne:val>, updated_at=<gt:val>, updated_at=<lt:val> -- valid timestamp in the format: 2006-01-02T15:04:05.000000Z required
	UpdatedAt *string `form:"updated_at,omitempty" json:"updated_at,omitempty"`

	// LastLoginAt search users last_login_at (pagination prepended operators last_login_at=<val>, lat_login_at=<ne:val>, last_login_at=<gt:val>, last_login_at=<lt:val> -- valid timestamp in the format: 2006-01-02T15:04:05.000000Z required
	LastLoginAt *string `form:"last_login_at,omitempty" json:"last_login_at,omitempty"`
}

ListPaginatedUsersParams defines parameters for ListPaginatedUsers.

type ListPaginatedUsersResponse added in v1.11.0

type ListPaginatedUsersResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *PaginatedUsersResponse
	JSON400      *N400Error
	JSON401      *N401Error
	JSON404      *N404Error
	JSON500      *N500Error
}

func ParseListPaginatedUsersResponse added in v1.11.0

func ParseListPaginatedUsersResponse(rsp *http.Response) (*ListPaginatedUsersResponse, error)

ParseListPaginatedUsersResponse parses an HTTP response from a ListPaginatedUsersWithResponse call

func (ListPaginatedUsersResponse) Status added in v1.11.0

Status returns HTTPResponse.Status

func (ListPaginatedUsersResponse) StatusCode added in v1.11.0

func (r ListPaginatedUsersResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListUserDevicesResponse added in v1.6.0

type ListUserDevicesResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *ListDevicesResponse
	JSON401      *N401Error
	JSON404      *N404Error
	JSON500      *N500Error
}

func ParseListUserDevicesResponse added in v1.6.0

func ParseListUserDevicesResponse(rsp *http.Response) (*ListUserDevicesResponse, error)

ParseListUserDevicesResponse parses an HTTP response from a ListUserDevicesWithResponse call

func (ListUserDevicesResponse) Status added in v1.6.0

func (r ListUserDevicesResponse) Status() string

Status returns HTTPResponse.Status

func (ListUserDevicesResponse) StatusCode added in v1.6.0

func (r ListUserDevicesResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type MagicLink struct {
	Activated   bool          `json:"activated"`
	AppID       string        `json:"app_id"`
	ID          string        `json:"id"`
	Identifier  string        `json:"identifier"`
	RedirectURL string        `json:"redirect_url"`
	Secret      string        `json:"secret"`
	TTL         int           `json:"ttl"`
	Type        MagicLinkType `json:"type"`
	URL         string        `json:"url"`
	UserID      string        `json:"user_id"`
}

MagicLink defines model for MagicLink.

type MagicLinkAuthMethod added in v1.7.0

type MagicLinkAuthMethod struct {
	Enabled bool `json:"enabled"`

	// TTL Maximum time (IN SECONDS) for the auth to expire.
	TTL int `json:"ttl"`

	// TTLDisplayUnit Deprecated Property. The preferred unit for displaying the TTL. This value is for display only.
	// * `s` - seconds
	// * `m` - minutes
	// * `h` - hours
	// * `d` - days
	// Deprecated:
	TTLDisplayUnit TTLDisplayUnit `json:"ttl_display_unit"`
}

MagicLinkAuthMethod defines model for MagicLinkAuthMethod.

type MagicLinkResponse added in v1.6.0

type MagicLinkResponse struct {
	MagicLink MagicLink `json:"magic_link"`
}

MagicLinkResponse defines model for MagicLinkResponse.

type MagicLinkType added in v1.5.0

type MagicLinkType string

MagicLinkType defines model for MagicLinkType.

const (
	LoginType            MagicLinkType = "login"
	VerifyIdentifierType MagicLinkType = "verify_identifier"
)

Defines values for MagicLinkType.

type N400Error added in v1.6.0

type N400Error struct {
	Code  N400ErrorCode `json:"code"`
	Error string        `json:"error"`
}

N400Error defines model for 400Error.

type N400ErrorCode added in v1.6.0

type N400ErrorCode string

N400ErrorCode defines model for 400Error.Code.

const (
	CustomProviderRequired N400ErrorCode = "custom_provider_required"
	InvalidRequest         N400ErrorCode = "invalid_request"
)

Defines values for N400ErrorCode.

type N401Error added in v1.6.0

type N401Error struct {
	Code  N401ErrorCode `json:"code"`
	Error string        `json:"error"`
}

N401Error defines model for 401Error.

type N401ErrorCode added in v1.6.0

type N401ErrorCode string

N401ErrorCode defines model for 401Error.Code.

const (
	InvalidAccessToken N401ErrorCode = "invalid_access_token"
	InvalidNonce       N401ErrorCode = "invalid_nonce"
)

Defines values for N401ErrorCode.

type N403Error added in v1.11.0

type N403Error struct {
	Code  N403ErrorCode `json:"code"`
	Error string        `json:"error"`
}

N403Error defines model for 403Error.

type N403ErrorCode added in v1.11.0

type N403ErrorCode string

N403ErrorCode defines model for 403Error.Code.

const (
	CannotCreateOrganizationBillingPortalSession N403ErrorCode = "cannot_create_organization_billing_portal_session"
	CannotCreateTransaction                      N403ErrorCode = "cannot_create_transaction"
	CannotDeleteAdmin                            N403ErrorCode = "cannot_delete_admin"
	CannotDeleteOrganizationMember               N403ErrorCode = "cannot_delete_organization_member"
	CannotSelfUpdateOrganizationMember           N403ErrorCode = "cannot_self_update_organization_member"
	OperationNotAllowed                          N403ErrorCode = "operation_not_allowed"
)

Defines values for N403ErrorCode.

type N403Forbidden added in v1.11.0

type N403Forbidden = N403Error

N403Forbidden defines model for 403Forbidden.

type N404Error added in v1.6.0

type N404Error struct {
	Code  N404ErrorCode `json:"code"`
	Error string        `json:"error"`
}

N404Error defines model for 404Error.

type N404ErrorCode added in v1.6.0

type N404ErrorCode string

N404ErrorCode defines model for 404Error.Code.

const (
	AdminNotFound              N404ErrorCode = "admin_not_found"
	ApiKeyNotFound             N404ErrorCode = "api_key_not_found"
	AppNotFound                N404ErrorCode = "app_not_found"
	DeviceNotFound             N404ErrorCode = "device_not_found"
	DomainNotFound             N404ErrorCode = "domain_not_found"
	EmailProviderNotFound      N404ErrorCode = "email_provider_not_found"
	EmailTemplateNotFound      N404ErrorCode = "email_template_not_found"
	EventNotFound              N404ErrorCode = "event_not_found"
	FunctionNotFound           N404ErrorCode = "function_not_found"
	FunctionSecretKeyNotFound  N404ErrorCode = "function_secret_key_not_found"
	FunctionVersionNotFound    N404ErrorCode = "function_version_not_found"
	MetadataFieldNotFound      N404ErrorCode = "metadata_field_not_found"
	Oauth2AppNotFound          N404ErrorCode = "oauth2_app_not_found"
	OrganizationMemberNotFound N404ErrorCode = "organization_member_not_found"
	SmsProviderNotFound        N404ErrorCode = "sms_provider_not_found"
	SmsTemplateNotFound        N404ErrorCode = "sms_template_not_found"
	SocialConnectionNotFound   N404ErrorCode = "social_connection_not_found"
	UserNotFound               N404ErrorCode = "user_not_found"
)

Defines values for N404ErrorCode.

type N500Error added in v1.6.0

type N500Error struct {
	Code  N500ErrorCode `json:"code"`
	Error string        `json:"error"`
}

N500Error defines model for 500Error.

type N500ErrorCode added in v1.6.0

type N500ErrorCode string

N500ErrorCode defines model for 500Error.Code.

const (
	InternalServerError N500ErrorCode = "internal_server_error"
)

Defines values for N500ErrorCode.

type OtpAuthMethod added in v1.7.0

type OtpAuthMethod struct {
	Enabled bool `json:"enabled"`

	// TTL Maximum time (IN SECONDS) for the auth to expire.
	TTL int `json:"ttl"`

	// TTLDisplayUnit Deprecated Property. The preferred unit for displaying the TTL. This value is for display only.
	// * `s` - seconds
	// * `m` - minutes
	// * `h` - hours
	// * `d` - days
	// Deprecated:
	TTLDisplayUnit TTLDisplayUnit `json:"ttl_display_unit"`
}

OtpAuthMethod defines model for OtpAuthMethod.

type PaginatedLinks struct {
	First    Link `json:"first"`
	Last     Link `json:"last"`
	Next     Link `json:"next"`
	Previous Link `json:"previous"`
	Self     Link `json:"self"`
}

PaginatedLinks defines model for PaginatedLinks.

type PaginatedUsersResponse added in v1.11.0

type PaginatedUsersResponse struct {
	Links PaginatedLinks `json:"_links"`

	// CreatedBefore time anchor (Unix timestamp) --> all users returned created before this timestamp
	CreatedBefore int64 `json:"created_before"`
	Limit         int   `json:"limit"`
	Page          int   `json:"page"`

	// TotalUsers total number of users for a particular query
	TotalUsers int64                    `json:"total_users"`
	Users      []ListPaginatedUsersItem `json:"users"`
}

PaginatedUsersResponse defines model for ListPaginatedUsersResponse.

type PasskeysAuthMethod added in v1.7.0

type PasskeysAuthMethod struct {
	Enabled bool `json:"enabled"`
}

PasskeysAuthMethod defines model for PasskeysAuthMethod.

type RequestEditorFn added in v1.6.0

type RequestEditorFn func(ctx context.Context, req *http.Request) error

RequestEditorFn is the function signature for the RequestEditor callback function

type RevokeUserRefreshTokensResponse added in v1.6.0

type RevokeUserRefreshTokensResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON401      *N401Error
	JSON403      *N403Forbidden
	JSON404      *N404Error
	JSON500      *N500Error
}

func ParseRevokeUserRefreshTokensResponse added in v1.6.0

func ParseRevokeUserRefreshTokensResponse(rsp *http.Response) (*RevokeUserRefreshTokensResponse, error)

ParseRevokeUserRefreshTokensResponse parses an HTTP response from a RevokeUserRefreshTokensWithResponse call

func (RevokeUserRefreshTokensResponse) Status added in v1.6.0

Status returns HTTPResponse.Status

func (RevokeUserRefreshTokensResponse) StatusCode added in v1.6.0

func (r RevokeUserRefreshTokensResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type TTLDisplayUnit added in v1.7.0

type TTLDisplayUnit string

TTLDisplayUnit Deprecated Property. The preferred unit for displaying the TTL. This value is for display only. * `s` - seconds * `m` - minutes * `h` - hours * `d` - days

const (
	D TTLDisplayUnit = "d"
	H TTLDisplayUnit = "h"
	M TTLDisplayUnit = "m"
	S TTLDisplayUnit = "s"
)

Defines values for TTLDisplayUnit.

type Technologies added in v1.6.0

type Technologies string

Technologies defines model for Technologies.

const (
	Android    Technologies = "android"
	Angular    Technologies = "angular"
	Go         Technologies = "go"
	Ios        Technologies = "ios"
	Javascript Technologies = "javascript"
	Python     Technologies = "python"
	React      Technologies = "react"
	Vue        Technologies = "vue"
)

Defines values for Technologies.

type UpdateBody added in v1.1.2

type UpdateBody struct {
	Email        string                 `json:"email,omitempty"`
	Phone        string                 `json:"phone,omitempty"`
	UserMetadata map[string]interface{} `json:"user_metadata,omitempty"`
}

UpdateBody defines model for UpdateBody.

type UpdateUserJSONRequestBody added in v1.6.0

type UpdateUserJSONRequestBody = UpdateBody

UpdateUserJSONRequestBody defines body for UpdateUser for application/json ContentType.

type UpdateUserResponse added in v1.6.0

type UpdateUserResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *UserResponse
	JSON400      *N400Error
	JSON401      *N401Error
	JSON404      *N404Error
	JSON500      *N500Error
}

func ParseUpdateUserResponse added in v1.6.0

func ParseUpdateUserResponse(rsp *http.Response) (*UpdateUserResponse, error)

ParseUpdateUserResponse parses an HTTP response from a UpdateUserWithResponse call

func (UpdateUserResponse) Status added in v1.6.0

func (r UpdateUserResponse) Status() string

Status returns HTTPResponse.Status

func (UpdateUserResponse) StatusCode added in v1.6.0

func (r UpdateUserResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type User

type User struct {
	CreatedAt         time.Time              `json:"created_at"`
	Email             string                 `json:"email"`
	EmailVerified     bool                   `json:"email_verified"`
	ID                string                 `json:"id"`
	LastLoginAt       time.Time              `json:"last_login_at"`
	LoginCount        int                    `json:"login_count"`
	Phone             string                 `json:"phone"`
	PhoneVerified     bool                   `json:"phone_verified"`
	RecentEvents      []UserRecentEvent      `json:"recent_events"`
	SocialConnections UserSocialConnections  `json:"social_connections"`
	Status            UserStatus             `json:"status"`
	UpdatedAt         time.Time              `json:"updated_at"`
	UserMetadata      map[string]interface{} `json:"user_metadata"`
	Webauthn          bool                   `json:"webauthn"`
	WebauthnDevices   []WebAuthnDevices      `json:"webauthn_devices"`

	// WebauthnTypes List of credential types that have been used for authentication
	WebauthnTypes []WebAuthnType `json:"webauthn_types"`
}

User defines model for User.

type UserEventStatus added in v1.10.0

type UserEventStatus string

UserEventStatus defines model for UserEventStatus.

const (
	UserEventStatusComplete   UserEventStatus = "complete"
	UserEventStatusIncomplete UserEventStatus = "incomplete"
)

Defines values for UserEventStatus.

type UserID added in v1.6.0

type UserID = string

UserID defines model for user_id.

type UserMetadataField added in v1.1.10

type UserMetadataField struct {
	FieldName    string                `json:"field_name"`
	FriendlyName string                `json:"friendly_name"`
	ID           string                `json:"id"`
	Profile      bool                  `json:"profile"`
	Registration bool                  `json:"registration"`
	Type         UserMetadataFieldType `json:"type"`
}

UserMetadataField defines model for UserMetadataField.

type UserMetadataFieldType added in v1.1.10

type UserMetadataFieldType string

UserMetadataFieldType defines model for UserMetadataFieldType.

const (
	BooleanMD UserMetadataFieldType = "boolean"
	DateMD    UserMetadataFieldType = "date"
	EmailMD   UserMetadataFieldType = "email"
	IntegerMD UserMetadataFieldType = "integer"
	PhoneMD   UserMetadataFieldType = "phone"
	StringMD  UserMetadataFieldType = "string"
)

Defines values for UserMetadataFieldType.

type UserRecentEvent added in v1.9.0

type UserRecentEvent struct {
	CompletedAt *time.Time      `json:"completed_at"`
	CreatedAt   time.Time       `json:"created_at"`
	ID          string          `json:"id"`
	IPAddr      string          `json:"ip_addr"`
	Status      UserEventStatus `json:"status"`
	Type        string          `json:"type"`
	UserAgent   string          `json:"user_agent"`
}

UserRecentEvent defines model for UserRecentEvent.

type UserResponse added in v1.6.0

type UserResponse struct {
	User User `json:"user"`
}

UserResponse defines model for UserResponse.

type UserSocialConnections added in v1.8.0

type UserSocialConnections struct {
	Apple  *AppleUserSocialConnection  `json:"apple,omitempty"`
	Github *GithubUserSocialConnection `json:"github,omitempty"`
	Google *GoogleUserSocialConnection `json:"google,omitempty"`
}

UserSocialConnections defines model for UserSocialConnections.

type UserStatus added in v1.1.6

type UserStatus string

UserStatus defines model for UserStatus.

const (
	StatusActive   UserStatus = "active"
	StatusInactive UserStatus = "inactive"
	StatusPending  UserStatus = "pending"
)

Defines values for UserStatus.

type WebAuthnDevices added in v1.6.0

type WebAuthnDevices struct {
	// CreatedAt The first time this webAuthn device was used to authenticate the user
	CreatedAt time.Time `json:"created_at"`

	// CredID The CredID for this webAuthn device
	CredID string `json:"cred_id"`

	// FriendlyName The friendly name for the webAuthn device used to authenticate
	FriendlyName string `json:"friendly_name"`

	// Icons Contains the light and dark SVG icons that represent the brand of those devices
	// Values can be null or base64 encoded SVG. Example of SVG output:
	// data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDE5MiAxOTIiIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAwIDE5MiAxOTIiIHdpZHRoPSIyNHB4Ij48cmVjdCBmaWxsPSJub25lIiBoZWlnaHQ9IjE5MiIgd2lkdGg9IjE5MiIgeT0iMCIvPjxnPjxwYXRoIGQ9Ik02OS4yOSwxMDZjLTMuNDYsNS45Ny05LjkxLDEwLTE3LjI5LDEwYy0xMS4wMywwLTIwLTguOTctMjAtMjBzOC45Ny0yMCwyMC0yMCBjNy4zOCwwLDEzLjgzLDQuMDMsMTcuMjksMTBoMjUuNTVDOTAuMyw2Ni41NCw3Mi44Miw1Miw1Miw1MkMyNy43NCw1Miw4LDcxLjc0LDgsOTZzMTkuNzQsNDQsNDQsNDRjMjAuODIsMCwzOC4zLTE0LjU0LDQyLjg0LTM0IEg2OS4yOXoiIGZpbGw9IiM0Mjg1RjQiLz48cmVjdCBmaWxsPSIjRkJCQzA0IiBoZWlnaHQ9IjI0IiB3aWR0aD0iNDQiIHg9Ijk0IiB5PSI4NCIvPjxwYXRoIGQ9Ik05NC4zMiw4NEg2OHYwLjA1YzIuNSwzLjM0LDQsNy40Nyw0LDExLjk1cy0xLjUsOC42MS00LDExLjk1VjEwOGgyNi4zMiBjMS4wOC0zLjgyLDEuNjgtNy44NCwxLjY4LTEyUzk1LjQxLDg3LjgyLDk0LjMyLDg0eiIgZmlsbD0iI0VBNDMzNSIvPjxwYXRoIGQ9Ik0xODQsMTA2djI2aC0xNnYtOGMwLTQuNDItMy41OC04LTgtOHMtOCwzLjU4LTgsOHY4aC0xNnYtMjZIMTg0eiIgZmlsbD0iIzM0QTg1MyIvPjxyZWN0IGZpbGw9IiMxODgwMzgiIGhlaWdodD0iMjQiIHdpZHRoPSI0OCIgeD0iMTM2IiB5PSI4NCIvPjwvZz48L3N2Zz4=
	Icons WebAuthnIcons `json:"icons"`

	// ID The ID of the webAuthn device used for authentication
	ID string `json:"id"`

	// LastLoginAt The last time this webAuthn device was used to authenticate the user
	LastLoginAt time.Time `json:"last_login_at"`

	// Type The type of this credential
	Type WebAuthnType `json:"type"`

	// UpdatedAt The last time this webAuthn device was updated
	UpdatedAt time.Time `json:"updated_at"`

	// UsageCount How many times this webAuthn device has been used to authenticate the user
	UsageCount int `json:"usage_count"`
}

WebAuthnDevices defines model for WebAuthnDevices.

type WebAuthnIcons added in v1.6.0

type WebAuthnIcons struct {
	Dark  *string `json:"dark"`
	Light *string `json:"light"`
}

WebAuthnIcons Contains the light and dark SVG icons that represent the brand of those devices Values can be null or base64 encoded SVG. Example of SVG output: data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDE5MiAxOTIiIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAwIDE5MiAxOTIiIHdpZHRoPSIyNHB4Ij48cmVjdCBmaWxsPSJub25lIiBoZWlnaHQ9IjE5MiIgd2lkdGg9IjE5MiIgeT0iMCIvPjxnPjxwYXRoIGQ9Ik02OS4yOSwxMDZjLTMuNDYsNS45Ny05LjkxLDEwLTE3LjI5LDEwYy0xMS4wMywwLTIwLTguOTctMjAtMjBzOC45Ny0yMCwyMC0yMCBjNy4zOCwwLDEzLjgzLDQuMDMsMTcuMjksMTBoMjUuNTVDOTAuMyw2Ni41NCw3Mi44Miw1Miw1Miw1MkMyNy43NCw1Miw4LDcxLjc0LDgsOTZzMTkuNzQsNDQsNDQsNDRjMjAuODIsMCwzOC4zLTE0LjU0LDQyLjg0LTM0IEg2OS4yOXoiIGZpbGw9IiM0Mjg1RjQiLz48cmVjdCBmaWxsPSIjRkJCQzA0IiBoZWlnaHQ9IjI0IiB3aWR0aD0iNDQiIHg9Ijk0IiB5PSI4NCIvPjxwYXRoIGQ9Ik05NC4zMiw4NEg2OHYwLjA1YzIuNSwzLjM0LDQsNy40Nyw0LDExLjk1cy0xLjUsOC42MS00LDExLjk1VjEwOGgyNi4zMiBjMS4wOC0zLjgyLDEuNjgtNy44NCwxLjY4LTEyUzk1LjQxLDg3LjgyLDk0LjMyLDg0eiIgZmlsbD0iI0VBNDMzNSIvPjxwYXRoIGQ9Ik0xODQsMTA2djI2aC0xNnYtOGMwLTQuNDItMy41OC04LTgtOHMtOCwzLjU4LTgsOHY4aC0xNnYtMjZIMTg0eiIgZmlsbD0iIzM0QTg1MyIvPjxyZWN0IGZpbGw9IiMxODgwMzgiIGhlaWdodD0iMjQiIHdpZHRoPSI0OCIgeD0iMTM2IiB5PSI4NCIvPjwvZz48L3N2Zz4=

type WebAuthnType added in v1.6.0

type WebAuthnType string

WebAuthnType The type of this credential

const (
	Passkey     WebAuthnType = "passkey"
	Platform    WebAuthnType = "platform"
	SecurityKey WebAuthnType = "security_key"
)

Defines values for WebAuthnType.

Jump to

Keyboard shortcuts

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