Skip to content

fix(parser): accept Transfer Family events without password and with IPv6 source IP - #5880

Merged
dreamorosi merged 2 commits into
aws-powertools:mainfrom
hidingmyname:fix/parser-transfer-family-password-ipv6-5869
Oct 31, 2026
Merged

dreamorosi merged 2 commits into
aws-powertools:mainfrom
hidingmyname:fix/parser-transfer-family-password-ipv6-5869

Conversation

@hidingmyname

Copy link
Copy Markdown
Contributor

Summary

Changes

Please provide a summary of what's being changed

Two fixes to TransferFamilySchema:

  • password is now optional. For SSH public key authentication, Transfer Family invokes the custom identity provider without a password, and the AWS example functions check !event.password for that case. Parsing such an event previously failed with a ZodError. This matches Powertools for AWS Lambda (Python), which has modeled the field as optional since feat(parser): add AWS Transfer Family model powertools-lambda-python#5906.
  • sourceIp accepts IPv6. Transfer Family has supported IPv6 endpoints since June 2025, but the field was z.ipv4(), so logins from IPv6 clients failed to parse, password logins included. It now uses z.union([z.ipv4(), z.ipv6()]), as sourceIp already does in packages/parser/src/schemas/api-gatewayv2.ts. Python uses IPvAnyAddress for this field.

TransferFamilyEvent stays inferred from the schema, so there is no separate type change. Added the two tests requested in the issue to the existing describe block in packages/parser/tests/unit/schema/transfer-family.test.ts. Both fail on main and pass with this change. npm run test:unit:coverage and npm run test:unit:types in packages/parser pass, with 100% coverage kept.

Issue number: closes #5869


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

@dreamorosi dreamorosi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you for this PR as well!

@dreamorosi
dreamorosi enabled auto-merge (squash) October 31, 2026 15:39
@dreamorosi
dreamorosi merged commit f7bef4f into aws-powertools:main Oct 31, 2026
41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/S PR between 10-29 LOC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: TransferFamilySchema rejects events without password (SSH public key authentication)

2 participants