mirror of
https://github.com/grafana/grafana.git
synced 2025-08-02 23:53:10 +08:00

* remove api key endpoints * generate openapi specs * remove methods from mock service * remove ApiKeyDTO * generate openapi specs * remove apikey migration endpoints * remove unused function
30 lines
896 B
Go
30 lines
896 B
Go
package apikeytest
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/grafana/grafana/pkg/services/apikey"
|
|
)
|
|
|
|
type Service struct {
|
|
ExpectedError error
|
|
ExpectedAPIKeys []*apikey.APIKey
|
|
ExpectedAPIKey *apikey.APIKey
|
|
}
|
|
|
|
func (s *Service) GetAllAPIKeys(ctx context.Context, orgID int64) ([]*apikey.APIKey, error) {
|
|
return s.ExpectedAPIKeys, s.ExpectedError
|
|
}
|
|
func (s *Service) GetApiKeyByName(ctx context.Context, query *apikey.GetByNameQuery) (*apikey.APIKey, error) {
|
|
return s.ExpectedAPIKey, s.ExpectedError
|
|
}
|
|
func (s *Service) GetAPIKeyByHash(ctx context.Context, hash string) (*apikey.APIKey, error) {
|
|
return s.ExpectedAPIKey, s.ExpectedError
|
|
}
|
|
func (s *Service) AddAPIKey(ctx context.Context, cmd *apikey.AddCommand) (*apikey.APIKey, error) {
|
|
return s.ExpectedAPIKey, s.ExpectedError
|
|
}
|
|
func (s *Service) UpdateAPIKeyLastUsedDate(ctx context.Context, tokenID int64) error {
|
|
return s.ExpectedError
|
|
}
|