jwt

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 26, 2022 License: AGPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config added in v0.9.0

type Config struct {
	SigningSecret              string            `json:"signingSecret"`
	SigningSecretBase64Encoded bool              `json:"signingSecretBase64Encoded"`
	PublicKey                  string            `json:"publicKey"`
	JWKsFile                   FileOrContent     `json:"jwksFile"`
	JWKsURL                    string            `json:"jwksUrl"`
	StripAuthorizationHeader   bool              `json:"stripAuthorizationHeader"`
	ForwardHeaders             map[string]string `json:"forwardHeaders"`
	TokenQueryKey              string            `json:"tokenQueryKey"`
	Claims                     string            `json:"claims"`
}

Config configures a JWT ACP handler.

type ContentKeySet

type ContentKeySet struct {
	// contains filtered or unexported fields
}

ContentKeySet gets signing keys from a JWK set given as raw content.

func NewContentKeySet

func NewContentKeySet(content []byte) (*ContentKeySet, error)

NewContentKeySet returns a ContentKeySet.

func (*ContentKeySet) Key

func (k *ContentKeySet) Key(_ context.Context, keyID string) (*jose.JSONWebKey, error)

Key returns a key for a given key ID.

type FileKeySet

type FileKeySet struct {
	// contains filtered or unexported fields
}

FileKeySet gets signing keys from a JWK set stored in a file.

func NewFileKeySet

func NewFileKeySet(path string) *FileKeySet

NewFileKeySet returns a FileKeySet.

func (*FileKeySet) Key

func (k *FileKeySet) Key(_ context.Context, keyID string) (*jose.JSONWebKey, error)

Key returns a key for a given key ID.

type FileOrContent

type FileOrContent string

FileOrContent hold a file path or content.

func (FileOrContent) IsPath

func (f FileOrContent) IsPath() bool

IsPath returns true if the FileOrContent is a file path, otherwise returns false.

func (FileOrContent) Read

func (f FileOrContent) Read() ([]byte, error)

func (FileOrContent) String

func (f FileOrContent) String() string

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler is a JWT ACP Handler.

func NewHandler

func NewHandler(cfg *Config, polName string) (*Handler, error)

NewHandler returns a new JWT ACP Handler.

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(rw http.ResponseWriter, req *http.Request)

type KeySet

type KeySet interface {
	Key(ctx context.Context, keyID string) (*jose.JSONWebKey, error)
}

KeySet allows to get a signing key from a JWK set.

type RemoteKeySet

type RemoteKeySet struct {
	// contains filtered or unexported fields
}

RemoteKeySet resolves a key set based on a key set URL, and keeps it up to date.

func NewRemoteKeySet

func NewRemoteKeySet(url string) *RemoteKeySet

NewRemoteKeySet returns a RemoteKeySet.

func (*RemoteKeySet) Key

func (s *RemoteKeySet) Key(ctx context.Context, keyID string) (*jose.JSONWebKey, error)

Key returns a key for a given key ID.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL