Skip to content

feat(cognito): add MfaSecondFactor support to CognitoUserPoolConstruct#64

Merged
ncipollina merged 1 commit intomainfrom
feat/cognito-mfa-second-factor
Apr 4, 2026
Merged

feat(cognito): add MfaSecondFactor support to CognitoUserPoolConstruct#64
ncipollina merged 1 commit intomainfrom
feat/cognito-mfa-second-factor

Conversation

@ncipollina
Copy link
Copy Markdown
Contributor

Summary

Adds MfaSecondFactor as an optional property on ICognitoUserPoolConstructProps and CognitoUserPoolConstructProps. When set, it is passed directly to the CDK UserPoolProps, allowing callers to enable TOTP (Otp = true) or SMS (Sms = true) as a second authentication factor alongside the existing Mfa setting. Bumps the package version to 2.3.0.

Changes

  • CognitoUserPoolConstructProps — added nullable MfaSecondFactor? MfaSecondFactor to both the interface and the concrete record (defaults to null, fully backward compatible)
  • CognitoUserPoolConstruct — wires props.MfaSecondFactor through to UserPoolProps.MfaSecondFactor
  • Directory.Build.props — version bumped from 2.2.0 to 2.3.0

Validation

  • Existing tests pass without modification — the new property is nullable and existing test builders do not set it
  • Manually verified via local package consumption in the cipollina-infrastructure stack with Mfa = Mfa.REQUIRED and MfaSecondFactor = new MfaSecondFactor { Otp = true, Sms = false }

Notes for Reviewers

Adding a property to the ICognitoUserPoolConstructProps interface is technically a breaking change for external implementors, though in practice all consumers use the concrete CognitoUserPoolConstructProps record. Treated as a minor bump accordingly.

🤖 Generated with Claude Code

Adds MfaSecondFactor property to ICognitoUserPoolConstructProps and
CognitoUserPoolConstructProps, wired through to UserPoolProps, enabling
callers to configure TOTP or SMS as a second factor when Mfa is OPTIONAL
or REQUIRED. Bumps version to 2.3.0.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@ncipollina ncipollina merged commit 10e44ab into main Apr 4, 2026
1 check passed
@ncipollina ncipollina deleted the feat/cognito-mfa-second-factor branch April 4, 2026 02:32
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 25292a01ef

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

<Project>
<PropertyGroup>
<VersionPrefix>2.2.0</VersionPrefix>
<VersionPrefix>2.3.0</VersionPrefix>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Bump major version for public interface change

This release is tagged as 2.3.0, but the same commit adds MfaSecondFactor to the public ICognitoUserPoolConstructProps interface, which is a source-breaking API change for any downstream code that implements that interface. Consumers that auto-accept minor updates can hit compile failures after upgrading, so this should be shipped as a major version bump (or the interface change avoided) to preserve semantic-version expectations.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant