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

Update fides_disable_save_api option in FidesJS SDK to disable both privacy-preferences & notice-served APIs #4860

Merged
merged 6 commits into from
May 3, 2024

Conversation

NevilleS
Copy link
Contributor

@NevilleS NevilleS commented May 3, 2024

Closes PROD-2017

Description Of Changes

This is a small change to make the fides_disable_save_api option more consistent; in usage, we expected this to disable all save APIs (both notices-served & privacy-preferences), but as of today only the privacy-preferences API is disabled, which was surprising.

As with a lot of PRs, the majority of the changes here are updating the tests 😄

Code Changes

  • Update FidesJS to disable calling notices-served if fides_disable_save_api option is true
  • Update Cypress tests

Steps to Confirm

  • Run the Cookie House demo locally with ?fides_disable_save_api=true as a query param
  • Check the network tab and observe that notices-served and privacy-preferences are not called

Pre-Merge Checklist

Copy link

vercel bot commented May 3, 2024

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

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
fides-plus-nightly ⬜️ Ignored (Inspect) Visit Preview May 3, 2024 3:30pm

Copy link
Contributor Author

@NevilleS NevilleS left a comment

Choose a reason for hiding this comment

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

Couple notes!

const historyId1 = "pri_mock_history_id_1";
const historyId2 = "pri_mock_history_id_2";
const buildMockNotices = (): PrivacyNotice[] => [
Copy link
Contributor Author

Choose a reason for hiding this comment

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

DRY'd this up a bit to make these specs easier to read and reuse.

Comment on lines +100 to +103
// Disable the notices-served API if the fides_disable_save_api option is set
if (options.fidesDisableSaveApi) {
return;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is all that was actually needed 👍

Copy link

cypress bot commented May 3, 2024

Passing run #7604 ↗︎

0 4 0 0 Flakiness 0

Details:

Merge dfe3632 into 43b62d4...
Project: fides Commit: c8d0c55557 ℹ️
Status: Passed Duration: 00:36 💡
Started: May 3, 2024 3:42 PM Ended: May 3, 2024 3:43 PM

Review all test suite changes for PR #4860 ↗︎

Copy link
Contributor

@eastandwestwind eastandwestwind left a comment

Choose a reason for hiding this comment

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

Looks great!

}

// Disable the notices-served API if the serving component is a regular
// banner (or unknown!). This means we trigger the API for:
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for adding this helpful comment 👍🏼

@@ -2338,6 +2290,50 @@ describe("Consent overlay", () => {
});
});
});

it("when fides_disable_save_api option is set, disables notices-served & privacy-preferences APIs", () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

🚀

@NevilleS NevilleS merged commit 221cb05 into main May 3, 2024
13 checks passed
@NevilleS NevilleS deleted the PROD-2017-ns-disable-notices-served-api branch May 3, 2024 16:01
Kelsey-Ethyca pushed a commit that referenced this pull request May 3, 2024
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