Documentation ¶
Index ¶
Constants ¶
View Source
const DaysTokenValid = 30
Variables ¶
Functions ¶
func GenerateJwtWithClaims ¶
func IsJwtExpired ¶
Types ¶
type Claims ¶
type Claims struct { MachineID string `json:"machine_id"` jwt.RegisteredClaims }
func ParseJwtWithClaims ¶
type OpenIDConfig ¶
type OpenIDConfig struct { Issuer string `json:"issuer"` AuthEndpoint string `json:"authorization_endpoint"` TokenEndpoint string `json:"token_endpoint"` JWKSEndpoint string `json:"jwks_uri"` Scopes []string `json:"scopes_supported"` Claims []string `json:"claims_supported"` UserInfoEndpoint string `json:"userinfo_endpoint"` }
type TokenValidator ¶
type TokenValidator struct {
// contains filtered or unexported fields
}
func NewTokenValidator ¶
func NewTokenValidator(ctx context.Context) (*TokenValidator, error)
func (*TokenValidator) GetPKCEAuthInfo ¶
func (t *TokenValidator) GetPKCEAuthInfo() *ctrlv1.GetPKCEAuthInfoResponse
func (*TokenValidator) GetUser ¶
func (t *TokenValidator) GetUser(token *jwt.Token) (string, error)
func (*TokenValidator) GetUserInfo ¶
func (t *TokenValidator) GetUserInfo(token *jwt.Token) (*UserInfo, error)
func (*TokenValidator) ValidateAccessToken ¶
func (t *TokenValidator) ValidateAccessToken(token string) (string, error)
Click to show internal directories.
Click to hide internal directories.