Documentation
¶
Index ¶
- Variables
- func ParseAlgorithm(keyAttrs *keystore.KeyAttributes) (string, error)
- type JsonWebTokenClaims
- type Service
- func (service *Service) GenerateToken(user *entities.User) (string, error)
- func (service *Service) KeyFunc(token *jwt.Token) (interface{}, error)
- func (service *Service) ParseToken(w http.ResponseWriter, r *http.Request) (*jwt.Token, *JsonWebTokenClaims, error)
- func (service *Service) ParseTokenString(tokenString string) (*jwt.Token, error)
- func (service *Service) PublicKey() crypto.PublicKey
- func (service *Service) Verify(token *jwt.Token) error
- type SigningMethod
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrAuthorizationHeaderRequired = errors.New("jwt/service: authorization header required") ErrInvalidToken = errors.New("jwt/service: invalid token") ErrInvalidUserClaim = errors.New("jwt/service: invalid user id claim") ErrInvalidEmailClaim = errors.New("jwt/service: invalid email claim") )
View Source
var (
ErrInvalidSignatureAlgorithm = errors.New("jwt: invalid signature algorithm")
)
Functions ¶
func ParseAlgorithm ¶
func ParseAlgorithm(keyAttrs *keystore.KeyAttributes) (string, error)
Types ¶
type JsonWebTokenClaims ¶
type JsonWebTokenClaims struct {
// Email string
Organizations []uint64 `json:"orgs"`
Services []uint64 `json:"svcs"`
UserID uint64 `json:"uid"`
WebAuthnClaims *webauthn.SessionData
jwt.RegisteredClaims
}
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(config *config.WebService, keyring *platform.Keyring, keyAttrs *keystore.KeyAttributes) (*Service, error)
func (*Service) GenerateToken ¶
func (*Service) ParseToken ¶
func (service *Service) ParseToken( w http.ResponseWriter, r *http.Request) (*jwt.Token, *JsonWebTokenClaims, error)
func (*Service) ParseTokenString ¶
type SigningMethod ¶
type SigningMethod struct {
jwt.SigningMethod
// contains filtered or unexported fields
}
func NewSigningMethod ¶
func NewSigningMethod(keyAttrs *keystore.KeyAttributes) (*SigningMethod, error)
func (*SigningMethod) Alg ¶
func (sm *SigningMethod) Alg() string
func (*SigningMethod) Digest ¶
func (sm *SigningMethod) Digest(signingString string) ([]byte, error)
Click to show internal directories.
Click to hide internal directories.