apikey

package
v0.0.0-...-270f78c Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2023 License: Zlib Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidAPIKey = errors.New("Invalid API key")

Functions

func NewAPIKeyCache

func NewAPIKeyCache(cacheSize int) *apiKeyCache

NewAPIKeyCache creates a new cache for API keys

func NewAPIKeyService

func NewAPIKeyService(apiKeyRepository dataservices.APIKeyRepository, userRepository dataservices.UserService) *apiKeyService

Types

type APIKeyService

type APIKeyService interface {
	HashRaw(rawKey string) []byte
	GenerateApiKey(user portainer.User, description string) (string, *portainer.APIKey, error)
	GetAPIKey(apiKeyID portainer.APIKeyID) (*portainer.APIKey, error)
	GetAPIKeys(userID portainer.UserID) ([]portainer.APIKey, error)
	GetDigestUserAndKey(digest []byte) (portainer.User, portainer.APIKey, error)
	UpdateAPIKey(apiKey *portainer.APIKey) error
	DeleteAPIKey(apiKeyID portainer.APIKeyID) error
	InvalidateUserKeyCache(userId portainer.UserID) bool
}

APIKeyService represents a service for managing API keys.

Jump to

Keyboard shortcuts

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