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

Add validation to check that parameters aren't nullish #205

Merged
merged 1 commit into from
Sep 17, 2021

Conversation

Gudahtt
Copy link
Member

@Gudahtt Gudahtt commented Sep 10, 2021

Validation has been added to the signing and encryption functions to ensure that the parameters are not nullish. This should help with migrating from the last major version, as it would be easy to accidentally use the wrong parameter name when migrating.

A nullish check was used rather than a falsy check because there are falsy values that are valid for some parameters (e.g. the data being signed can be 0). null and undefined are never valid in these cases though.

@Gudahtt Gudahtt requested a review from a team as a code owner September 10, 2021 23:21
@Gudahtt Gudahtt marked this pull request as draft September 10, 2021 23:21
Base automatically changed from replace-msg-params to main September 13, 2021 22:00
@Gudahtt Gudahtt force-pushed the add-parameter-nullish-validation branch from b76614b to bc22483 Compare September 13, 2021 22:00
@Gudahtt
Copy link
Member Author

Gudahtt commented Sep 13, 2021

Further validation was intentionally delayed until later because that gets awfully complicated if we're also trying to avoid breaking changes. There are a lot of "invalid" parameters that will still produce valid signatures.

@Gudahtt Gudahtt marked this pull request as ready for review September 13, 2021 22:03
@Gudahtt Gudahtt force-pushed the add-parameter-nullish-validation branch from bc22483 to e516215 Compare September 15, 2021 16:44
Validation has been added to the signing and encryption functions to
ensure that the parameters are not nullish. This should help with
migrating from the last major version, as it would be easy to
accidentally use the wrong parameter name when migrating.

A nullish check was used rather than a falsy check because there are
falsy values that are valid for some parameters (e.g. the data being
signed can be `0`). `null` and `undefined` are never valid in these
cases though.
@Gudahtt Gudahtt force-pushed the add-parameter-nullish-validation branch from e516215 to d7902a5 Compare September 15, 2021 23:10
@Gudahtt Gudahtt merged commit 7e774d6 into main Sep 17, 2021
@Gudahtt Gudahtt deleted the add-parameter-nullish-validation branch September 17, 2021 01: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