Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidPassword = errors.New("invalid password") ErrUnsupportedHashAlgorithm = errors.New("unsupported hash algorithm") ErrUserNotActive = errors.New("user is not active") ErrUserNotFound = errors.New("user not found") )
View Source
var ErrClientNotFound = errors.New("client not found")
Functions ¶
This section is empty.
Types ¶
type AuthorizeAction ¶
type AuthorizeAction int
AuthorizeAction represents the result of authorization decision logic.
const ( AuthorizeActionProceed AuthorizeAction = iota // Proceed with authorization AuthorizeActionLogin // Redirect to login AuthorizeActionLoginError // Return login_required error (prompt=none) )
type AuthorizeInput ¶
type AuthorizeInput struct {
Prompt string
Authenticated bool
AuthTime time.Time
MaxAge *int64 // nil means max_age parameter is not present
ReauthCompleted bool
IsNonProd bool
}
AuthorizeInput contains the parameters needed to decide the authorization action.
type ClientUseCase ¶
type ClientUseCase interface {
Create(ctx context.Context, name string, clientType domain.ClientType, redirectURIs []string) (*domain.ClientWithSecret, error)
Get(ctx context.Context, clientID uuid.UUID) (*domain.Client, error)
List(ctx context.Context) ([]*domain.Client, error)
Update(ctx context.Context, clientID uuid.UUID, name string, clientType domain.ClientType, redirectURIs []string) (*domain.Client, error)
RegenerateSecret(ctx context.Context, clientID uuid.UUID) (string, error)
Delete(ctx context.Context, clientID uuid.UUID) error
}
func NewClientUseCase ¶
func NewClientUseCase(repo repository.ClientRepository) ClientUseCase
type OAuthUseCase ¶
type OAuthUseCase interface {
EvaluateAuthorize(input AuthorizeInput) AuthorizeAction
}
OAuthUseCase handles OAuth authorization decision logic.
func NewOAuthUseCase ¶
func NewOAuthUseCase() OAuthUseCase
type UserUseCase ¶
type UserUseCase interface {
Authenticate(ctx context.Context, trapID, password string) (*domain.User, error)
GetByID(ctx context.Context, id uuid.UUID) (*domain.User, error)
}
func NewUserUseCase ¶
func NewUserUseCase(repo repository.UserRepository) UserUseCase
Click to show internal directories.
Click to hide internal directories.