Versions in this module Expand all Collapse all v3 v3.7.3 Dec 14, 2019 Changes in this version + const ENV_PUBLIC_KEY + const ENV_SECRET + var DefaultTokenSources = []TokenSource + var NotValidInputError = errors.New("Not a valid input: map or slice") + func AssertHmacToken(token *jwt.Token) error + func AssertPublicKeyAndTokenCombination(publicKey interface{}, token *jwt.Token) error + func ExtractToken(tss []TokenSource, r *http.Request) (string, error) + func Flatten(nested map[string]interface{}, prefix string, style SeparatorStyle) (map[string]interface{}, error) + func IsEcdsaPublicKey(key interface{}) bool + func IsEcdsaToken(token *jwt.Token) bool + func IsHmacToken(token *jwt.Token) bool + func IsRsaPublicKey(key interface{}) bool + func IsRsaToken(token *jwt.Token) bool + func ParsePublicKey(pem []byte) (interface{}, error) + func ReadPublicKeyFile(filepath string) (interface{}, error) + func Setup(c *caddy.Controller) error + func ValidateToken(uToken string, keyBackend KeyBackend) (*jwt.Token, error) + type AccessRule struct + Authorize RuleType + Claim string + Value string + type Auth struct + Next httpserver.Handler + Realm string + Rules []Rule + func (h Auth) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, error) + type CookieTokenSource struct + CookieName string + func (cts *CookieTokenSource) ExtractToken(r *http.Request) string + type EncryptionType int + const HMAC + const PKI + type HeaderTokenSource struct + HeaderName string + func (hts *HeaderTokenSource) ExtractToken(r *http.Request) string + type HmacKeyBackend struct + func (instance *HmacKeyBackend) ProvideKey(token *jwt.Token) (interface{}, error) + type KeyBackend interface + ProvideKey func(token *jwt.Token) (interface{}, error) + func NewDefaultKeyBackends() ([]KeyBackend, error) + type LazyHmacKeyBackend struct + func NewLazyHmacKeyBackend(value string) (*LazyHmacKeyBackend, error) + func (instance *LazyHmacKeyBackend) ProvideKey(token *jwt.Token) (interface{}, error) + type LazyPublicKeyBackend struct + func NewLazyPublicKeyFileBackend(value string) (*LazyPublicKeyBackend, error) + func (instance *LazyPublicKeyBackend) ProvideKey(token *jwt.Token) (interface{}, error) + type NoopKeyBackend struct + func (instance *NoopKeyBackend) ProvideKey(token *jwt.Token) (interface{}, error) + type PublicKeyBackend struct + func (instance *PublicKeyBackend) ProvideKey(token *jwt.Token) (interface{}, error) + type QueryTokenSource struct + ParamName string + func (qts *QueryTokenSource) ExtractToken(r *http.Request) string + type Rule struct + AccessRules []AccessRule + AllowRoot bool + ExceptedPaths []string + KeyBackends []KeyBackend + Passthrough bool + Path string + Redirect string + StripHeader bool + TokenSources []TokenSource + type RuleType int + const ALLOW + const DENY + type SeparatorStyle int + const DotStyle + const RailsStyle + type TokenSource interface + ExtractToken func(r *http.Request) string Other modules containing this package github.com/BTBurke/caddy-jwt