-
Notifications
You must be signed in to change notification settings - Fork 85
Fixing up guard access requests #7130
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
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7130 +/- ##
==========================================
+ Coverage 87.30% 87.33% +0.02%
==========================================
Files 533 533
Lines 35090 35166 +76
Branches 4067 4084 +17
==========================================
+ Hits 30635 30711 +76
+ Misses 3570 3569 -1
- Partials 885 886 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
While im not 100% confident of the current callback testing path management of the access request, it is out of the scope of the current pr
Greptile SummaryThis PR fixes a critical bug in the SaaS connector's async access request handling. Previously, when a policy had no access rules (erasure-only), the guard clause would prevent async access requests from being initiated, but the code would continue executing the regular retrieval flow instead of returning early. Key Changes:
Implementation Details: Test Coverage:
The fix properly addresses the issue where async access requests would incorrectly execute during erasure-only operations. Confidence Score: 4/5
Important Files Changed
|
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.
4 files reviewed, 2 comments
| # Cleanup | ||
| try: | ||
| erasure_rule.delete(db) | ||
| erasure_only_policy.delete(db) | ||
| except Exception: | ||
| pass |
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.
style: manual deletion of test records unnecessary - database automatically cleared between test runs
| # Cleanup | |
| try: | |
| erasure_rule.delete(db) | |
| erasure_only_policy.delete(db) | |
| except Exception: | |
| pass |
Context Used: Rule from dashboard - Do not manually delete database records in test fixtures or at the end of tests, as the database is ... (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| # Cleanup | ||
| try: | ||
| erasure_rule.delete(db) | ||
| erasure_only_policy.delete(db) | ||
| except Exception: | ||
| pass |
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.
style: manual deletion of test records unnecessary - database automatically cleared between test runs
| # Cleanup | |
| try: | |
| erasure_rule.delete(db) | |
| erasure_only_policy.delete(db) | |
| except Exception: | |
| pass |
Context Used: Rule from dashboard - Do not manually delete database records in test fixtures or at the end of tests, as the database is ... (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Ticket [ENG-2440]
Description Of Changes
Fixed a guard clause in the SaaS connector that was not properly skipping async access requests when the policy does not have access rules. Previously, when an async DSR strategy (such as polling) was detected, the code would check if the request was an erasure request and skip the polling on access requests, but it would not exit the
retrieve_datamethod, running the polling access request like a normal requestRegarding Callbacks:
The Current test setup for Callback requires the bypass of the retrieve data guard, due to it requiring the initial access data to set up the future calls. Updating the Callback test was considered, but it escaped the scope an LoC limit for this fix
Code Changes
retrieve_data()method to check the guard clause only on async requests, and exit the method if it fails the guardtest_saas_connector.py:test_guard_access_request_with_access_policy: Verifies async access requests run when policy has access rulestest_guard_access_request_with_erasure_only_policy: Verifies async access requests are skipped when policy has no access rulesSteps to Confirm
You can use a Polling Async integration, such as AppsFlyer, and verify that there should be no access requests firing when executing an erasure request.
To test:
Pre-Merge Checklist
CHANGELOG.mdupdatedmaindowngrade()migration is correct and works