Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrJwtConfigNotFound = errors.New("jwt config not found") ErrJwtKeyNotFound = errors.New("jwt key not found") ErrNoKeyIdInJwtHeader = errors.New("jwt doesn't have key id in header") ErrUnsupportedAlgorithm = errors.New("unsupported jwt algorithm") ErrUnknownAlgorithm = errors.New("unknown jwt algorithm") )
Functions ¶
This section is empty.
Types ¶
type ConfigResolver ¶
type ConfigResolver struct {
// contains filtered or unexported fields
}
func NewConfigResolver ¶
func NewConfigResolver() *ConfigResolver
func (*ConfigResolver) All ¶
func (c *ConfigResolver) All() iter.Seq[JwtTokenConfig]
func (*ConfigResolver) Register ¶
func (c *ConfigResolver) Register(t any, config JwtTokenConfig)
func (*ConfigResolver) Resolve ¶
func (c *ConfigResolver) Resolve(t any) (JwtTokenConfig, error)
type JwtTokenConfig ¶
type JwtTokenConfig struct {
// JWS
SignKeyId string
SignAlgorithm jose.SignatureAlgorithm
// JWE
EncryptKeyId string
EncryptKeyAlgorithm jose.KeyAlgorithm
EncryptContentAlgorithm jose.ContentEncryption
}
type KeyGenerator ¶
type KeyGenerator struct {
}
func NewKeyGenerator ¶
func NewKeyGenerator() *KeyGenerator
func (*KeyGenerator) Generate ¶
func (m *KeyGenerator) Generate(keyId string, algorithm string) (*jose.JSONWebKey, error)
type KeyStore ¶
type KeyStore struct {
// contains filtered or unexported fields
}
func NewKeyStore ¶
func NewKeyStore(keys []*jose.JSONWebKey) *KeyStore
func (*KeyStore) List ¶
func (s *KeyStore) List() []*jose.JSONWebKey
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManager(keys *KeyStore, configResolver *ConfigResolver) *Manager
Click to show internal directories.
Click to hide internal directories.