agentkeys

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Key

type Key struct {
	ID         int64
	KeyHash    string
	Label      string
	Scopes     string
	CreatedAt  sql.NullTime
	LastUsedAt sql.NullTime
	RevokedAt  sql.NullTime
}

func (*Key) HasScope

func (k *Key) HasScope(scope string) bool

type Store

type Store struct {
	DB            func() *sql.DB
	Prefix        string
	DefaultScopes string
	NowSQL        string
}

func (*Store) Create

func (s *Store) Create(label, scopes string) (rawKey string, id int64, err error)

func (*Store) List

func (s *Store) List() ([]Key, error)

func (*Store) Lookup

func (s *Store) Lookup(raw string) (*Key, error)

func (*Store) Revoke

func (s *Store) Revoke(id int64) error

Jump to

Keyboard shortcuts

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