api

package
v0.30.2 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: MIT Imports: 34 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	GetCsrfTokenErrors                              = contract.MustOperationErrors("getCsrfToken")
	GetGoogleLoginOptionsErrors                     = contract.MustOperationErrors("getGoogleLoginOptions")
	LoginWithGoogleErrors                           = contract.MustOperationErrors("loginWithGoogle")
	GetAppleLoginOptionsErrors                      = contract.MustOperationErrors("getAppleLoginOptions")
	LoginWithAppleErrors                            = contract.MustOperationErrors("loginWithApple")
	GetMicrosoftLoginOptionsErrors                  = contract.MustOperationErrors("getMicrosoftLoginOptions")
	LoginWithMicrosoftErrors                        = contract.MustOperationErrors("loginWithMicrosoft")
	LoginWithPasswordErrors                         = contract.MustOperationErrors("loginWithPassword")
	SignupDirectErrors                              = contract.MustOperationErrors("signupDirect")
	StartSignupChallengeErrors                      = contract.MustOperationErrors("startSignupChallenge")
	VerifySignupChallengeErrors                     = contract.MustOperationErrors("verifySignupChallenge")
	StartPasswordResetChallengeErrors               = contract.MustOperationErrors("startPasswordResetChallenge")
	VerifyPasswordResetChallengeErrors              = contract.MustOperationErrors("verifyPasswordResetChallenge")
	ResendChallengeErrors                           = contract.MustOperationErrors("resendChallenge")
	BeginPasskeyAuthenticationErrors                = contract.MustOperationErrors("beginPasskeyAuthentication")
	FinishPasskeyAuthenticationErrors               = contract.MustOperationErrors("finishPasskeyAuthentication")
	BeginPasskeyRegistrationErrors                  = contract.MustOperationErrors("beginPasskeyRegistration")
	FinishPasskeyRegistrationErrors                 = contract.MustOperationErrors("finishPasskeyRegistration")
	CheckRecentAuthenticationErrors                 = contract.MustOperationErrors("checkRecentAuthentication")
	ReauthenticateWithPasswordErrors                = contract.MustOperationErrors("reauthenticateWithPassword")
	ReauthenticateWithGoogleErrors                  = contract.MustOperationErrors("reauthenticateWithGoogle")
	ReauthenticateWithAppleErrors                   = contract.MustOperationErrors("reauthenticateWithApple")
	ReauthenticateWithMicrosoftErrors               = contract.MustOperationErrors("reauthenticateWithMicrosoft")
	BeginPasskeyReauthenticationErrors              = contract.MustOperationErrors("beginPasskeyReauthentication")
	FinishPasskeyReauthenticationErrors             = contract.MustOperationErrors("finishPasskeyReauthentication")
	LogoutErrors                                    = contract.MustOperationErrors("logout")
	RefreshSessionErrors                            = contract.MustOperationErrors("refreshSession")
	RefreshTokensErrors                             = contract.MustOperationErrors("refreshTokens")
	GetCurrentUserErrors                            = contract.MustOperationErrors("getCurrentUser")
	GetCurrentAccountErrors                         = contract.MustOperationErrors("getCurrentAccount")
	ChangeCurrentUsernameErrors                     = contract.MustOperationErrors("changeCurrentUsername")
	StartCurrentUserEmailChangeErrors               = contract.MustOperationErrors("startCurrentUserEmailChange")
	VerifyCurrentUserEmailChangeErrors              = contract.MustOperationErrors("verifyCurrentUserEmailChange")
	AddCurrentUserPasswordErrors                    = contract.MustOperationErrors("addCurrentUserPassword")
	ChangeCurrentUserPasswordErrors                 = contract.MustOperationErrors("changeCurrentUserPassword")
	LinkCurrentUserGoogleErrors                     = contract.MustOperationErrors("linkCurrentUserGoogle")
	LinkCurrentUserAppleErrors                      = contract.MustOperationErrors("linkCurrentUserApple")
	LinkCurrentUserMicrosoftErrors                  = contract.MustOperationErrors("linkCurrentUserMicrosoft")
	UnlinkCurrentUserAuthMethodErrors               = contract.MustOperationErrors("unlinkCurrentUserAuthMethod")
	DeleteCurrentUserPasskeyErrors                  = contract.MustOperationErrors("deleteCurrentUserPasskey")
	RevokeCurrentUserSessionErrors                  = contract.MustOperationErrors("revokeCurrentUserSession")
	RevokeCurrentUserOtherSessionsErrors            = contract.MustOperationErrors("revokeCurrentUserOtherSessions")
	SetCurrentUserPasswordErrors                    = contract.MustOperationErrors("setCurrentUserPassword")
	ListCurrentUserOrganizationsErrors              = contract.MustOperationErrors("listCurrentUserOrganizations")
	GetCurrentOrganizationErrors                    = contract.MustOperationErrors("getCurrentOrganization")
	ListCurrentOrganizationMembersErrors            = contract.MustOperationErrors("listCurrentOrganizationMembers")
	SwitchOrganizationErrors                        = contract.MustOperationErrors("switchOrganization")
	PreviewInvitationErrors                         = contract.MustOperationErrors("previewInvitation")
	AcceptInvitationErrors                          = contract.MustOperationErrors("acceptInvitation")
	LoginAndAcceptInvitationErrors                  = contract.MustOperationErrors("loginAndAcceptInvitation")
	AuthenticateAndAcceptInvitationWithGoogleErrors = contract.MustOperationErrors("authenticateAndAcceptInvitationWithGoogle")
	StartGoogleAccountRecoveryLinkErrors            = contract.MustOperationErrors("startGoogleAccountRecoveryLink")
	CompleteAccountRecoveryLinkWithPasswordErrors   = contract.MustOperationErrors("completeAccountRecoveryLinkWithPassword")
	CompleteAccountRecoveryLinkWithGoogleErrors     = contract.MustOperationErrors("completeAccountRecoveryLinkWithGoogle")
	CompleteAccountRecoveryLinkWithAppleErrors      = contract.MustOperationErrors("completeAccountRecoveryLinkWithApple")
	CompleteAccountRecoveryLinkWithMicrosoftErrors  = contract.MustOperationErrors("completeAccountRecoveryLinkWithMicrosoft")
)

