Documentation
¶
Index ¶
- type AuthenticateUserRequest
- type AuthenticateUserResponse
- type AuthenticateUserUseCase
- type GitHubAuthenticateRequest
- type GitHubAuthenticateResponse
- type GitHubAuthenticateUseCase
- type ValidateAPIKeyRequest
- type ValidateAPIKeyResponse
- type ValidateAPIKeyUseCase
- type ValidatePermissionRequest
- type ValidatePermissionResponse
- type ValidatePermissionUseCase
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthenticateUserRequest ¶
type AuthenticateUserRequest struct {
Credentials *services.Credentials
}
AuthenticateUserRequest represents the input for user authentication
type AuthenticateUserResponse ¶
type AuthenticateUserResponse struct {
User *entities.User
APIKey *services.APIKey
Permissions []entities.Permission
}
AuthenticateUserResponse represents the output of user authentication
type AuthenticateUserUseCase ¶
type AuthenticateUserUseCase struct {
// contains filtered or unexported fields
}
AuthenticateUserUseCase handles user authentication
func NewAuthenticateUserUseCase ¶
func NewAuthenticateUserUseCase( userRepo repositories.UserRepository, authService services.AuthService, ) *AuthenticateUserUseCase
NewAuthenticateUserUseCase creates a new AuthenticateUserUseCase
func (*AuthenticateUserUseCase) Execute ¶
func (uc *AuthenticateUserUseCase) Execute(ctx context.Context, req *AuthenticateUserRequest) (*AuthenticateUserResponse, error)
Execute authenticates a user with the given credentials
type GitHubAuthenticateRequest ¶
type GitHubAuthenticateRequest struct {
Token string
}
GitHubAuthenticateRequest represents the input for GitHub authentication
type GitHubAuthenticateResponse ¶
type GitHubAuthenticateResponse struct {
User *entities.User
APIKey *services.APIKey
Permissions []entities.Permission
GitHubInfo *entities.GitHubUserInfo
}
GitHubAuthenticateResponse represents the output of GitHub authentication
type GitHubAuthenticateUseCase ¶
type GitHubAuthenticateUseCase struct {
// contains filtered or unexported fields
}
GitHubAuthenticateUseCase handles GitHub authentication
func NewGitHubAuthenticateUseCase ¶
func NewGitHubAuthenticateUseCase( userRepo repositories.UserRepository, authService services.AuthService, githubAuthService services.GitHubAuthService, ) *GitHubAuthenticateUseCase
NewGitHubAuthenticateUseCase creates a new GitHubAuthenticateUseCase
func (*GitHubAuthenticateUseCase) Execute ¶
func (uc *GitHubAuthenticateUseCase) Execute(ctx context.Context, req *GitHubAuthenticateRequest) (*GitHubAuthenticateResponse, error)
Execute authenticates a user using GitHub token
type ValidateAPIKeyRequest ¶
type ValidateAPIKeyRequest struct {
APIKey string
}
ValidateAPIKeyRequest represents the input for API key validation
type ValidateAPIKeyResponse ¶
type ValidateAPIKeyResponse struct {
User *entities.User
Permissions []entities.Permission
Valid bool
}
ValidateAPIKeyResponse represents the output of API key validation
type ValidateAPIKeyUseCase ¶
type ValidateAPIKeyUseCase struct {
// contains filtered or unexported fields
}
ValidateAPIKeyUseCase handles API key validation
func NewValidateAPIKeyUseCase ¶
func NewValidateAPIKeyUseCase( userRepo repositories.UserRepository, authService services.AuthService, ) *ValidateAPIKeyUseCase
NewValidateAPIKeyUseCase creates a new ValidateAPIKeyUseCase
func (*ValidateAPIKeyUseCase) Execute ¶
func (uc *ValidateAPIKeyUseCase) Execute(ctx context.Context, req *ValidateAPIKeyRequest) (*ValidateAPIKeyResponse, error)
Execute validates an API key and returns the associated user
type ValidatePermissionRequest ¶
type ValidatePermissionRequest struct {
User *entities.User
Permission entities.Permission
}
ValidatePermissionRequest represents the input for permission validation
type ValidatePermissionResponse ¶
ValidatePermissionResponse represents the output of permission validation
type ValidatePermissionUseCase ¶
type ValidatePermissionUseCase struct {
// contains filtered or unexported fields
}
ValidatePermissionUseCase handles permission validation
func NewValidatePermissionUseCase ¶
func NewValidatePermissionUseCase( authService services.AuthService, ) *ValidatePermissionUseCase
NewValidatePermissionUseCase creates a new ValidatePermissionUseCase
func (*ValidatePermissionUseCase) Execute ¶
func (uc *ValidatePermissionUseCase) Execute(ctx context.Context, req *ValidatePermissionRequest) (*ValidatePermissionResponse, error)
Execute validates if a user has a specific permission