mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
* remove state and refactor interface to IsDisabled * update docs and span * Update pkg/services/apikey/apikey.go Co-authored-by: Alexander Zobnin <alexanderzobnin@gmail.com> --------- Co-authored-by: Alexander Zobnin <alexanderzobnin@gmail.com>
19 lines
708 B
Go
19 lines
708 B
Go
package apikey
|
|
|
|
import (
|
|
"context"
|
|
)
|
|
|
|
type Service interface {
|
|
GetAPIKeys(ctx context.Context, query *GetApiKeysQuery) error
|
|
GetAllAPIKeys(ctx context.Context, orgID int64) ([]*APIKey, error)
|
|
DeleteApiKey(ctx context.Context, cmd *DeleteCommand) error
|
|
AddAPIKey(ctx context.Context, cmd *AddCommand) error
|
|
GetApiKeyById(ctx context.Context, query *GetByIDQuery) error
|
|
GetApiKeyByName(ctx context.Context, query *GetByNameQuery) error
|
|
GetAPIKeyByHash(ctx context.Context, hash string) (*APIKey, error)
|
|
UpdateAPIKeyLastUsedDate(ctx context.Context, tokenID int64) error
|
|
// IsDisabled returns true if the API key is not available for use.
|
|
IsDisabled(ctx context.Context, orgID int64) (bool, error)
|
|
}
|