Skip to content
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

Power reviews integration #5258

Merged
merged 26 commits into from
Sep 10, 2024
Merged

Power reviews integration #5258

merged 26 commits into from
Sep 10, 2024

Conversation

Vagoasdf
Copy link
Contributor

@Vagoasdf Vagoasdf commented Sep 4, 2024

Closes Integrations-308

Description Of Changes

Adding Support for Power Reviews Integrations

Auth Override Added because it was using a non-standard basic auth (doc said it was Oauth2, but it behaves like basic auth)

Request override Added to properly format the JSON Payload

Code Changes

  • Created new suite of test for Power Reviews
  • Adding request Override for Delete Action on Power Reviews
  • Adding Auth Override

Steps to Confirm

  • Power Reviews should appear as an option on Integrations
  • Said integration should work properly

Pre-Merge Checklist

@Vagoasdf Vagoasdf requested a review from a team as a code owner September 4, 2024 19:12
Copy link

vercel bot commented Sep 4, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
fides-plus-nightly ⬜️ Ignored (Inspect) Visit Preview Sep 10, 2024 1:44pm

Copy link

cypress bot commented Sep 4, 2024

fides    Run #9860

Run Properties:  status check passed Passed #9860  •  git commit 30448bd657 ℹ️: Merge 9249476033dd817c096775719e53fd1ab001a8e3 into 84c8b1e2e2b728e20c631131d6c8...
Project fides
Branch Review refs/pull/5258/merge
Run status status check passed Passed #9860
Run duration 00m 37s
Commit git commit 30448bd657 ℹ️: Merge 9249476033dd817c096775719e53fd1ab001a8e3 into 84c8b1e2e2b728e20c631131d6c8...
Committer Bruno Gutierrez Rios
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 4
View all changes introduced in this branch ↗︎

Copy link
Contributor

@galvana galvana left a comment

Choose a reason for hiding this comment

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

Good work here @Vagoasdf. I just left a few comments

@@ -17,6 +17,8 @@ The types of changes are:

## [Unreleased](https://github.com/ethyca/fides/compare/2.44.0...main)

- Adding erasure support for Power Reviews [#5258](https://github.com/ethyca/fides/pull/5258)
Copy link
Contributor

Choose a reason for hiding this comment

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

Make sure you put the entry under the correct header

Suggested change
- Adding erasure support for Power Reviews [#5258](https://github.com/ethyca/fides/pull/5258)
### Added
- Adding erasure support for Power Reviews [#5258](https://github.com/ethyca/fides/pull/5258)

Comment on lines 3 to 4
name: Power Reviews
type: power_reviews
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's match this to the way they spell their name PowerReviews (with no space)

Suggested change
name: Power Reviews
type: power_reviews
name: PowerReviews
type: powerreviews

Make sure you change the file names and any usages of the type (powerreviews) and name (PowerReviews)

Copy link
Contributor Author

@Vagoasdf Vagoasdf Sep 6, 2024

Choose a reason for hiding this comment

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

I'll do this change, but im slightly worried that it's going to negatively improve readability, since its all lowercase, and we have this double "r" in the middle

Comment on lines 5 to 15
collections:
- name: privacy
fields:
- name: request_id
data_categories: [system.operations]
fidesops_meta:
data_type: string
- name: status
data_categories: [system.operations]
fidesops_meta:
data_type: string
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be empty since we don't have an access request

Suggested change
collections:
- name: privacy
fields:
- name: request_id
data_categories: [system.operations]
fidesops_meta:
data_type: string
- name: status
data_categories: [system.operations]
fidesops_meta:
data_type: string
collections: []

erasure_policy=erasure_policy_string_rewrite,
identities={"email": power_reviews_erasure_identity_email},
)
# We set the email to 1 since its 1 request only(?)
Copy link
Contributor

Choose a reason for hiding this comment

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

That's correct, the number corresponds to how many records we deleted in this case it would be just 1

client_secret: str


class PowerReviewsAuthenticationStrategy(AuthenticationStrategy):
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we have used the oauth2_client_credentials authentication strategy instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Initially i thought we wouldn't be able, since its a cross between Oauth2 and Basic auth, but it looks like it can be done. Updating it

Copy link
Contributor

@galvana galvana left a comment

Choose a reason for hiding this comment

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

Thanks for making the changes! I called out a few last things but you can go ahead and merge once those are done

value: 3

endpoints:
- name: privacy
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's rename this to user so it reflects the type of object being deleted

Suggested change
- name: privacy
- name: user

Comment on lines 23 to 26
"merchant_id": pydash.get(saas_config, "powerreviews.merchant_id")
or secrets["merchant_id"],
"merchant_group_id": pydash.get(saas_config, "powerreviews.merchant_group_id")
or secrets["merchant_group_id"],
Copy link
Contributor

Choose a reason for hiding this comment

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

We can remove these if we're not using them in the integration

Suggested change
"merchant_id": pydash.get(saas_config, "powerreviews.merchant_id")
or secrets["merchant_id"],
"merchant_group_id": pydash.get(saas_config, "powerreviews.merchant_group_id")
or secrets["merchant_group_id"],

erasure_policy=erasure_policy_string_rewrite,
identities={"email": powerreviews_erasure_identity_email},
)
assert erasure_results == {"powerreviews_instance:privacy": 1}
Copy link
Contributor

Choose a reason for hiding this comment

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

To match the name change above

Suggested change
assert erasure_results == {"powerreviews_instance:privacy": 1}
assert erasure_results == {"powerreviews_instance:user": 1}

Correctly setting the name.
Removing unused keys on fixutres
@Vagoasdf Vagoasdf merged commit 77dabdd into main Sep 10, 2024
37 checks passed
@Vagoasdf Vagoasdf deleted the PowerReviews-Integration branch September 10, 2024 15:03
Copy link

cypress bot commented Sep 10, 2024

fides    Run #9862

Run Properties:  status check passed Passed #9862  •  git commit 77dabdd420: Power reviews integration (#5258)
Project fides
Branch Review main
Run status status check passed Passed #9862
Run duration 00m 36s
Commit git commit 77dabdd420: Power reviews integration (#5258)
Committer Bruno Gutierrez Rios
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 4
View all changes introduced in this branch ↗︎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants