Documentation
¶
Index ¶
- Constants
- type Engine
- func (e *Engine) CreateJWK(ctx context.Context, j jwk.RSAPublicKey) error
- func (e *Engine) CreateJWKTable(ctx context.Context, driver string) error
- func (e *Engine) GetActiveJWK(ctx context.Context, id string) (jwk.RSAPublicKey, error)
- func (e *Engine) ListJWKs(ctx context.Context) (jwk.Set, error)
- func (e *Engine) RotateKeys(ctx context.Context) error
- type EngineOpt
- type JWKInterface
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 ¶
This section is empty.
Types ¶
type Engine ¶ added in v0.27.0
type Engine struct {
// contains filtered or unexported fields
}
Engine represents the key set functionality that implements the JWKService interface.
func (*Engine) CreateJWKTable ¶ added in v0.27.0
CreateJWKTable creates the jwks table in the database.
func (*Engine) GetActiveJWK ¶ added in v0.27.0
GetActiveJWK gets a JWK by UUID (kid) from the database if active.
type EngineOpt ¶
EngineOpt represents a configuration option to initialize the database engine for key sets.
func WithClient ¶
WithClient sets the gorm.io/gorm client in the database engine for key sets.
func WithContext ¶
WithContext sets the context in the database engine for key sets.
func WithLogger ¶
WithLogger sets the github.com/sirupsen/logrus logger in the database engine for key sets.
func WithSkipCreation ¶
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)
}
Click to show internal directories.
Click to hide internal directories.