jwks

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2021 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Overview

Package jwks manages downloading and updating the keys from a JWKS source for keys.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Database      database.Config
	SecretManager secrets.Config

	Port string `env:"PORT, default=8080"`

	// MaxRuntime is how long an individual handler should run.
	MaxRuntime time.Duration `env:"MAX_RUNTIME, default=10m"`

	// RequestTimeout is the client per-request timeout when accessing
	// remote JWKS documents.
	RequestTimeout time.Duration `env:"REQUEST_TIMEOUT, default=30s"`

	KeyCleanupTTL time.Duration `env:"HEALTH_AUTHORITY_KEY_CLEANUP_TTL, default=720h"` // 30 days

	// MaxWorkers is the number of parallel JWKS updates that can occur.
	MaxWorkers uint `env:"MAX_WORKERS, default=5"`
}

func (*Config) DatabaseConfig

func (c *Config) DatabaseConfig() *database.Config

func (*Config) SecretManagerConfig

func (c *Config) SecretManagerConfig() *secrets.Config

type Manager

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

Manager handles updating all HealthAuthorities if they've specified a JWKS URI.

func NewManager

func NewManager(db *database.DB, cleanupTTL, requestTimeout time.Duration, maxWorkers uint) (*Manager, error)

NewManager creates a new Manager.

func (*Manager) UpdateAll

func (mgr *Manager) UpdateAll(ctx context.Context) error

UpdateAll reads the JWKS keys for all HealthAuthorities.

type Server

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

Server is the server.

func NewServer

func NewServer(cfg *Config, env *serverenv.ServerEnv) (*Server, error)

NewServer makes a new server.

func (*Server) Routes

func (s *Server) Routes(ctx context.Context) *mux.Router

Routes returns the router for this server.

Jump to

Keyboard shortcuts

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