-
Notifications
You must be signed in to change notification settings - Fork 780
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
feat: Add data residency for eu and global regions #1390
Conversation
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.
LGTM
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.
CR
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.
LGTM!
|
||
## Limitations | ||
|
||
1. Setting the API Key (via `client.setApiKey()`) or Twilio Authentication (via `client.setTwilioEmailAuth()`) will override the hostname to default value. Use the setter call after this set-up. |
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.
is this something we should figure out a better path for? This is not an ideal scenario.
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.
@tbischel @gladysmae08
Hi, I hope my PR offers a solution to this issue. Please take a look and I would appreciate any feedback.
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.
I think this limitation is no longer necessary after the changes that were just added
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.
this won't introduce breaking changes for existing customers, right?
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.
if customers don't have to change their code to achieve the same functionality, I think I'm good. if they do, we might want to look into a major version bump?
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.
This wont introduce a breaking change, as the region
attribute that's newly introduced has a default value, and will only get updated if the setter for data residency is called.
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.
I think we need to resolve this usability gap on the setApiKey and setDataResidency before we release.
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.
CR
// this means that region was never set before | ||
if (this.sendgrid_region == '') { | ||
this.setDefaultRequest('baseUrl', SENDGRID_BASE_URL); | ||
} |
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.
This technically works but I think it is unnecessary. We can just always reset the baseUrl
here based on the saved region
this.setDefaultRequest('baseUrl', REGION_HOST_MAP[this.sendgrid_region]);
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.
Yup, I have set the default region as 'global', we can reset based on that now. Thanks.
|
||
## Limitations | ||
|
||
1. Setting the API Key (via `client.setApiKey()`) or Twilio Authentication (via `client.setTwilioEmailAuth()`) will override the hostname to default value. Use the setter call after this set-up. |
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.
I think this limitation is no longer necessary after the changes that were just added
Hi, would it be possible to open a separate PR for the version upgrades? A number of people are awaiting #1387 in order to complete their security upgrades. |
We have resolved the discrepancy in the latest commits. The limitation no longer exists. |
319754e
to
8bfe5cd
Compare
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.
LGTM
Fixes DII-1230
This PR:
setDataResidency()
which allows the users to switch to EU sub region, reidrecting their requests toapi.eu.sendgrid.com
Checklist
If you have questions, please file a support ticket.