database

package
v1.4.20 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

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

Database is an implementation of Interface for database auth.

func NewDatabase

func NewDatabase(ctx context.Context, store common.Datastore) (*Database, error)

NewDatabase init new database interface.

func (*Database) GetCurrentKey

func (db *Database) GetCurrentKey() common.JWTKey

GetCurrentKey fetch latest key from cache, it should have privatekey.

func (*Database) GetKeys

func (db *Database) GetKeys() []common.JWTKey

GetKeys fetch all keys from cache.

func (*Database) RefreshKeys

func (db *Database) RefreshKeys(ctx context.Context, reload bool) ([]common.JWTKey, error)

RefreshKeys refresh the keys from database.

func (*Database) RotateKeys

func (db *Database) RotateKeys(ctx context.Context) error

RotateKeys rotates the jwt secrets.

Jump to

Keyboard shortcuts

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