Improve audit logging, error handling, and metadata encoding

- Ensure all email/SMS send attempts are audit-logged, including API errors, exceptions, invalid addresses, and disabled service cases; logs now include raw API responses or exception details for better diagnostics.
- Fix audit log parameter builder to never pass NULL for NOT NULL columns (`config`, `DateSent`).
- Add unit tests covering all send paths and audit log correctness.
- Percent-encode non-ASCII/control chars in `DocumentMetadataBuilder` for safe HTTP header metadata; add tests.
- Simplify admin test mail dialog JS and improve success handler robustness.
- Set `charset=utf-8` in admin controller JSON responses for OCORE consistency.
- Update minified JS to match new admin dialog logic.
This commit is contained in:
Stefan
2026-07-16 16:03:58 +02:00
parent 8a0ebeeb1e
commit c812d94d99
9 changed files with 238 additions and 47 deletions
@@ -85,8 +85,10 @@ public partial class IntranetController
ContractResolver = new CamelCasePropertyNamesContractResolver(),
};
// Mirror OCORE's getJSONResult exactly (application/json; charset=utf-8) so the response
// parses identically to every other endpoint the frontend's postXT talks to.
private ContentResult AdminJson(object payload) =>
Content(JsonConvert.SerializeObject(payload, CamelCaseJson), "application/json");
Content(JsonConvert.SerializeObject(payload, CamelCaseJson), "application/json; charset=utf-8");
/// <summary>
/// Resolves the calling user's <c>fds_sys</c> module authorization level via the