apikeys

package
v0.52.1 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewApiKeyService

func NewApiKeyService(config ApiKeyServiceConfig) services.IApiKeyService

Types

type ApiKeyService

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

func (*ApiKeyService) Create added in v0.52.0

func (s *ApiKeyService) Create(ctx context.Context, keyType models.ApiKeyType, name string) (string, error)

func (*ApiKeyService) Delete added in v0.52.0

func (s *ApiKeyService) Delete(ctx context.Context, name string) error

func (*ApiKeyService) GetApiKeyName added in v0.52.0

func (s *ApiKeyService) GetApiKeyName(ctx context.Context, apiKey string) (string, error)

func (*ApiKeyService) GetApiKeyType added in v0.52.0

func (s *ApiKeyService) GetApiKeyType(ctx context.Context, apiKey string) (models.ApiKeyType, error)

func (*ApiKeyService) IsTargetApiKey added in v0.52.0

func (s *ApiKeyService) IsTargetApiKey(ctx context.Context, apiKey string) bool

func (*ApiKeyService) IsValidApiKey

func (s *ApiKeyService) IsValidApiKey(ctx context.Context, apiKey string) bool

func (*ApiKeyService) ListClientKeys

func (s *ApiKeyService) ListClientKeys(ctx context.Context) ([]*services.ApiKeyDTO, error)

type ApiKeyServiceConfig

type ApiKeyServiceConfig struct {
	ApiKeyStore         stores.ApiKeyStore
	GenerateRandomKey   func(name string) string
	GetKeyHash          func(key string) string
	TrackTelemetryEvent func(event telemetry.Event, clientId string) error
}

Jump to

Keyboard shortcuts

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