Clarify Service Contracts And Security Invariants

This commit is contained in:
2026-09-21 13:39:30 +02:00
parent 6406142b21
commit 655f26a611
58 changed files with 272 additions and 25 deletions
+5 -1
View File
@@ -12,7 +12,11 @@ typedef struct {
} web_cookie_auth_snapshot_t;
void web_cookie_auth_get_snapshot(web_cookie_auth_snapshot_t *snapshot);
void web_cookie_auth_clear_counters(void);
/* Sends an error on denial, with allowed=false. View is caller-wiped. */
/* HTTPD handler context, before body reads/responses; all pointers required.
* Admission requires ESP_OK AND allowed=true: a sent denial can return ESP_OK.
* mutation selects POST plus CSRF; otherwise GET. mutation/upgrade require Origin.
* This variant rejects bodies. Role checks remain with the caller; a successful
* view is not a lease for later actions. Wipe the view after use, even on denial. */
esp_err_t web_cookie_auth_require(httpd_req_t *request, bool mutation,
bool upgrade, web_session_view_t *view,
bool *allowed);