This commit is contained in:
Mateusz Gruszczyński committed 2026-10-12 14:57:37 +02:00
1 parent 180a0e4877
commit d23fa5e154
39 files changed
+1521 -376

No files matched your search

+283 -1
View File
@@ -2,7 +2,7 @@
"openapi": "3.0.3",
"info": {
"title": "RustProxy Administration API",
"version": "0.31.8",
"version": "0.31.9",
"description": "Administration API for the active panel origin. Sign in through the panel; the same-origin HttpOnly cookie authenticates all private operations. Mutations also require the exact Origin, X-RustProxy-Request: 1 and a session-bound X-CSRF-Token. Loopback HTTP is the default; Settings can enable HTTPS before using a non-loopback administration bind. This document contains no live configuration or credentials. Object schemas marked extensible are summaries: full configuration validation is authoritative in Rust."
},
"servers": [
@@ -6057,6 +6057,65 @@
"description": "First matching UA overrides the base and country rate; separate vhost/rule/IP fixed-window counters. Default empty."
}
}
},
"CertificateApiEdit": {
"type": "object",
"additionalProperties": false,
"description": "Non-secret settings only: changes do not rotate or reveal the bearer token. Key ID cannot be changed.",
"properties": {
"comment": {
"type": "string",
"maxLength": 256
},
"certificate_ids": {
"type": "array",
"minItems": 1,
"maxItems": 32,
"items": {
"type": "string"
},
"description": "Explicit ID allowlist; * is forbidden when editing legacy credentials."
},
"allow_deploy": {
"type": "boolean",
"description": "Allow deploy in addition to targeted reload."
}
},
"required": [
"comment",
"certificate_ids",
"allow_deploy"
]
},
"CertificateApiDetailResult": {
"type": "object",
"additionalProperties": false,
"properties": {
"credential": {
"$ref": "#/components/schemas/CertificateApiCredential"
}
},
"required": [
"credential"
]
},
"CertificateApiRegenerateResult": {
"type": "object",
"additionalProperties": false,
"properties": {
"credential": {
"$ref": "#/components/schemas/CertificateApiCredential"
},
"token": {
"type": "string",
"readOnly": true,
"description": "New bearer token returned only by the successful regeneration response. Never returned by GET/PATCH."
}
},
"required": [
"credential",
"token"
]
}
}
},
@@ -10357,6 +10416,159 @@
}
}
}
},
"get": {
"summary": "View one certificate API credential without revealing its token",
"tags": [
"Certificates"
],
"operationId": "get_api_certificate_api_key_id",
"parameters": [
{
"name": "key_id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"minLength": 3,
"maxLength": 64
}
}
],
"security": [
{
"AdminSession": []
}
],
"responses": {
"200": {
"description": "Non-secret Key ID, comment, creation/rotation time, usage time, allowlisted certificate IDs and deploy grant",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CertificateApiDetailResult"
}
}
}
},
"401": {
"description": "Authentication, validation or access error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "Authentication, validation or access error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
},
"patch": {
"summary": "Edit one credential’s comment and permissions without rotating the token",
"tags": [
"Certificates"
],
"operationId": "patch_api_certificate_api_key_id",
"parameters": [
{
"name": "key_id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"minLength": 3,
"maxLength": 64
}
}
],
"security": [
{
"AdminSession": [],
"CsrfToken": []
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CertificateApiEdit"
}
}
}
},
"responses": {
"200": {
"description": "Updated non-secret settings. The current token and its last-used/created time are unchanged.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CertificateApiDetailResult"
}
}
}
},
"400": {
"description": "Authentication, validation or access error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "Authentication, validation or access error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"403": {
"description": "Authentication, validation or access error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "Authentication, validation or access error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"422": {
"description": "Authentication, validation or access error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
}
},
"/api/certificates/{certificate_id}/reload": {
@@ -11133,6 +11345,76 @@
}
}
}
},
"/api/certificate-api/{key_id}/regenerate": {
"post": {
"summary": "Regenerate an existing bearer token, preserving its settings and Key ID",
"description": "Immediately invalidates the previous token. Returns the new token exactly once; subsequent GET/PATCH and list responses never reveal either token. No settings fields are accepted.",
"tags": [
"Certificates"
],
"operationId": "post_api_certificate_api_key_id_regenerate",
"parameters": [
{
"name": "key_id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"minLength": 3,
"maxLength": 64
}
}
],
"security": [
{
"AdminSession": [],
"CsrfToken": []
}
],
"responses": {
"200": {
"description": "Generated token, revealed only in this response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CertificateApiRegenerateResult"
}
}
}
},
"401": {
"description": "Authentication, validation or access error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"403": {
"description": "Authentication, validation or access error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "Authentication, validation or access error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
}
}
}
}