Documentation
¶
Index ¶
- type BasicAuthStrategy
- type JWTAuthStrategy
- type Service
- func (s *Service) CheckPasswordHash(password, hash string) bool
- func (s *Service) GenerateToken(user *domain.User) (string, error)
- func (s *Service) GetCurrentUserId(token *jwt.Token) (userID uuid.UUID, err error)
- func (s *Service) Login(ctx context.Context, identity, password string) (u *domain.User, err error)
- func (s *Service) ValidEmail(email string) bool
- type Strategy
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BasicAuthStrategy ¶
type BasicAuthStrategy struct {
// contains filtered or unexported fields
}
BasicAuthStrategy implements AuthStrategy for CLI (no JWT, just password check)
func (*BasicAuthStrategy) GenerateToken ¶
func (s *BasicAuthStrategy) GenerateToken(user *domain.User) (string, error)
func (*BasicAuthStrategy) GetCurrentUserID ¶
type JWTAuthStrategy ¶
type JWTAuthStrategy struct {
// contains filtered or unexported fields
}
JWTAuthStrategy implements AuthStrategy for JWT-based authentication
func NewJWTAuthStrategy ¶
func NewJWTAuthStrategy( uow repository.UnitOfWork, cfg config.JwtConfig, logger *slog.Logger, ) *JWTAuthStrategy
func (*JWTAuthStrategy) GenerateToken ¶
func (s *JWTAuthStrategy) GenerateToken(user *domain.User) (string, error)
func (*JWTAuthStrategy) GetCurrentUserID ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewBasicAuthService ¶
func NewBasicAuthService(uow repository.UnitOfWork, logger *slog.Logger) *Service
func NewService ¶
func NewService( uow repository.UnitOfWork, strategy Strategy, logger *slog.Logger, ) *Service
func (*Service) CheckPasswordHash ¶
func (*Service) GetCurrentUserId ¶
func (*Service) ValidEmail ¶
Click to show internal directories.
Click to hide internal directories.