mirror of
https://github.com/grafana/grafana.git
synced 2025-02-12 00:25:46 -06:00
* Move ApiKeyDTO to dtos package * Add access control filter to api keys * pass user in GetApiKeysQuery * Add api key metadata to DTO * Remove scope all requirement from get api keys endpoint * Handle api key access control metadata in frondend
23 lines
563 B
Go
23 lines
563 B
Go
package dtos
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/grafana/grafana/pkg/models"
|
|
"github.com/grafana/grafana/pkg/services/accesscontrol"
|
|
)
|
|
|
|
type NewApiKeyResult struct {
|
|
ID int64 `json:"id"`
|
|
Name string `json:"name"`
|
|
Key string `json:"key"`
|
|
}
|
|
|
|
type ApiKeyDTO struct {
|
|
Id int64 `json:"id"`
|
|
Name string `json:"name"`
|
|
Role models.RoleType `json:"role"`
|
|
Expiration *time.Time `json:"expiration,omitempty"`
|
|
AccessControl accesscontrol.Metadata `json:"accessControl,omitempty"`
|
|
}
|