defaultstore

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package defaultstore implements the SQL-backed default store for the jwt plugin.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultJWTStore

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

DefaultJWTStore implements jwttypes.Store using a SQL database backend.

Supports PostgreSQL, MySQL, and SQLite through dialect-specific sqlc-generated queries. Safe for concurrent use.

func NewDefaultJWTStore

func NewDefaultJWTStore(db *sql.DB, dialect plugins.Dialect) (*DefaultJWTStore, error)

NewDefaultJWTStore creates a DefaultJWTStore for the given dialect. The dialect switch happens exactly once here; all store methods call through the querier interface and are dialect-agnostic.

func (*DefaultJWTStore) DeleteExpiredJWKS

func (s *DefaultJWTStore) DeleteExpiredJWKS(ctx context.Context) error

DeleteExpiredJWKS removes all expired keys from the database.

func (*DefaultJWTStore) GetCurrentJWK

func (s *DefaultJWTStore) GetCurrentJWK(ctx context.Context, algorithm, use string) (jwk.Key, error)

GetCurrentJWK retrieves the most recent non-expired JWK matching algorithm and use.

func (*DefaultJWTStore) ListJWKS

func (s *DefaultJWTStore) ListJWKS(ctx context.Context) ([]jwttypes.JWK, error)

ListJWKS retrieves all non-expired JWKs from the database.

func (*DefaultJWTStore) StoreJWK

func (s *DefaultJWTStore) StoreJWK(ctx context.Context, key jwk.Key, algorithm, use string, expiresAt *time.Time) error

StoreJWK persists a JWK to the database with optional expiration.

Jump to

Keyboard shortcuts

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