apikeyimpl

package
v0.0.0-...-fb7f86c Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2023 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProvideService

func ProvideService(db db.DB, cfg *setting.Cfg, quotaService quota.Service) (apikey.Service, error)

Types

type Service

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

func (*Service) AddAPIKey

func (s *Service) AddAPIKey(ctx context.Context, cmd *apikey.AddCommand) (res *apikey.APIKey, err error)

func (*Service) DeleteApiKey

func (s *Service) DeleteApiKey(ctx context.Context, cmd *apikey.DeleteCommand) error

func (*Service) GetAPIKeyByHash

func (s *Service) GetAPIKeyByHash(ctx context.Context, hash string) (*apikey.APIKey, error)

func (*Service) GetAPIKeys

func (s *Service) GetAPIKeys(ctx context.Context, query *apikey.GetApiKeysQuery) ([]*apikey.APIKey, error)

func (*Service) GetAllAPIKeys

func (s *Service) GetAllAPIKeys(ctx context.Context, orgID int64) ([]*apikey.APIKey, error)

func (*Service) GetApiKeyById

func (s *Service) GetApiKeyById(ctx context.Context, query *apikey.GetByIDQuery) (*apikey.APIKey, error)

func (*Service) GetApiKeyByName

func (s *Service) GetApiKeyByName(ctx context.Context, query *apikey.GetByNameQuery) (*apikey.APIKey, error)

func (*Service) IsDisabled

func (s *Service) IsDisabled(ctx context.Context, orgID int64) (bool, error)

IsDisabled returns true if the apikey service is disabled for the given org. This is the case if the org has no apikeys.

func (*Service) UpdateAPIKeyLastUsedDate

func (s *Service) UpdateAPIKeyLastUsedDate(ctx context.Context, tokenID int64) error

func (*Service) Usage

func (s *Service) Usage(ctx context.Context, scopeParams *quota.ScopeParameters) (*quota.Map, error)

Jump to

Keyboard shortcuts

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