ServiceAccount: Update service account api resource and add service account token (#92972)

* Create own legacy store function to list service accounts and update api model

* Add service account tokens as a sub resource for service accounts
This commit is contained in:
Karl Persson
2024-09-05 13:43:54 +02:00
committed by GitHub
parent 47cd8288cd
commit 2bfa607ad0
32 changed files with 688 additions and 184 deletions
@@ -14,7 +14,7 @@ import (
)
type FakeServiceAccountStore struct {
ExpectedServiceAccountID *serviceaccounts.ServiceAccount
ExpectedServiceAccountID int64
ExpectedServiceAccountDTO *serviceaccounts.ServiceAccountDTO
ExpectedServiceAccountProfileDTO *serviceaccounts.ServiceAccountProfileDTO
ExpectedSearchServiceAccountQueryResult *serviceaccounts.SearchOrgServiceAccountsResult
@@ -39,7 +39,7 @@ func (f *FakeServiceAccountStore) RetrieveServiceAccount(ctx context.Context, or
// RetrieveServiceAccountIdByName is a fake retrieving a service account id by name.
func (f *FakeServiceAccountStore) RetrieveServiceAccountIdByName(ctx context.Context, orgID int64, name string) (int64, error) {
return f.ExpectedServiceAccountID.Id, f.ExpectedError
return f.ExpectedServiceAccountID, f.ExpectedError
}
// CreateServiceAccount is a fake creating a service account.
-4
View File
@@ -52,10 +52,6 @@ type MigrationResult struct {
FailedDetails []string `json:"failedDetails"`
}
type ServiceAccount struct {
Id int64
}
// swagger:model
type CreateServiceAccountForm struct {
// example: grafana