From a6c1fb4d8dc08e6b153a5849553fd82a56ff0c20 Mon Sep 17 00:00:00 2001 From: Mitchell R Date: Thu, 14 May 2026 07:40:22 +0200 Subject: [PATCH] feat(server): rate limit (login + pair) + CSP/security headers --- .../service-admin-http/html-response.ts | 30 ++++++++-- .../plugins/service-admin-http/routes-auth.ts | 19 +++++++ server/src/plugins/service-api-http/index.ts | 20 +++++++ server/src/shared/rate-limit.ts | 57 +++++++++++++++++++ 4 files changed, 120 insertions(+), 6 deletions(-) create mode 100644 server/src/shared/rate-limit.ts diff --git a/server/src/plugins/service-admin-http/html-response.ts b/server/src/plugins/service-admin-http/html-response.ts index 2be3b39..6cc4d0f 100644 --- a/server/src/plugins/service-admin-http/html-response.ts +++ b/server/src/plugins/service-admin-http/html-response.ts @@ -5,17 +5,35 @@ * a string/object directly. This helper wraps JSX output in a * proper Response with text/html content type. */ +/** + * Baseline security headers. CSP keeps 'unsafe-inline' for scripts because + * jsx-htmx's js() helper emits inline