mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
* move apikey store into a separate service * add apikey service to wire graph * fix linter * switch api to use apikey service * fix provideservice in tests * add apikey service test double * try different sql syntax * rolling back the dialect * trigger drone * trigger drone
19 lines
685 B
Go
19 lines
685 B
Go
package apikey
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/grafana/grafana/pkg/models"
|
|
)
|
|
|
|
type Service interface {
|
|
GetAPIKeys(ctx context.Context, query *models.GetApiKeysQuery) error
|
|
GetAllAPIKeys(ctx context.Context, orgID int64) []*models.ApiKey
|
|
DeleteApiKey(ctx context.Context, cmd *models.DeleteApiKeyCommand) error
|
|
AddAPIKey(ctx context.Context, cmd *models.AddApiKeyCommand) error
|
|
GetApiKeyById(ctx context.Context, query *models.GetApiKeyByIdQuery) error
|
|
GetApiKeyByName(ctx context.Context, query *models.GetApiKeyByNameQuery) error
|
|
GetAPIKeyByHash(ctx context.Context, hash string) (*models.ApiKey, error)
|
|
UpdateAPIKeyLastUsedDate(ctx context.Context, tokenID int64) error
|
|
}
|