Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

252 saas connector sendgrid #883

Merged
28 commits merged into from
Jul 19, 2022
Merged

252 saas connector sendgrid #883

28 commits merged into from
Jul 19, 2022

Conversation

ghost
Copy link

@ghost ghost commented Jul 15, 2022

Purpose

Purpose of this PR is to add Sendgrid connector Contacts access and erasure endpoints/

Changes

  • Added config for Sendgrid Contact Access and Erasure Endpoints
  • Added related dataset and configuration
  • Added associated tests and fixtures to validate above functionality

Checklist

  • Update CHANGELOG.md file
    • Merge in main so the most recent CHANGELOG.md file is being appended to
    • Add description within the Unreleased section in an appropriate category. Add a new category from the list at the top of the file if the needed one isn't already there.
    • Add a link to this PR at the end of the description with the PR number as the text. example: #1
  • Applicable documentation updated (guides, quickstart, postman collections, tutorial, fidesdemo, database diagram.
  • If docs updated (select one):
    • documentation complete, or draft/outline provided (tag docs-team to complete/review on this branch)
    • documentation issue created (tag docs-team to complete issue separately)
  • Good unit test/integration test coverage
  • This PR contains a DB migration. If checked, the reviewer should confirm with the author that the down_revision correctly references the previous migration before merging
  • The Run Unsafe PR Checks label has been applied, and checks have passed, if this PR touches any external services

Ticket

Fixes #

@ghost ghost requested a review from adamsachs July 15, 2022 16:54
@adamsachs
Copy link
Contributor

just leaving a note here for some context on why we used a delete endpoint even though initially we had defined an update endpoint -- we wanted to get sendgrid removal functionality in place without requiring #458 to be completed. therefore, we just switched to delete so then we could remove the contact and implicitly remove it for the various mailing lists its a part of.

(this is based off of some discussion with @galvana)

@adamsachs
Copy link
Contributor

also noting - before merging, we need to:

  • update github secrets to include salseforce credentials
  • once that's done, add the Run Unsafe PR Checks label so that we test the external integration

)
assert erasure == {"sendgrid_connector_example:contacts": 1}

config.execution.MASKING_STRICT = False
Copy link
Contributor

Choose a reason for hiding this comment

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

what's the purpose of this? perhaps what you intend to do is reset the MASKING_STRICT var back to whatever its value was before it's explicitly set it to False in line 127 above? you'd then need to temporarily store the previous value in a local variable before you set it in line 127.

{"email": sendgrid_erasure_identity_email},
get_cached_data_for_erasures(privacy_request.id),
)
assert erasure == {"sendgrid_connector_example:contacts": 1}
Copy link
Contributor

Choose a reason for hiding this comment

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

do we know how long deletion takes? if it's a matter of seconds (rather than minutes/hours), then it's probably worth us invoking another poll_for_existence here to confirm that the the contact does not exist anymore, i.e. confirming that our deletion was really successful in the external system.

