Documentation
¶
Index ¶
- func ParseEncryptionKeyBase64(b64Data string) ([]byte, error)
- func ParseSigningKeyPEM(pemData []byte) (*ecdsa.PrivateKey, error)
- type DriverStore
- type EncryptedClaims
- type IDGenerator
- type JWTCreator
- type JWTService
- type OAuthClient
- type Result
- type SensitiveClaims
- type Service
- type SessionClaims
- type UserInfoProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseSigningKeyPEM ¶
func ParseSigningKeyPEM(pemData []byte) (*ecdsa.PrivateKey, error)
Types ¶
type DriverStore ¶
type EncryptedClaims ¶
type IDGenerator ¶
type IDGenerator func() string
type JWTCreator ¶
type JWTService ¶
type JWTService struct {
// contains filtered or unexported fields
}
func NewJWTService ¶
func NewJWTService(signingKey *ecdsa.PrivateKey, encryptionKey []byte, idGenerator IDGenerator, issuer string, tokenExpiry time.Duration) (*JWTService, error)
func (*JWTService) CreateToken ¶
func (*JWTService) ValidateToken ¶
func (s *JWTService) ValidateToken(_ context.Context, tokenString string) (*SessionClaims, *SensitiveClaims, error)
type OAuthClient ¶
type SensitiveClaims ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(oauthClient OAuthClient, jwtCreator JWTCreator, userInfoProvider UserInfoProvider, driverStore DriverStore) *Service
type SessionClaims ¶
type SessionClaims struct {
jwt.RegisteredClaims
SessionID string `json:"sid"`
IRacingUserID int64 `json:"ir_uid"`
IRacingUserName string `json:"ir_name"`
Entitlements []string `json:"ent,omitempty"`
Encrypted EncryptedClaims `json:"encrypted"`
}
Click to show internal directories.
Click to hide internal directories.