Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Claims ¶
type Claims struct {
Issuer string `json:"iss,omitempty"` // 発行者
Subject string `json:"sub,omitempty"` // 用途
Audience string `json:"aud,omitempty"` // 想定利用者
ExpirationTime string `json:"exp,omitempty"` // 失効時刻
IssuedAt string `json:"iat,omitempty"` // 発行時刻
JWTID string `json:"jti,omitempty"` // JWT ID
}
Claims is jwt payload type
type Repository ¶
type Repository interface {
CheckJTI(ctx context.Context, jti string) (bool, error)
InvalidateJTI(ctx context.Context, jti string, exp time.Time) error
}
func NewRepository ¶
func NewRepository(rdb *redis.Client) Repository
type Service ¶
type Service interface {
CheckJTI(ctx context.Context, jti string) (bool, error)
InvalidateJTI(ctx context.Context, jti string, exp time.Time) error
}
Service is the interface for auth service
func NewService ¶
func NewService(repository Repository) Service
NewService creates a new auth service
Click to show internal directories.
Click to hide internal directories.