mirror of
https://github.com/grafana/grafana.git
synced 2026-09-05 04:40:13 -05:00
Access control: Pass access control metadata for api keys (#48445)
* 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
This commit is contained in:
+1
-10
@@ -47,6 +47,7 @@ type DeleteApiKeyCommand struct {
|
||||
type GetApiKeysQuery struct {
|
||||
OrgId int64
|
||||
IncludeExpired bool
|
||||
User *SignedInUser
|
||||
Result []*ApiKey
|
||||
}
|
||||
|
||||
@@ -60,13 +61,3 @@ type GetApiKeyByIdQuery struct {
|
||||
ApiKeyId int64
|
||||
Result *ApiKey
|
||||
}
|
||||
|
||||
// ------------------------
|
||||
// DTO & Projections
|
||||
|
||||
type ApiKeyDTO struct {
|
||||
Id int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Role RoleType `json:"role"`
|
||||
Expiration *time.Time `json:"expiration,omitempty"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user