you'd be able to invoke it similarly to how it's being invoked in sendgrid_fixtures.py now, but just passing False for the existence_desired argument and updating the error_message appropriately. (you'd also probably want to update the _contact_exists method in that module to no longer have a leading _ since it'd not solely be for internal module use.

Copy link
Contributor

@adamsachs adamsachs left a comment

Choose a reason for hiding this comment

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

this generally looks good to me, a few minor comments/things to clarify. they may require some minor changes.

@ghost ghost linked an issue Jul 18, 2022 that may be closed by this pull request
@adamsachs
Copy link
Contributor

thanks for the updates to add poll_for_existence into the test! i do think there's a slight problem in how it's being invoked, though.

we should also be sure the tests are still passing with the addition of this polling. can you make sure to run the sendgrid integration tests locally before the next commit?

@adamsachs
Copy link
Contributor

@HamzaWaseemOnBench this is looking good! i think the code is good to go, but a couple of minor maintenance things we need to take care of:

  • looks like some merge conflicts now that need to be resolved (hopefully quick; let me know if you need any help)
  • can you update CHANGELOG.md file
  • i think we should get the sendgrid credentials added to GH secrets so that we can apply the Run Unsafe PR Checks label to this PR and run the external integration tests successfully

@galvana galvana added the run unsafe ci checks Triggers running of unsafe CI checks label Jul 18, 2022
@galvana galvana added run unsafe ci checks Triggers running of unsafe CI checks and removed run unsafe ci checks Triggers running of unsafe CI checks labels Jul 18, 2022
@galvana galvana added dependabot Pull requests from Dependabot run unsafe ci checks Triggers running of unsafe CI checks and removed run unsafe ci checks Triggers running of unsafe CI checks dependabot Pull requests from Dependabot labels Jul 18, 2022
CHANGELOG.md Outdated
@@ -132,6 +132,7 @@ The types of changes are:
* Adds endpoint analytics events [#622](https://github.com/ethyca/fidesops/pull/622)
* Sample dataset for Salesforce with access configuration [#676](https://github.com/ethyca/fidesops/pull/676)
* Sample dataset and access configuration for Zendesk (ticket endpoints) [#677](https://github.com/ethyca/fidesops/pull/677)
* Sample dataset for Sendgrid with access configuration [#883](https://github.com/ethyca/fidesops/pull/883)
Copy link
Contributor

@adamsachs adamsachs Jul 19, 2022

Choose a reason for hiding this comment

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

@HamzaWaseemOnBench please follow the instructions provided in the PR template that describe how to update the CHANGELOG.md file. there are a few things you need to do here:

  • merge in main so the most recent CHANGELOG.md file is being appended to. this is to avoid merge conflicts in the file.
  • your description for this feature needs to be added in the Unreleased section, since you are not adding this feature to the 1.6.0 release, but you're adding it to the next upcoming release. You can also refer to the Keep a Changelog documentation for more information about how to update the changelog.
  • the description you gave here doesn't really capture the full scope of your changes - i think a more accurate description would read something like: "Access and erasure support for Sendgrid contacts endpoint"

CHANGELOG.md Outdated
@@ -17,6 +17,7 @@ The types of changes are:
* `Security` in case of vulnerabilities.

## [Unreleased](https://github.com/ethyca/fidesops/compare/1.6.3...main)
* Access and erasure support for Sendgrid contacts endpoint [#883](https://github.com/ethyca/fidesops/pull/)
Copy link
Contributor

Choose a reason for hiding this comment

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

@HamzaWaseemOnBench this needs to be under the Added subsection

@adamsachs
Copy link
Contributor

all looks good, thanks for all the updates. noting that the mssql integration test failing is almost certainly not due to changes in this branch, but instead due to #813

@ghost ghost merged commit a73e138 into main Jul 19, 2022
@ghost ghost deleted the 252-saas-connector-sendgrid branch July 19, 2022 16:03
sanders41 pushed a commit that referenced this pull request Sep 22, 2022
* initial sendgrid saas connector integration. access only, contacts only

* erasure (update) support for sendgrid

* remove unused imports

* update sendgrid test fixture to expect 404 response status code because of ignore_errors enhancement

* Fixing import order and cleaning up the retry logic for consistency

* add sendgrid env var support to makefile and unsafe_pr_checks config. remove DELETE endpoint per PR comments

* Added delete endpoint for contacts

* Fixing data_path for contacts endpoint

* Reverting search query to improve performance and avoid server timeouts

* Updated delete endpoint request, used request instead of SaaSRequest in tests

* updated imports after check suggestion

* Updated code after review

* Removed unused variables, imports

* Restoring Makefile

* Fixed import cryptographic_util error

* Misc fixes

* Updated Changelog file

* Updated Changelog for unreleased section and pulled main

* Updated Changelog and added Sendgrid in unreleased section

* Updated Changelog and added Sendgrid in unreleased section with link

* Updated Changelog and added Sendgrid in added section after Adam's suggestion

Co-authored-by: Adam Sachs <adam@Adams-MacBook-Pro.local>
Co-authored-by: Adam Sachs <adam@Adams-MBP.attlocal.net>
Co-authored-by: Adrian Galvan <adriang430@gmail.com>
Co-authored-by: Hamza W <hamza@Hamzas-MacBook-Pro.local>
Co-authored-by: Adrian Galvan <adrian@ethyca.com>
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
run unsafe ci checks Triggers running of unsafe CI checks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sendgrid - follow-up integration support - "Lists" endpoint
2 participants