mirror of
https://github.com/coder/coder.git
synced 2025-07-10 23:53:15 +00:00
- Adds the database implementation for fetching and caching keys used for JWT signing. It's been merged into the `keyrotate` pkg and renamed to `cryptokeys` since they're coupled concepts.
22 lines
484 B
Go
22 lines
484 B
Go
package cryptokeys
|
|
|
|
import (
|
|
"context"
|
|
|
|
"golang.org/x/xerrors"
|
|
|
|
"github.com/coder/coder/v2/codersdk"
|
|
)
|
|
|
|
var (
|
|
ErrKeyNotFound = xerrors.New("key not found")
|
|
ErrKeyInvalid = xerrors.New("key is invalid for use")
|
|
ErrClosed = xerrors.New("closed")
|
|
)
|
|
|
|
// Keycache provides an abstraction for fetching signing keys.
|
|
type Keycache interface {
|
|
Signing(ctx context.Context) (codersdk.CryptoKey, error)
|
|
Verifying(ctx context.Context, sequence int32) (codersdk.CryptoKey, error)
|
|
}
|