This commit is contained in:
Mateusz Gruszczyński committed 2026-10-19 11:09:48 +02:00
1 parent 4afa88a65e
commit 2ab44c4c62
49 files changed
+1523 -176

No files matched your search

+505 -32
View File
@@ -2,8 +2,8 @@
"openapi": "3.0.3",
"info": {
"title": "RustProxy Administration API",
"version": "0.33.7",
"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."
"version": "0.34.1",
"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. Version 0.34.1 also permits explicitly scoped GeneralApiBearer tokens on a narrow route allowlist, with RO/RW and source CIDR checks; API-token management and Prometheus-token management are browser-session-only."
},
"servers": [
{
@@ -41,6 +41,12 @@
"in": "header",
"name": "X-RustProxy-Certificate-Key",
"description": "Non-secret Key ID paired with the scoped certificate Bearer token."
},
"GeneralApiBearer": {
"type": "http",
"scheme": "bearer",
"bearerFormat": "opaque",
"description": "Generated in Settings > API tokens; ro/rw permission, mandatory source CIDR allowlist and a narrow method/path allowlist. HTTPS required outside loopback. Not usable for token management, login, docs or backups."
}
},
"schemas": {
@@ -5417,7 +5423,10 @@
},
"sendfile": {
"type": "string",
"enum": ["off", "auto"],
"enum": [
"off",
"auto"
],
"default": "off",
"description": "Linux TCP HTTP/1.1 kernel sendfile for eligible unmodified static GET responses. Transport-only; off by default."
},
@@ -7670,7 +7679,15 @@
}
}
],
"description": "Without view, returns the historical full status including runtime and system diagnostics. view=live returns compact live-only telemetry; the browser fetches system diagnostics separately."
"description": "Without view, returns the historical full status including runtime and system diagnostics. view=live returns compact live-only telemetry; the browser fetches system diagnostics separately.",
"security": [
{
"AdminSession": []
},
{
"GeneralApiBearer": []
}
]
}
},
"/api/backends": {
@@ -7731,7 +7748,15 @@
}
}
}
}
},
"security": [
{
"AdminSession": []
},
{
"GeneralApiBearer": []
}
]
}
},
"/api/config": {
@@ -7792,7 +7817,15 @@
}
}
}
}
},
"security": [
{
"AdminSession": []
},
{
"GeneralApiBearer": []
}
]
},
"put": {
"summary": "Replace the entire configuration atomically",
@@ -7917,8 +7950,10 @@
],
"security": [
{
"AdminSession": [],
"CsrfToken": []
"AdminSession": []
},
{
"GeneralApiBearer": []
}
],
"requestBody": {
@@ -7992,7 +8027,15 @@
}
}
},
"description": "Returns active SNI bindings and covered_hosts metadata. Public certificate PEM files are inspected on a bounded blocking worker so current DNS SAN coverage is shown even for older/manual entries or in-place renewals; private keys are never read for inventory."
"description": "Returns active SNI bindings and covered_hosts metadata. Public certificate PEM files are inspected on a bounded blocking worker so current DNS SAN coverage is shown even for older/manual entries or in-place renewals; private keys are never read for inventory.",
"security": [
{
"AdminSession": []
},
{
"GeneralApiBearer": []
}
]
}
},
"/api/certificates/upload": {
@@ -8193,7 +8236,15 @@
}
}
}
}
},
"security": [
{
"AdminSession": []
},
{
"GeneralApiBearer": []
}
]
}
},
"/api/acme/issue": {
@@ -8706,6 +8757,14 @@
"default": 50
}
}
],
"security": [
{
"AdminSession": []
},
{
"GeneralApiBearer": []
}
]
}
},
@@ -8767,7 +8826,15 @@
}
}
}
}
},
"security": [
{
"AdminSession": []
},
{
"GeneralApiBearer": []
}
]
}
},
"/api/geoip/update": {
@@ -8822,8 +8889,10 @@
},
"security": [
{
"AdminSession": [],
"CsrfToken": []
"AdminSession": []
},
{
"GeneralApiBearer": []
}
]
}
@@ -8961,8 +9030,10 @@
],
"security": [
{
"AdminSession": [],
"CsrfToken": []
"AdminSession": []
},
{
"GeneralApiBearer": []
}
]
}
@@ -9084,6 +9155,14 @@
"default": 256
}
}
],
"security": [
{
"AdminSession": []
},
{
"GeneralApiBearer": []
}
]
}
},
@@ -9350,7 +9429,15 @@
}
}
},
"description": "Requires the admin session on THIS listener. The optional dedicated exporter uses independent CIDR/bearer policy; it is disabled by default."
"description": "Requires the admin session on THIS listener. The optional dedicated exporter uses independent CIDR/bearer policy; it is disabled by default.",
"security": [
{
"AdminSession": []
},
{
"GeneralApiBearer": []
}
]
}
},
"/docs/openapi.json": {
@@ -9638,6 +9725,9 @@
"security": [
{
"AdminSession": []
},
{
"GeneralApiBearer": []
}
]
}
@@ -9725,8 +9815,10 @@
],
"security": [
{
"AdminSession": [],
"CsrfToken": []
"AdminSession": []
},
{
"GeneralApiBearer": []
}
]
}
@@ -10108,8 +10200,10 @@
],
"security": [
{
"AdminSession": [],
"CsrfToken": []
"AdminSession": []
},
{
"GeneralApiBearer": []
}
],
"requestBody": {
@@ -10264,7 +10358,15 @@
}
}
}
}
},
"security": [
{
"AdminSession": []
},
{
"GeneralApiBearer": []
}
]
}
},
"/api/cache/bans/{id}": {
@@ -10433,7 +10535,15 @@
}
}
}
}
},
"security": [
{
"AdminSession": []
},
{
"GeneralApiBearer": []
}
]
}
},
"/api/tunnels/{id}/kill": {
@@ -10626,8 +10736,10 @@
},
"security": [
{
"AdminSession": [],
"CsrfToken": []
"AdminSession": []
},
{
"GeneralApiBearer": []
}
]
}
@@ -11379,7 +11491,15 @@
}
}
}
}
},
"security": [
{
"AdminSession": []
},
{
"GeneralApiBearer": []
}
]
}
},
"/api/config/history": {
@@ -11477,7 +11597,15 @@
}
}
}
}
},
"security": [
{
"AdminSession": []
},
{
"GeneralApiBearer": []
}
]
}
},
"/api/config/history/restore": {
@@ -11512,8 +11640,10 @@
],
"security": [
{
"AdminSession": [],
"CsrfToken": []
"AdminSession": []
},
{
"GeneralApiBearer": []
}
],
"requestBody": {
@@ -11708,7 +11838,15 @@
}
}
}
}
},
"security": [
{
"AdminSession": []
},
{
"GeneralApiBearer": []
}
]
}
},
"/api/file-logs/query": {
@@ -11942,7 +12080,15 @@
}
}
}
}
},
"security": [
{
"AdminSession": []
},
{
"GeneralApiBearer": []
}
]
}
},
"/api/system-info": {
@@ -11969,7 +12115,15 @@
"403": {
"description": "Invalid origin"
}
}
},
"security": [
{
"AdminSession": []
},
{
"GeneralApiBearer": []
}
]
}
},
"/api/certificate-api/{key_id}/regenerate": {
@@ -12317,6 +12471,325 @@
}
}
}
},
"/api/config/reload": {
"post": {
"tags": [
"Configuration"
],
"summary": "Import and hot-apply current authoritative JSON (or revalidate SQLite-backed config) with a revision guard",
"operationId": "reloadConfiguration",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"additionalProperties": false,
"required": [
"expected_revision"
],
"properties": {
"expected_revision": {
"type": "integer",
"format": "int64",
"minimum": 0
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successful request",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Envelope"
}
}
}
},
"401": {
"description": "Authentication required"
},
"403": {
"description": "Permission or origin restriction"
},
"422": {
"description": "Invalid input"
},
"500": {
"description": "Internal failure"
}
},
"security": [
{
"AdminSession": []
},
{
"GeneralApiBearer": []
}
]
}
},
"/api/api-tokens": {
"get": {
"tags": [
"Authentication"
],
"summary": "List general API credential metadata, never secrets",
"operationId": "listApiTokens",
"responses": {
"200": {
"description": "Successful request",
"content": {
"application/json": {
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
},
"401": {
"description": "Authentication required"
},
"403": {
"description": "Permission or origin restriction"
},
"422": {
"description": "Invalid input"
},
"500": {
"description": "Internal failure"
}
}
},
"post": {
"tags": [
"Authentication"
],
"summary": "Generate a new one-time-display general API bearer token",
"operationId": "createApiToken",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"additionalProperties": false,
"required": [
"permission",
"allowed_cidrs"
],
"properties": {
"permission": {
"type": "string",
"enum": [
"ro",
"rw"
]
},
"comment": {
"type": "string",
"maxLength": 128
},
"allowed_cidrs": {
"type": "array",
"minItems": 1,
"maxItems": 32,
"items": {
"type": "string",
"description": "IP/CIDR, /0 rejected"
}
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successful request",
"content": {
"application/json": {
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
},
"401": {
"description": "Authentication required"
},
"403": {
"description": "Permission or origin restriction"
},
"422": {
"description": "Invalid input"
},
"500": {
"description": "Internal failure"
}
}
}
},
"/api/api-tokens/{id}": {
"delete": {
"tags": [
"Authentication"
],
"summary": "Revoke a general API token immediately",
"operationId": "revokeApiToken",
"responses": {
"200": {
"description": "Successful request",
"content": {
"application/json": {
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
},
"401": {
"description": "Authentication required"
},
"403": {
"description": "Permission or origin restriction"
},
"422": {
"description": "Invalid input"
},
"500": {
"description": "Internal failure"
}
},
"parameters": [
{
"in": "path",
"name": "id",
"required": true,
"schema": {
"type": "string"
}
}
]
}
},
"/api/prometheus-token": {
"get": {
"tags": [
"Authentication"
],
"summary": "Get Prometheus credential presence, without the token",
"operationId": "getPrometheusToken",
"responses": {
"200": {
"description": "Successful request",
"content": {
"application/json": {
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
},
"401": {
"description": "Authentication required"
},
"403": {
"description": "Permission or origin restriction"
},
"422": {
"description": "Invalid input"
},
"500": {
"description": "Internal failure"
}
}
},
"post": {
"tags": [
"Authentication"
],
"summary": "Generate or rotate one-time-display Prometheus Bearer token",
"operationId": "rotatePrometheusToken",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"additionalProperties": false
}
}
}
},
"responses": {
"200": {
"description": "Successful request",
"content": {
"application/json": {
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
},
"401": {
"description": "Authentication required"
},
"403": {
"description": "Permission or origin restriction"
},
"422": {
"description": "Invalid input"
},
"500": {
"description": "Internal failure"
}
}
},
"delete": {
"tags": [
"Authentication"
],
"summary": "Revoke the currently configured Prometheus Bearer token",
"operationId": "revokePrometheusToken",
"responses": {
"200": {
"description": "Successful request",
"content": {
"application/json": {
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
},
"401": {
"description": "Authentication required"
},
"403": {
"description": "Permission or origin restriction"
},
"422": {
"description": "Invalid input"
},
"500": {
"description": "Internal failure"
}
}
}
}
}
},
"tags": []
}