MPP-3852: Test verify_from_sns
#5234
Merged
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.
This PR adds tests for
verify_from_sns
, which verifies the signature in an SNS JSON body against the signing certificate. Previously, this code was untested, and mocked whenever called. This hides thatOpenSSL.crypto.verify
has been removed in 24.3.0 (see #5228). When running the tests,pytest
will now report:My plan is to rebase PR #5228 after this merges, and we should then see test failures. I'll then replace
pyopenssl
andpem
with thecryptography
equivalents. The change will be the exception raised when verification fails.