jwk

package
v0.24.1 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CreatePostgresTable represents a query to create the Postgres jwks table.
	CreatePostgresTable = `
CREATE TABLE
IF NOT EXISTS
jwks (
	id     UUID PRIMARY KEY,
	active BOOLEAN,
	key    JSON DEFAULT NULL
);
`

	// CreateSqliteTable represents a query to create the Sqlite jwks table.
	CreateSqliteTable = `
CREATE TABLE
IF NOT EXISTS
jwks (
	id     TEXT PRIMARY KEY,
	active BOOLEAN,
	key    TEXT
);
`
)

Variables

This section is empty.

Functions

func New

func New(opts ...EngineOpt) (*engine, error)

New creates and returns a Vela service for integrating with key sets in the database.

Types

type EngineOpt

type EngineOpt func(*engine) error

EngineOpt represents a configuration option to initialize the database engine for key sets.

func WithClient

func WithClient(client *gorm.DB) EngineOpt

WithClient sets the gorm.io/gorm client in the database engine for key sets.

func WithContext

func WithContext(ctx context.Context) EngineOpt

WithContext sets the context in the database engine for key sets.

func WithLogger

func WithLogger(logger *logrus.Entry) EngineOpt

WithLogger sets the github.com/sirupsen/logrus logger in the database engine for key sets.

func WithSkipCreation

func WithSkipCreation(skipCreation bool) EngineOpt

WithSkipCreation sets the skip creation logic in the database engine for key sets.

type JWKInterface

type JWKInterface interface {
	// JWK Data Definition Language Functions
	//
	// https://en.wikipedia.org/wiki/Data_definition_language
	CreateJWKTable(context.Context, string) error

	// CreateJWK defines a function that creates a JWK.
	CreateJWK(context.Context, jwk.RSAPublicKey) error
	// RotateKeys defines a function that rotates JWKs.
	RotateKeys(context.Context) error
	// ListJWKs defines a function that lists all JWKs configured.
	ListJWKs(context.Context) (jwk.Set, error)
	// GetJWK defines a function that gets a JWK by the provided key ID.
	GetActiveJWK(context.Context, string) (jwk.RSAPublicKey, error)
}

JWKInterface represents the Vela interface for JWK functions with the supported Database backends.

Jump to

Keyboard shortcuts

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