mirror of
https://github.com/floci-io/floci.git
synced 2026-11-23 06:00:46 -05:00
Implements PUT /v2/email/account/suppression so callers can change the account-level suppression list reasons (BOUNCE / COMPLAINT). Entries are persisted per region in ses-account-suppression.json via a new AccountSuppressionAttributes model. GetAccount's response is extended with a SuppressionAttributes object that carries the stored SuppressedReasons. The setting itself is metadata-only — floci does not synthesise bounce/complaint events so no auto-suppression is triggered; the configuration round-trips for SDK users and tooling that introspects account-level settings. Behaviour aligned with real-AWS verification: - SuppressedReasons accepts BOUNCE / COMPLAINT, validated against the AWS-canonical nested "Member must satisfy constraint: [Member must satisfy enum value set: [BOUNCE, COMPLAINT]]" wording (verbatim match against real AWS). - SuppressedReasons may be omitted (treated as empty list) or supplied as an empty array (clears the reasons) — both return 200. - Non-textual array members (JSON null, numeric, etc.) are rejected with BadRequestException. - Fresh regions report the AWS-default [BOUNCE, COMPLAINT] via GetAccount; an explicit PUT (including an empty list) overrides it. - The optional ValidationAttributes body field is accepted but not parsed (Tier S scope). Tests: - SesV2IntegrationTest gains nine cases covering store-and-list, clear-with-empty-array, missing field defaulting to empty, invalid Reason (with the AWS-canonical nested message asserted), non-array SuppressedReasons, JSON null array member, numeric array member, optional ValidationAttributes, and the default-on-fresh-region assertion in the existing getAccount case. - SesAccountSuppressionTest exercises the Java SDK round trip and an explicit empty list through SesV2Client; @BeforeAll captures the caller's existing SuppressedReasons and @AfterAll restores it with failures surfaced so a real-AWS run cannot silently leave the account with auto-suppression disabled.