-
-
Notifications
You must be signed in to change notification settings - Fork 663
feat(core,connector): add ip to passwordless message payload #8060
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
COMPARE TO
|
| Name | Diff |
|---|---|
| .changeset/warm-lizards-swim.md | 📈 +438 Bytes |
| packages/connectors/connector-http-email/src/index.test.ts | 📈 +1.38 KB |
| packages/connectors/connector-http-email/src/index.ts | 📈 +33 Bytes |
| packages/connectors/connector-http-sms/src/index.test.ts | 📈 +1.37 KB |
| packages/connectors/connector-http-sms/src/index.ts | 📈 +33 Bytes |
| packages/core/src/libraries/organization-invitation.ts | 📈 +121 Bytes |
| packages/core/src/libraries/passcode.test.ts | 📈 +1011 Bytes |
| packages/core/src/libraries/passcode.ts | 📈 +183 Bytes |
| packages/core/src/routes-me/verification-code.ts | 📈 +28 Bytes |
| packages/core/src/routes/connector/config-testing.test.ts | 📈 +68 Bytes |
| packages/core/src/routes/connector/config-testing.ts | 📈 +30 Bytes |
| packages/core/src/routes/interaction/additional.ts | 📈 +30 Bytes |
| packages/core/src/routes/interaction/utils/verification-code-validation.ts | 📈 +97 Bytes |
| packages/core/src/routes/organization-invitation/index.ts | 📈 +70 Bytes |
| packages/core/src/routes/verification-code.ts | 📈 +24 Bytes |
| packages/toolkit/connector-kit/src/types/passwordless.ts | 📈 +243 Bytes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds client IP address support to the passwordless connector message payload to enable rate limiting, fraud detection, and logging capabilities for HTTP email/SMS connectors.
Key Changes:
- Added optional
ipfield toSendMessageDatatype with proper documentation - Updated all verification code and organization invitation flows to propagate client IP
- Added comprehensive test coverage for IP propagation in both libraries and connectors
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/toolkit/connector-kit/src/types/passwordless.ts | Adds optional ip field to SendMessageData type and its Zod validator with TSDoc |
| packages/core/src/routes/verification-code.ts | Passes ctx.request.ip to sendPasscode for management API verification codes |
| packages/core/src/routes/organization-invitation/index.ts | Propagates IP to organization invitation insert and sendEmail methods |
| packages/core/src/routes/interaction/utils/verification-code-validation.ts | Updates verification code validation to accept and pass IP to sendPasscode |
| packages/core/src/routes/interaction/additional.ts | Extracts and passes client IP from request context to verification code sender |
| packages/core/src/routes/connector/config-testing.ts | Includes IP in connector configuration test messages |
| packages/core/src/routes-me/verification-code.ts | Passes IP to sendPasscode for authenticated user verification codes |
| packages/core/src/libraries/passcode.ts | Extracts IP from context payload and conditionally includes it in sendMessage call |
| packages/core/src/libraries/passcode.test.ts | Adds test cases verifying IP is correctly included when provided and omitted when not |
| packages/core/src/libraries/organization-invitation.ts | Updates insert and sendEmail methods to accept and propagate IP parameter |
| packages/connectors/connector-http-sms/src/index.ts | Extracts IP from message data and conditionally includes it in HTTP request payload |
| packages/connectors/connector-http-sms/src/index.test.ts | Tests IP inclusion in requests when provided and omission when not provided |
| packages/connectors/connector-http-email/src/index.ts | Extracts IP from message data and conditionally includes it in HTTP request payload |
| packages/connectors/connector-http-email/src/index.test.ts | Tests IP inclusion in requests when provided and omission when not provided |
| .changeset/warm-lizards-swim.md | Documents the feature addition for the changelog |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
842fb13 to
4ed9d71
Compare
| to, | ||
| type, | ||
| payload, | ||
| ...(ip && { ip }), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Should we put it in the message payload?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
payload contains data that are used in the template, but ip is not, so I think it is better to be in top-level.
resolved #7944
Summary
Add client IP address to passwordless connector message payload.
The
SendMessageDatatype now includes an optionalipfield that contains the client IP address of the user who triggered the message. This can be used by HTTP email/SMS connectors for rate limiting, fraud detection, or logging purposes.Testing
Local tested & integration tests.
Checklist
.changeset