Documentation
¶
Index ¶
Constants ¶
View Source
const (
HintChars = (keyIDSize * 6 / 4) - 1 //nolint:gomnd
)
Variables ¶
View Source
var ErrKeySize = errors.New("key size invalid")
Functions ¶
This section is empty.
Types ¶
type Storage ¶
type Storage interface {
io.Closer
GetToken(ctx context.Context, ref TokenRef) (*Token, error)
FindToken(ctx context.Context, id KeyID) (*Token, error)
ListTokens(ctx context.Context, user string) ([]*Token, error)
CreateToken(ctx context.Context, params TokenParams) error
DeleteToken(ctx context.Context, ref TokenRef) error
UpdateTokenKey(ctx context.Context, ref TokenRef, key Key) error
UpdateTokenConfig(ctx context.Context, ref TokenRef, config TokenConfig) error
UpdateTokensStats(ctx context.Context, stats []TokenStat) error
}
type Token ¶
type Token struct {
ID int64 `db:"id"`
CreatedAt time.Time `db:"created_at"`
UpdatedAt time.Time `db:"updated_at"`
KeyID KeyID `db:"key_id"`
Hash []byte `db:"hash"` // sha-384
User string `db:"user"`
Label string `db:"label"`
Path string `db:"path"`
Headers Headers `db:"headers"`
Requests int64 `db:"requests"`
LastAccessAt time.Time `db:"last_access_at"`
// contains filtered or unexported fields
}
type TokenConfig ¶
type TokenParams ¶
type TokenParams struct {
User string
Config TokenConfig
Key Key
}
Click to show internal directories.
Click to hide internal directories.