rest api: accept Basic Auth with the panel password for writes

Any login, password = web/settings password (or master password). 401
carries WWW-Authenticate so browsers/Postman prompt. X-Api-Key still
works for existing integrations. Docs warn that over plain HTTP the
password travels in every request.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-10 10:58:05 +00:00
co-authored by Claude Opus 5.5
parent 392095d549
commit ec84133417
3 changed files with 54 additions and 28 deletions
+1 -1
View File
@@ -559,7 +559,7 @@
</div>
<div class="card">
<h2>Ключ API</h2>
<p class="hint">Заголовок <code>X-Api-Key</code> для методов записи REST API <code>/api/v1</code>. Открытого запроса «получить ключ» нет.</p>
<p class="hint">Методы записи REST API <code>/api/v1</code> принимают Basic Auth с паролем этой панели (логин любой, например <code>admin</code>) или заголовок <code>X-Api-Key</code> с ключом ниже. Ключ безопаснее: при утечке он не даёт доступа к панели.</p>
<div class="row">
<label>Ключ
<input type="text" id="api-key" readonly value="{{ config.settings.apiKey or '' }}" autocomplete="off">