Versions in this module Expand all Collapse all v0 v0.3.0 Jan 12, 2020 Changes in this version + func NewContext(ctx context.Context, token *JWT) context.Context + func RequestAdd(req *http.Request, jwt *JWT) *http.Request + type Algorithm string + const ES256 + const ES384 + const ES512 + const HS256 + const HS384 + const HS512 + const NONE + const PS256 + const PS384 + const PS512 + const RS256 + const RS384 + const RS512 + func (a Algorithm) Sign(data []byte, key Key) (Signature, error) + func (a Algorithm) Verify(data []byte, sig Signature, key Key) error + type Claims map[string]interface + func (c *Claims) UnmarshalJSON(b []byte) error + func (c Claims) Audience() ([]string, bool) + func (c Claims) Contains(key string) bool + func (c Claims) Delete(key string) interface{} + func (c Claims) DeleteAudience() []string + func (c Claims) DeleteExpiration() time.Time + func (c Claims) DeleteIdentifier() string + func (c Claims) DeleteIssuedAt() time.Time + func (c Claims) DeleteIssuer() string + func (c Claims) DeleteNotBefore() time.Time + func (c Claims) DeleteSubject() string + func (c Claims) Expiration() (time.Time, bool) + func (c Claims) Get(key string) (interface{}, bool) + func (c Claims) GetBool(key string) (bool, bool) + func (c Claims) GetFloat64(key string) (float64, bool) + func (c Claims) GetInt(key string) (int, bool) + func (c Claims) GetMarshalled(key string, v interface{}) (bool, error) + func (c Claims) GetString(key string) (string, bool) + func (c Claims) GetTime(key string) (time.Time, bool) + func (c Claims) Identifier() (string, bool) + func (c Claims) IsAlreadyValid(leeway time.Duration) bool + func (c Claims) IsStillValid(leeway time.Duration) bool + func (c Claims) IsValid(leeway time.Duration) bool + func (c Claims) IssuedAt() (time.Time, bool) + func (c Claims) Issuer() (string, bool) + func (c Claims) Len() int + func (c Claims) MarshalJSON() ([]byte, error) + func (c Claims) NotBefore() (time.Time, bool) + func (c Claims) Set(key string, value interface{}) interface{} + func (c Claims) SetAudience(auds ...string) []string + func (c Claims) SetExpiration(t time.Time) time.Time + func (c Claims) SetIdentifier(id string) string + func (c Claims) SetIssuedAt(t time.Time) time.Time + func (c Claims) SetIssuer(issuer string) string + func (c Claims) SetNotBefore(t time.Time) time.Time + func (c Claims) SetSubject(subject string) string + func (c Claims) SetTime(key string, t time.Time) time.Time + func (c Claims) Subject() (string, bool) + func NewClaims() Claims + type JWT struct + func Decode(token string) (*JWT, error) + func Encode(claims Claims, key Key, algorithm Algorithm) (*JWT, error) + func FromContext(ctx context.Context) (*JWT, bool) + func RequestDecode(req *http.Request) (*JWT, error) + func RequestVerify(req *http.Request, key Key) (*JWT, error) + func Verify(token string, key Key) (*JWT, error) + func (jwt *JWT) Algorithm() Algorithm + func (jwt *JWT) Claims() Claims + func (jwt *JWT) IsValid(leeway time.Duration) bool + func (jwt *JWT) Key() (Key, error) + func (jwt *JWT) String() string + type Key interface + func ReadECPrivateKey(r io.Reader) (Key, error) + func ReadECPublicKey(r io.Reader) (Key, error) + func ReadRSAPrivateKey(r io.Reader) (Key, error) + func ReadRSAPublicKey(r io.Reader) (Key, error) + type Signature []byte Other modules containing this package tideland.dev/go