From b4a283e301ec92a33a0162bc6773d69b32ce4365 Mon Sep 17 00:00:00 2001 From: Brian Taylor <82356519+bsaurusrex@users.noreply.github.com> Date: Wed, 2 Sep 2026 16:20:35 +0000 Subject: [PATCH] revert: "chore(cognito): drop the em-dashes this branch introduced" This reverts commit d7a0ad10. The rule it cited does not exist: AGENTS.md says nothing about em-dashes, and the repo uses them throughout, including in CONTRIBUTING.md's own commit-type table and in the pull request template. I asserted a house style that is not the house style, so the prose goes back to how it read when you reviewed it. Nothing in this PR's behaviour was affected either way. The @Order fix in 63086a30 is unrelated and stands. --- docs/services/cognito.md | 2 +- .../hectorvent/floci/services/cognito/CognitoJsonHandler.java | 2 +- .../hectorvent/floci/services/cognito/CognitoService.java | 4 ++-- .../cognito/CognitoSetUserPoolMfaConfigIntegrationTest.java | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/services/cognito.md b/docs/services/cognito.md index b897c51c2c..0f153eec7b 100644 --- a/docs/services/cognito.md +++ b/docs/services/cognito.md @@ -29,7 +29,7 @@ Standalone `TagResource` rejects reserved `floci:*` keys. `ListTagsForResource` | UpdateUserPool | Updates mutable user pool settings and persisted user-pool tags. | | DeleteUserPool | Deletes a local user pool and its related state. | | GetUserPoolMfaConfig | Returns the pool's MFA mode and, once configured, its software-token setting. | -| SetUserPoolMfaConfig | Sets `MfaConfiguration` (`OFF`/`ON`/`OPTIONAL`) and `SoftwareTokenMfaConfiguration`. An absent `MfaConfiguration` means `OFF`, and turning MFA off drops the factor configuration with it. Validation follows the live service: `OFF` alongside a software-token, email or SMS factor is rejected, and `ON`/`OPTIONAL` with none of those three is rejected, in both cases on the member being present, not on its `Enabled` value. `WebAuthnConfiguration` sits outside both rules, as it does in AWS. SMS, email and WebAuthn configurations are validated and not stored: Floci cannot deliver those factors, so keeping the config would imply a capability it does not have. | +| SetUserPoolMfaConfig | Sets `MfaConfiguration` (`OFF`/`ON`/`OPTIONAL`) and `SoftwareTokenMfaConfiguration`. An absent `MfaConfiguration` means `OFF`, and turning MFA off drops the factor configuration with it. Validation follows the live service: `OFF` alongside a software-token, email or SMS factor is rejected, and `ON`/`OPTIONAL` with none of those three is rejected — in both cases on the member being present, not on its `Enabled` value. `WebAuthnConfiguration` sits outside both rules, as it does in AWS. SMS, email and WebAuthn configurations are validated and not stored — Floci cannot deliver those factors, so keeping the config would imply a capability it does not have. | ### User Pool Tags diff --git a/src/main/java/io/github/hectorvent/floci/services/cognito/CognitoJsonHandler.java b/src/main/java/io/github/hectorvent/floci/services/cognito/CognitoJsonHandler.java index b2bba6ffbe..4badab6f80 100644 --- a/src/main/java/io/github/hectorvent/floci/services/cognito/CognitoJsonHandler.java +++ b/src/main/java/io/github/hectorvent/floci/services/cognito/CognitoJsonHandler.java @@ -197,7 +197,7 @@ public class CognitoJsonHandler { /** * Shared by Get and Set, which answer with the same members. SoftwareTokenMfaConfiguration - * is omitted while unset, matching the live service, which returns only the factors that + * is omitted while unset, matching the live service — it returns only the factors that * have been configured. */ private ObjectNode buildMfaConfigResponse(UserPool pool) { diff --git a/src/main/java/io/github/hectorvent/floci/services/cognito/CognitoService.java b/src/main/java/io/github/hectorvent/floci/services/cognito/CognitoService.java index 090b28ce1c..ced7bbf670 100644 --- a/src/main/java/io/github/hectorvent/floci/services/cognito/CognitoService.java +++ b/src/main/java/io/github/hectorvent/floci/services/cognito/CognitoService.java @@ -353,7 +353,7 @@ public class CognitoService implements ResourceProvider { } // Presence, not value: the live service rejects OFF alongside // SoftwareTokenMfaConfiguration{Enabled:false} just as it does Enabled:true, and - // conversely accepts ON alongside Enabled:false, so the member being there is what + // conversely accepts ON alongside Enabled:false — so the member being there is what // counts, despite the "must be enabled" wording of the second message. boolean anyFactorConfigured = softwareTokenMfaEnabled != null || otherFactorConfigured; if ("OFF".equals(mode) && anyFactorConfigured) { @@ -368,7 +368,7 @@ public class CognitoService implements ResourceProvider { } pool.setMfaConfiguration(mode); if ("OFF".equals(mode)) { - // Turning MFA off drops the factor configuration with it: the live service + // Turning MFA off drops the factor configuration with it — the live service // answers OFF alone afterwards, with no SoftwareTokenMfaConfiguration member. pool.setSoftwareTokenMfaEnabled(null); } else if (softwareTokenMfaEnabled != null) { diff --git a/src/test/java/io/github/hectorvent/floci/services/cognito/CognitoSetUserPoolMfaConfigIntegrationTest.java b/src/test/java/io/github/hectorvent/floci/services/cognito/CognitoSetUserPoolMfaConfigIntegrationTest.java index 39deb886d2..ef5ec214b9 100644 --- a/src/test/java/io/github/hectorvent/floci/services/cognito/CognitoSetUserPoolMfaConfigIntegrationTest.java +++ b/src/test/java/io/github/hectorvent/floci/services/cognito/CognitoSetUserPoolMfaConfigIntegrationTest.java @@ -18,7 +18,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; * SetUserPoolMfaConfig, and the round trip through GetUserPoolMfaConfig. * *

The response shape was measured against the live service, which returns only the - * factors that have been configured: a pool with software-token MFA answers + * factors that have been configured — a pool with software-token MFA answers * {@code {"SoftwareTokenMfaConfiguration":{"Enabled":true},"MfaConfiguration":"OPTIONAL"}} * and omits the SMS, email and WebAuthn members entirely. */ @@ -174,7 +174,7 @@ class CognitoSetUserPoolMfaConfigIntegrationTest { @Order(10) void webAuthnIsOutsideTheFactorRulesInBothDirections() throws Exception { // Measured: WebAuthnConfiguration is accepted alongside OFF, where every other - // factor is rejected, and it does not satisfy the "must be enabled" rule either: + // factor is rejected, and it does not satisfy the "must be enabled" rule either — // OPTIONAL with WebAuthn alone is refused. JsonNode off = cognitoJson("SetUserPoolMfaConfig", """ {"UserPoolId":"%s","MfaConfiguration":"OFF",