API: Add service account routes to the swagger (#52398)

* API: Add service account routes to the swagger
This commit is contained in:
Sofia Papagiannaki
2022-07-19 12:52:51 +03:00
committed by GitHub
parent a0f96ed4e1
commit e6b9ded949
9 changed files with 1772 additions and 69 deletions
+15 -7
View File
@@ -20,14 +20,22 @@ const (
ServiceID = "sa"
)
// swagger:model
type TokenDTO struct {
Id int64 `json:"id"`
Name string `json:"name"`
Created *time.Time `json:"created"`
LastUsedAt *time.Time `json:"lastUsedAt"`
Expiration *time.Time `json:"expiration"`
SecondsUntilExpiration *float64 `json:"secondsUntilExpiration"`
HasExpired bool `json:"hasExpired"`
// example: 1
Id int64 `json:"id"`
// example: grafana
Name string `json:"name"`
// example: 2022-03-23T10:31:02Z
Created *time.Time `json:"created"`
// example: 2022-03-23T10:31:02Z
LastUsedAt *time.Time `json:"lastUsedAt"`
// example: 2022-03-23T10:31:02Z
Expiration *time.Time `json:"expiration"`
// example: 0
SecondsUntilExpiration *float64 `json:"secondsUntilExpiration"`
// example: false
HasExpired bool `json:"hasExpired"`
}
func hasExpired(expiration *int64) bool {