Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrMissingToken = errors.New("missing bearer token") ErrInvalidToken = errors.New("invalid bearer token") )
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service interface {
// ValidateAndGetUserID validates a bearer token from the Authorization header
// and returns the associated WHOOP user ID.
// Returns ErrMissingToken if the header is empty or malformed.
// Returns ErrInvalidToken if the token is invalid or expired.
ValidateAndGetUserID(ctx context.Context, authHeader string) (int64, error)
}
type Validator ¶
type Validator struct {
// contains filtered or unexported fields
}
func NewValidator ¶
func NewValidator(cache storage.TokenCache, whoopLimiter storage.WhoopRateLimiter) *Validator
Click to show internal directories.
Click to hide internal directories.