usecases

package
v2.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthorizeResult

type AuthorizeResult struct {
	AuthorizationURL string
	StateCookie      string
	VerifierCookie   *string
	RedirectCookie   string
}

AuthorizeResult contains the result of an authorization request

type AuthorizeUseCase

type AuthorizeUseCase struct {
	ProviderRegistry *services.ProviderRegistry
	Logger           models.Logger
	TrustedOrigins   []string
	HMACKey          []byte
}

AuthorizeUseCase handles the authorization flow initiation

func NewAuthorizeUseCase

func NewAuthorizeUseCase(
	registry *services.ProviderRegistry,
	logger models.Logger,
	trustedOrigins []string,
	hmacKey []byte,
) *AuthorizeUseCase

NewAuthorizeUseCase creates a new authorize usecase

func (*AuthorizeUseCase) Authorize

Authorize initiates an OAuth2 authorization flow

type CallbackResult

type CallbackResult struct {
	User         *models.User
	Session      *models.Session
	SessionToken string
	RedirectTo   string
}

CallbackResult contains the result of a callback

type CallbackUseCase

type CallbackUseCase struct {
	GlobalConfig     *models.Config
	ProviderRegistry *services.ProviderRegistry
	Logger           models.Logger
	HMACKey          []byte
	UserService      rootservices.UserService
	AccountService   rootservices.AccountService
	SessionService   rootservices.SessionService
	TokenService     rootservices.TokenService
}

func NewCallbackUseCase

func NewCallbackUseCase(
	globalConfig *models.Config,
	registry *services.ProviderRegistry,
	logger models.Logger,
	hmacKey []byte,
	userService rootservices.UserService,
	accountService rootservices.AccountService,
	sessionService rootservices.SessionService,
	tokenService rootservices.TokenService,
) *CallbackUseCase

func (*CallbackUseCase) Callback

func (uc *CallbackUseCase) Callback(ctx context.Context, req *types.CallbackRequest, ipAddress *string, userAgent *string) (*types.CallbackResult, error)

func (*CallbackUseCase) GetSessionByID

func (uc *CallbackUseCase) GetSessionByID(ctx context.Context, sessionID string) (*models.Session, error)

func (*CallbackUseCase) GetUserByID

func (uc *CallbackUseCase) GetUserByID(ctx context.Context, userID string) (*models.User, error)

type LinkAccountResult

type LinkAccountResult struct {
	ProviderID string
	AccountID  string
}

LinkAccountResult contains the result of linking an account

type RefreshResult

type RefreshResult struct {
	AccessToken string
	TokenType   string
	ExpiresIn   int
}

RefreshResult contains the result of a token refresh

type UseCases

type UseCases struct {
	AuthorizeUseCase *AuthorizeUseCase
	CallbackUseCase  *CallbackUseCase
}

Jump to

Keyboard shortcuts

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