Schema: Covering service accounts Core Kind (#62091)

* Adding service accounts schema

Co-authored-by: Eric Leijonmarck <eric.leijonmarck@gmail.com>

* Change metadata field

Co-authored-by: Eric Leijonmarck <eric.leijonmarck@gmail.com>

* Merging the two DTOs into one schema

Co-authored-by: Eric Leijonmarck <eric.leijonmarck@gmail.com>

* Eric dedup things

Co-authored-by: Eric Leijonmarck <eric.leijonmarck@gmail.com>

* Add optional to teams/created/updated

Co-authored-by: Eric Leijonmarck <eric.leijonmarck@gmail.com>

* Lower case the OrgId

Co-authored-by: Eric Leijonmarck <eric.leijonmarck@gmail.com>

Co-authored-by: Eric Leijonmarck <eric.leijonmarck@gmail.com>
This commit is contained in:
Gabriel MABILLE
2023-01-25 18:07:00 +01:00
committed by GitHub
parent 3c073b00ec
commit f99523048a
9 changed files with 377 additions and 17 deletions

View File

@@ -0,0 +1,46 @@
package kind
name: "Serviceaccount"
maturity: "merged"
lineage: seqs: [
{
schemas: [
// v0.0
{
// ID is the unique identifier of the service account in the database.
id: int64 @grafanamaturity(ToMetadata="sys")
// OrgId is the ID of an organisation the service account belongs to.
orgId: int64 @grafanamaturity(ToMetadata="sys")
// Name of the service account.
name: string
// Login of the service account.
login: string
// IsDisabled indicates if the service account is disabled.
isDisabled: bool
// Role is the Grafana organization role of the service account which can be 'Viewer', 'Editor', 'Admin'.
role: #OrgRole @grafanamaturity(ToMetadata="kind")
// Tokens is the number of active tokens for the service account.
// Tokens are used to authenticate the service account against Grafana.
tokens: int64 @grafanamaturity(ToMetadata="kind")
// AvatarUrl is the service account's avatar URL. It allows the frontend to display a picture in front
// of the service account.
avatarUrl: string @grafanamaturity(ToMetadata="kind")
// AccessControl metadata associated with a given resource.
accessControl?: {
[string]: bool @grafanamaturity(ToMetadata="sys")
}
// Teams is a list of teams the service account belongs to.
teams?: [...string] @grafanamaturity(ToMetadata="sys")
// Created indicates when the service account was created.
created?: int64 @grafanamaturity(ToMetadata="sys")
// Updated indicates when the service account was updated.
updated?: int64 @grafanamaturity(ToMetadata="sys")
// OrgRole is a Grafana Organization Role which can be 'Viewer', 'Editor', 'Admin'.
#OrgRole: "Admin" | "Editor" | "Viewer" @cuetsy(kind="type")
},
]
},
]