-
Notifications
You must be signed in to change notification settings - Fork 78
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
LJ-386 Fix privacy request receipt notifications #5777
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
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.
Thanks for the quick turnaround! I just made one small commit to fix the change log so we could run the tests. I made a recommendation so we'd be able to catch other instances where we're calling the dispatch_message
with incorrect params. Don't let that hold this up though.
db=db, | ||
action_type=schema.action_type, | ||
to_identity=Identity.model_validate(to_identity), | ||
service_type=service_type, | ||
message_body_params=schema.body_params, | ||
property_id=property_id, |
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.
While we're here, let's add an *
to dispatch_message
so the optional arguments are required to be passed in as keyword args
def dispatch_message(
db: Session,
action_type: MessagingActionType,
*,
to_identity: Optional[Identity],
service_type: Optional[str],
message_body_params: Optional[
Union[
AccessRequestCompleteBodyParams,
ConsentEmailFulfillmentBodyParams,
SubjectIdentityVerificationBodyParams,
RequestReceiptBodyParams,
RequestReviewDenyBodyParams,
ErasureRequestBodyParams,
UserInviteBodyParams,
ErrorNotificationBodyParams,
]
] = None,
subject_override: Optional[str] = None,
property_id: Optional[str] = None,
) -> None:
if valid_body_params and not isinstance(self.body_params, valid_body_params): | ||
raise ValueError( | ||
f"Invalid body params for action type {self.action_type}. Expected {valid_body_params.__name__}, got {type(self.body_params).__name__}" | ||
) |
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.
😎
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5777 +/- ##
==========================================
+ Coverage 84.57% 86.81% +2.24%
==========================================
Files 394 394
Lines 24402 24412 +10
Branches 2637 2638 +1
==========================================
+ Hits 20638 21194 +556
+ Misses 3195 2649 -546
Partials 569 569 ☔ View full report in Codecov by Sentry. |
fides
|
Project |
fides
|
Branch Review |
main
|
Run status |
|
Run duration | 00m 50s |
Commit |
|
Committer | erosselli |
View all properties for this run ↗︎ |
Test results | |
---|---|
|
0
|
|
0
|
|
0
|
|
0
|
|
5
|
Upgrade your plan to view test results. | |
View all changes introduced in this branch ↗︎ |
Co-authored-by: Adrian Galvan <[email protected]>
Closes LJ-386
Description Of Changes
Fixed cryptic error when processing a DSR if
send_request_receipt_notification
was set totrue
. The cause of the error was usingSet
in the type ofRequestReceiptBodyParams
, becauseSet
is not JSON serializable.Code Changes
src/fides/api/schemas/messaging/messaging.py
:RequestReceiptBodyParams
to useList
instead ofSet
. This is what fixes the issueFidesopsMessage
class to check the provided params match theaction_type
RequestReviewDenyBodyParams
so it doesn't allow extra params. That way other types don't get mistakenly assigned to this typesrc/fides/api/service/messaging/message_dispatch_service.py
-> drive-by change, changeddispatch_message
to be called with kwargs cause we were puttingproperty_id
in the wrong placeSteps to Confirm
send_request_receipt_notification = true
under[notifications]
Pre-Merge Checklist
CHANGELOG.md
updatedmain
downgrade()
migration is correct and works