diff --git a/docs/services/cognito.md b/docs/services/cognito.md index 0f153eec7b..b897c51c2c 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 4badab6f80..b2bba6ffbe 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 — it returns only the factors that + * is omitted while unset, matching the live service, which 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 ced7bbf670..090b28ce1c 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 ef5ec214b9..39deb886d2 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",