api: add instrospect endpoint

Fixes #1091
This commit is contained in:
Xavier Stouder
2025-07-01 23:14:09 +02:00
parent f04af18193
commit 7bbb3ff9cf
6 changed files with 228 additions and 0 deletions
+82
View File
@@ -869,6 +869,40 @@
}
}
},
"/v2/IntrospectAdminToken": {
"get": {
"tags": [
"Admin API token"
],
"description": "\nReturn information about the calling admin API token.\n ",
"operationId": "IntrospectAdminToken",
"parameters": [
{
"name": "admin_token",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Information about the admin token",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/IntrospectAdminTokenResponse"
}
}
}
},
"500": {
"description": "Internal server error"
}
}
}
},
"/v2/GetNodeInfo": {
"get": {
"tags": [
@@ -2644,6 +2678,54 @@
}
}
},
"IntrospectAdminTokenResponse": {
"type": "object",
"required": [
"name",
"expired",
"scope"
],
"properties": {
"created": {
"type": [
"string",
"null"
],
"format": "date-time",
"description": "Creation date"
},
"expiration": {
"type": [
"string",
"null"
],
"format": "date-time",
"description": "Expiration time and date, formatted according to RFC 3339"
},
"expired": {
"type": "boolean",
"description": "Whether this admin token is expired already"
},
"id": {
"type": [
"string",
"null"
],
"description": "Identifier of the admin token (which is also a prefix of the full bearer token)"
},
"name": {
"type": "string",
"description": "Name of the admin API token"
},
"scope": {
"type": "array",
"items": {
"type": "string"
},
"description": "Scope of the admin API token, a list of admin endpoint names (such as\n`GetClusterStatus`, etc), or the special value `*` to allow all\nadmin endpoints"
}
}
},
"ImportKeyRequest": {
"type": "object",
"required": [