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

HMAC RequestValidator and GitHub Actions Setup #80

Merged
merged 6 commits into from
Nov 20, 2023
Merged

Conversation

jpsantosbh
Copy link
Contributor

@jpsantosbh jpsantosbh commented Nov 10, 2023

The RequestValidator class helps to validate Signalwire callback requests.

Added unit tests to confirm both LAML and SWML requests.

Also changes CI from Drone to Github Actions

@jpsantosbh jpsantosbh changed the title Setup GitHub Actions HMAC RequestValidator and GitHub Actions Setup Nov 10, 2023

return valid_signature_without_port or valid_signature_with_port

return self.validate_with_compatibility(uri, params, signature)
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this be a part of if isinstance(params, str) condition? Considering the implementation of this feature in JS SDK.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch! fixed

Copy link
Contributor

Choose a reason for hiding this comment

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

Correct me if I am wrong. This implementation is gonna call the compatibility_validator.validate even when the params is not an instance of a string. But the JS SDK throws an error if it is not a string.

I don't think it's a big deal but I am just highlighting it in terms of consistency across our SDKs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, when it's a string there is a chance that is a SWML callback that the compatibility_validator can not handle. But for the the other cases it's should be able to handle.

@jpsantosbh jpsantosbh merged commit 40e6616 into master Nov 20, 2023
2 checks passed
@jpsantosbh jpsantosbh deleted the joao/setup_gha branch November 20, 2023 14:21
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