apikey

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: May 10, 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 Cache

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

Cache is a cache for API keys.

func NewCache

func NewCache(
	apiKeyLister apiKeyLister,
	debug *config.DebugConfig,
) *Cache

NewCache creates a new cache.

func (*Cache) GetAPIKeyBySecret added in v0.21.0

func (c *Cache) GetAPIKeyBySecret(secret string) (*K, bool)

GetAPIKeyBySecret returns an API key by its secret.

func (*Cache) Sync

func (c *Cache) Sync(ctx context.Context, interval time.Duration) error

Sync synchronizes the cache.

type K

type K struct {
	Role           string
	UserID         string
	OrganizationID string
}

K represents a role associated with an API key.

Jump to

Keyboard shortcuts

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