usecases

package
v1.51.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAuthorizeUseCase

func NewAuthorizeUseCase(
	registry *services.ProviderRegistry,
	logger models.Logger,
	trustedOrigins []string,
	flowStateRepo repositories.FlowStateRepository,
	tokenService rootservices.TokenService,
	flowStateTTL time.Duration,
) *authorizeUseCase

func NewCallbackUseCase

func NewCallbackUseCase(
	globalConfig *models.Config,
	registry *services.ProviderRegistry,
	logger models.Logger,
	flowStateRepo repositories.FlowStateRepository,
	userService rootservices.UserService,
	accountService rootservices.AccountService,
	sessionService rootservices.SessionService,
	tokenService rootservices.TokenService,
) *callbackUseCase

Types

type AuthorizeResult

type AuthorizeResult struct {
	AuthorizationURL string
	Binding          string
}

AuthorizeResult contains the result of an authorization request.

type AuthorizeUseCase

type AuthorizeUseCase interface {
	Authorize(ctx context.Context, req *types.AuthorizeRequest) (*AuthorizeResult, error)
}

AuthorizeUseCase is the handler-facing contract for starting an OAuth2 flow.

type CallbackUseCase

type CallbackUseCase interface {
	Callback(ctx context.Context, req *types.CallbackRequest, ipAddress *string, userAgent *string) (*types.CallbackResult, error)
}

CallbackUseCase is the handler-facing contract for completing an OAuth2 flow.

type RedirectError added in v1.51.0

type RedirectError struct {
	RedirectTo  string
	Code        string
	Description string
}

RedirectError asks the HTTP layer to redirect the browser instead of returning a JSON error. It is used for provider error callbacks when a trusted redirect_to was stored with the flow state.

func (*RedirectError) Error added in v1.51.0

func (e *RedirectError) Error() string

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