-
Notifications
You must be signed in to change notification settings - Fork 72
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
Sailthru Integration: ignore valid 400 for user not existing #5145
Merged
Merged
Changes from 3 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
101c5a0
fix: ignore valid 400 for user not existing
SteveDMurphy 754d44a
changelog
SteveDMurphy 23f0a8e
Moving ignore_errors to request override and adding test
galvana 7e7c1b7
Adding test for errored response with HTTP 200 status code
galvana 726db61
Merge branch 'main' into SteveDMurphy-fides-1082-ignore-400-sailthru
galvana b536dda
Adding code comment
galvana ded38d8
Merge branch 'main' into SteveDMurphy-fides-1082-ignore-400-sailthru
galvana 743cd34
Merge branch 'main' into SteveDMurphy-fides-1082-ignore-400-sailthru
galvana File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,18 @@ async def test_access_request( | |
for user in access_results["marigold_engage_instance:user"]: | ||
assert user["keys"]["email"] == marigold_engage_identity_email | ||
|
||
async def test_access_request_user_not_found( | ||
self, | ||
marigold_engage_runner: ConnectorRunner, | ||
policy, | ||
): | ||
access_results = await marigold_engage_runner.access_request( | ||
access_policy=policy, | ||
identities={"email": "[email protected]"}, | ||
skip_collection_verification=True, | ||
) | ||
assert access_results == {"marigold_engage_instance:user": []} | ||
galvana marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
async def test_non_strict_erasure_request( | ||
self, | ||
marigold_engage_runner: ConnectorRunner, | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Because we're using a
request_override
for the user read, we can't defineignore_errors
on the SaaS config, it needs to be defined on theclient.send
inside the request override. It's possible for a request override function to make multipleclient.send
calls so if we defineignore_errors
at the SaaS config level, we couldn't programmatically determine whichclient.send
to apply that to.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.
We could define a variable that makes explicit for future programmers that we are ignoring the 400 error because the user might not exist, and also remove a magic number/list, by defining something like
error400ForUserNotFound = [400]
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.
Also, Do we have an explanation from their docs on why an UserNotFound is a.400
error instead of a404
? Usually NotFound errors are404
Nevermind, found the reference on the Docs. I'ts odd that they override the usual 404 error.
Maybe we should check for the specific error message "User not found with {KEY}", just so we dont blank accept any 400 error
It did feel odd to see a 400 for this instead of the 404. Happy to see if we can dig in a bit more to ensure other errors aren't also being ignored. Sounds like that might be the case with the custom override we need to account for based on what @galvana was saying 👍🏽
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.
Its better now. But i still think we should rename the variable, just so we have more clarity on what type of "400" error are we ignoring