mirror of
https://github.com/project-zot/zot.git
synced 2026-06-17 21:17:58 +08:00
feat(apikey): added route to list user api keys (#1708)
adding api key expiration date Signed-off-by: Petu Eusebiu <peusebiu@cisco.com>
This commit is contained in:
@@ -21,6 +21,36 @@ const docTemplate = `{
|
||||
"basePath": "{{.BasePath}}",
|
||||
"paths": {
|
||||
"/auth/apikey": {
|
||||
"get": {
|
||||
"description": "Get list of all API keys for a logged in user",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"summary": "Get list of API keys for the current user",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "ok",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "unauthorized",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "internal server error",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"post": {
|
||||
"description": "Can create an api key for a logged in user, based on the provided label and scopes.",
|
||||
"consumes": [
|
||||
@@ -1139,6 +1169,9 @@ const docTemplate = `{
|
||||
"api.APIKeyPayload": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"expirationDate": {
|
||||
"type": "string"
|
||||
},
|
||||
"label": {
|
||||
"type": "string"
|
||||
},
|
||||
|
||||
@@ -12,6 +12,36 @@
|
||||
},
|
||||
"paths": {
|
||||
"/auth/apikey": {
|
||||
"get": {
|
||||
"description": "Get list of all API keys for a logged in user",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"summary": "Get list of API keys for the current user",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "ok",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "unauthorized",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "internal server error",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"post": {
|
||||
"description": "Can create an api key for a logged in user, based on the provided label and scopes.",
|
||||
"consumes": [
|
||||
@@ -1130,6 +1160,9 @@
|
||||
"api.APIKeyPayload": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"expirationDate": {
|
||||
"type": "string"
|
||||
},
|
||||
"label": {
|
||||
"type": "string"
|
||||
},
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
definitions:
|
||||
api.APIKeyPayload:
|
||||
properties:
|
||||
expirationDate:
|
||||
type: string
|
||||
label:
|
||||
type: string
|
||||
scopes:
|
||||
@@ -270,6 +272,26 @@ paths:
|
||||
schema:
|
||||
type: string
|
||||
summary: Revokes one current user API key
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Get list of all API keys for a logged in user
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: ok
|
||||
schema:
|
||||
type: string
|
||||
"401":
|
||||
description: unauthorized
|
||||
schema:
|
||||
type: string
|
||||
"500":
|
||||
description: internal server error
|
||||
schema:
|
||||
type: string
|
||||
summary: Get list of API keys for the current user
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
|
||||
Reference in New Issue
Block a user