sendgrid / sendgrid-python

The Official Twilio SendGrid Python API Library
https://sendgrid.com
MIT License
1.53k stars 712 forks source link

feat: geolocation setter in sendgrid-python for GDPR compliance #1073

Closed manisha1997 closed 9 months ago

manisha1997 commented 10 months ago

feat!: Geolocation setter for GDPR compliance

Checklist

If you have questions, please file a support ticket.

manisha1997 commented 10 months ago

@tbischel, What will be the precedence of the host and data_residency. In case, the user uses both set_host and set_data_residency, we are setting host based on the latest input. https://github.com/sendgrid/sendgrid-python/blob/639f14e107ef9f0341dc6d5b9364ee53925189ec/test/unit/test_sendgrid.py#L19, https://github.com/sendgrid/sendgrid-python/blob/639f14e107ef9f0341dc6d5b9364ee53925189ec/test/unit/test_sendgrid.py#L25

Can you please clarify if this is correct precedence?

tbischel commented 9 months ago

regarding precedence: I think if they explicitly call the setters, it makes sense to respect the latest called. I think if they pass region and host in the constructor at the same time, we should throw an error if they conflict.

manisha1997 commented 9 months ago

Makes sense Tyler, thanks. Will introduce the changes accordingly.

manisha1997 commented 9 months ago

@tbischel, we decided to remove region and only have a data residency setter. We removed the set_host as we don't want to expose the function right now https://github.com/sendgrid/sendgrid-python/pull/1073#discussion_r1400912117. Can you please review the changes

tbischel commented 9 months ago

minor nit with the print placement, but other than that LGTM

tiwarishubham635 commented 9 months ago

LGTM!