auth

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewApi added in v1.4.0

func NewApi(useCases UseCases, authService *Service) models.AuthApi

Types

type AuthApiImpl added in v1.4.0

type AuthApiImpl struct {
	// contains filtered or unexported fields
}

func (*AuthApiImpl) ChangePassword added in v1.4.0

func (a *AuthApiImpl) ChangePassword(ctx context.Context, rawToken string, newPassword string) error

func (*AuthApiImpl) EmailChange added in v1.4.0

func (a *AuthApiImpl) EmailChange(ctx context.Context, userID string, newEmail string, callbackURL *string) error

func (*AuthApiImpl) GetMe added in v1.4.0

func (a *AuthApiImpl) GetMe(ctx context.Context, userID string) (*models.MeResult, error)

func (*AuthApiImpl) PrepareOAuth2Login added in v1.4.0

func (a *AuthApiImpl) PrepareOAuth2Login(ctx context.Context, providerName string) (*models.OAuth2LoginResult, error)

func (*AuthApiImpl) ResetPassword added in v1.4.0

func (a *AuthApiImpl) ResetPassword(ctx context.Context, email string, callbackURL *string) error

func (*AuthApiImpl) SendEmailVerification added in v1.4.0

func (a *AuthApiImpl) SendEmailVerification(ctx context.Context, userID string, callbackURL *string) error

func (*AuthApiImpl) Services added in v1.4.0

func (a *AuthApiImpl) Services() *models.AuthServices

func (*AuthApiImpl) SignInWithEmailAndPassword added in v1.4.0

func (a *AuthApiImpl) SignInWithEmailAndPassword(ctx context.Context, email string, password string, callbackURL *string) (*models.SignInResult, error)

func (*AuthApiImpl) SignInWithOAuth2 added in v1.4.0

func (a *AuthApiImpl) SignInWithOAuth2(ctx context.Context, providerName string, code string, state string, verifier *string) (*models.SignInResult, error)

func (*AuthApiImpl) SignOut added in v1.4.0

func (a *AuthApiImpl) SignOut(ctx context.Context, sessionToken string) error

func (*AuthApiImpl) SignUpWithEmailAndPassword added in v1.4.0

func (a *AuthApiImpl) SignUpWithEmailAndPassword(ctx context.Context, name string, email string, password string, callbackURL *string) (*models.SignUpResult, error)

func (*AuthApiImpl) VerifyEmail added in v1.4.0

func (a *AuthApiImpl) VerifyEmail(ctx context.Context, rawToken string) (*models.VerifyEmailResult, error)

type Service

type Service struct {
	EventBus               models.EventBus
	WebhookExecutor        models.WebhookExecutor
	EventEmitter           models.EventEmitter
	UserService            models.UserService
	AccountService         models.AccountService
	SessionService         models.SessionService
	VerificationService    models.VerificationService
	PasswordService        models.PasswordService
	TokenService           models.TokenService
	RateLimitService       models.RateLimitService
	MailerService          models.MailerService
	OAuth2ProviderRegistry *oauth2providers.OAuth2ProviderRegistry
	// contains filtered or unexported fields
}

Service encapsulates all services

func NewService

func NewService(
	config *models.Config,
	eventBus models.EventBus,
	webhookExecutor models.WebhookExecutor,
	eventEmitter models.EventEmitter,
	userService models.UserService,
	accountService models.AccountService,
	sessionService models.SessionService,
	verificationService models.VerificationService,
	passwordService models.PasswordService,
	tokenService models.TokenService,
	rateLimitService models.RateLimitService,
	mailerService models.MailerService,
	oauth2ProviderRegistry *oauth2providers.OAuth2ProviderRegistry,
) *Service

NewService creates a new Auth service with all dependencies

type UseCases added in v1.4.0

type UseCases struct {
	SignUpUseCase                signup.SignUpUseCase
	SignInUseCase                signin.SignInUseCase
	SignOutUseCase               signout.SignOutUseCase
	VerifyEmailUseCase           verifyemail.VerifyEmailUseCase
	SendEmailVerificationUseCase sendemailverification.SendEmailVerificationUseCase
	ResetPasswordUseCase         resetpassword.ResetPasswordUseCase
	ChangePasswordUseCase        changepassword.ChangePasswordUseCase
	EmailChangeUseCase           emailchange.EmailChangeUseCase
	MeUseCase                    me.MeUseCase
	OAuth2UseCase                oauth2.OAuth2UseCase
}

func NewUseCases added in v1.4.0

func NewUseCases(config *models.Config, authService *Service) *UseCases

Jump to

Keyboard shortcuts

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