Documentation ¶
Overview ¶
Package services implements services which provides JWK signing and verifying.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClaimsSecure ¶
type ClaimsSecure interface { GetAudience() string GetExpireAt() time.Time GetIssuedAt() time.Time GetIssuer() string GetNotBefore() time.Time GetSubject() string SetExpireAt(time.Time) SetIssuedAt(time.Time) SetIssuer(string) SetNotBefore(time.Time) jwt.Claims }
A ClaimsSecure represents a JSON object which has a basic set of claims to safely validate it.
type ErrInvalidKeyID ¶
type ErrInvalidKeyID string
An ErrInvalidKeyID represents an error when the key identifier used to sign a token could not be found.
func (ErrInvalidKeyID) Error ¶
func (e ErrInvalidKeyID) Error() string
Error returns string representation of current instance error.
type ErrInvalidToken ¶
type ErrInvalidToken int
An ErrInvalidToken represents an error when a token is not valid.
func (ErrInvalidToken) Error ¶
func (e ErrInvalidToken) Error() string
Error returns string representation of current instance error.
type ErrUnexpectedAlg ¶
type ErrUnexpectedAlg string
An ErrUnexpectedAlg represents an error when a token uses an unexpected algorithm for its signature.
func (ErrUnexpectedAlg) Error ¶
func (e ErrUnexpectedAlg) Error() string
Error returns string representation of current instance error.
type Signer ¶
type Signer struct {
// contains filtered or unexported fields
}
A Signer represents a service which provides token creation and signing.
type Verifier ¶
type Verifier struct {
// contains filtered or unexported fields
}
A Verifier represents a service which provides token decoding and validation.
func NewVerifier ¶
func NewVerifier( svcJWKSet jwkservices.SetService, tracer tlog.Tracer, issuers ...string, ) (*Verifier, error)
NewVerifier creates a new instance of Verifier service.
func (*Verifier) Verify ¶
func (v *Verifier) Verify( rawtoken string, header jws.Header, payload ClaimsSecure, ) (*jws.SignedToken, error)
Verify specified token and decode it.