Functions

This section is empty.

Types

type APIHandler

type APIHandler struct {
	Auth                *auth.Service
	Passkeys            *passkey.Service
	Session             *session.Service
	Organizations       *organization.Service
	Challenge           *challenge.Service
	Verification        *challenge.VerificationCodeService
	Limiter             ratelimiter.AuthLimiter
	Logger              *slog.Logger
	Google              GoogleVerifier
	Apple               AppleClient
	AppleNative         AppleClient
	AppleNativeClientID string
	Microsoft           MicrosoftVerifier
	AppleCredentials    AppleCredentialStore
	OAuthProviders      oauth.OAuthProviders
	OAuthChallenges     *oauth.ChallengeService
	Config              RuntimePolicyReader

	ChallengeEnabled     bool
	UsernameLoginEnabled bool
	AccessTTL            time.Duration
	RefreshTTL           time.Duration
}

func New

func New(
	auth *auth.Service,
	passkeys *passkey.Service,
	session *session.Service,
	organizations *organization.Service,
	challenge *challenge.Service,
	verification *challenge.VerificationCodeService,
	limiter ratelimiter.AuthLimiter,
	logger *slog.Logger,
	google GoogleVerifier,
	oauthProviders oauth.OAuthProviders,
	configuration RuntimePolicyReader,
	challengeEnabled bool,
	usernameLoginEnabled bool,
	accessTTL time.Duration,
	refreshTTL time.Duration,
) *APIHandler

func (*APIHandler) AcceptInvitation added in v0.16.0

func (*APIHandler) AddCurrentUserPassword added in v0.16.0

func (*APIHandler) ChangeCurrentUserPassword added in v0.16.0

func (*APIHandler) ChangeCurrentUsername added in v0.16.0

func (*APIHandler) DeleteCurrentUserPasskey added in v0.16.0

func (*APIHandler) FinishPasskeyRegistration added in v0.10.0

func (*APIHandler) GetCsrfToken added in v0.10.0

func (*APIHandler) GetCurrentAccount added in v0.16.0

func (*APIHandler) GetCurrentUser added in v0.10.0

func (*APIHandler) LinkCurrentUserApple added in v0.22.0

func (*APIHandler) LinkCurrentUserGoogle added in v0.16.0

func (*APIHandler) LinkCurrentUserMicrosoft added in v0.24.0

func (*APIHandler) LoginAndAcceptInvitation added in v0.16.0

func (*APIHandler) LoginWithApple added in v0.22.0

func (*APIHandler) LoginWithGoogle added in v0.10.0

func (*APIHandler) LoginWithMicrosoft added in v0.24.0

func (*APIHandler) LoginWithPassword added in v0.10.0

func (*APIHandler) Logout added in v0.10.0

func (*APIHandler) PreviewInvitation added in v0.16.0

func (*APIHandler) ReauthenticateWithApple added in v0.22.0

func (*APIHandler) ReauthenticateWithGoogle added in v0.22.0

func (*APIHandler) RefreshSession added in v0.10.0

func (*APIHandler) RefreshTokens added in v0.10.0

func (*APIHandler) ResendChallenge added in v0.10.0

func (*APIHandler) RevokeCurrentUserSession added in v0.16.0

func (*APIHandler) RevokeTokens added in v0.26.0

func (*APIHandler) SetCurrentUserPassword added in v0.12.0

func (*APIHandler) SignupDirect added in v0.10.0

func (*APIHandler) StartSignupChallenge added in v0.10.0

func (*APIHandler) SwitchOrganization added in v0.10.0

func (*APIHandler) VerifySignupChallenge added in v0.10.0

type AppleClient added in v0.22.0

type AppleClient interface {
	Exchange(context.Context, string, string) (apple.ExchangeResult, error)
	Revoke(context.Context, string) error
}

type AppleCredentialStore added in v0.22.0

type AppleCredentialStore interface {
	QueueRevocation(context.Context, string) error
	StageProviderLink(context.Context, uuid.UUID, string, time.Time) error
}

type GoogleVerifier added in v0.16.0

type GoogleVerifier interface {
	VerifyIDToken(context.Context, string, string) (*google.Identity, error)
	ExchangeAuthorizationCode(context.Context, string, string) (*google.Identity, error)
}

type MicrosoftVerifier added in v0.24.0

type MicrosoftVerifier interface {
	Authority() string
	VerifyIDToken(context.Context, string, string) (*microsoft.Identity, error)
}

type RuntimePolicyReader added in v0.21.0

type RuntimePolicyReader interface {
	config.AuthenticationPolicyReader
	config.SessionCookiePolicyReader
}

Jump to

Keyboard shortcuts

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