Documentation
¶
Index ¶
- type AuthorizeResult
- type AuthorizeUseCase
- type CallbackResult
- type CallbackUseCase
- func (uc *CallbackUseCase) Callback(ctx context.Context, req *types.CallbackRequest, ipAddress *string, ...) (*types.CallbackResult, error)
- func (uc *CallbackUseCase) GetSessionByID(ctx context.Context, sessionID string) (*models.Session, error)
- func (uc *CallbackUseCase) GetUserByID(ctx context.Context, userID string) (*models.User, error)
- type LinkAccountResult
- type RefreshResult
- type UseCases
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 ¶
func (uc *AuthorizeUseCase) Authorize(ctx context.Context, req *types.AuthorizeRequest) (*AuthorizeResult, error)
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 (*CallbackUseCase) GetUserByID ¶
type LinkAccountResult ¶
LinkAccountResult contains the result of linking an account
type RefreshResult ¶
RefreshResult contains the result of a token refresh
type UseCases ¶
type UseCases struct {
AuthorizeUseCase *AuthorizeUseCase
CallbackUseCase *CallbackUseCase
}
Click to show internal directories.
Click to hide internal directories.