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

feat(get-app-authentication): improve error message when privateKey is incomplete #312

Merged
merged 4 commits into from
Aug 1, 2021

Conversation

oscard0m
Copy link
Member

@oscard0m oscard0m commented Aug 1, 2021

πŸ“ Summary

  • To improve error message when privateKey provided by a user is incomplete (with only -----BEGIN RSA PRIVATE KEY-----)

β›± Motivation and Context

Fix #311

@oscard0m oscard0m requested a review from gr2m August 1, 2021 20:19
@oscard0m oscard0m added the Type: Feature New feature or request label Aug 1, 2021
@oscard0m
Copy link
Member Author

oscard0m commented Aug 1, 2021

@gr2m Not sure if we should test this in a pre-release first. What do you think?


await expect(auth({ type: "app" })).rejects.toEqual(
new Error(
"Private key is incomplete. Make sure it is a single line String and newlines have been replaced by '\n'"
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks good! I suggest we slightly change the error message to

Suggested change
"Private key is incomplete. Make sure it is a single line String and newlines have been replaced by '\n'"
"The 'privateKey` option contains only the first line '-----BEGIN RSA PRIVATE KEY-----'. If you are setting it using a `.env` file, make sure it is set on a single line with newlines replaced by '\n'"

what do you think?

@gr2m
Copy link
Contributor

gr2m commented Aug 1, 2021

@gr2m Not sure if we should test this in a pre-release first. What do you think?

no pre-release necessary

can you check what's up with the node 10 tests?

@oscard0m
Copy link
Member Author

oscard0m commented Aug 1, 2021

@gr2m Not sure if we should test this in a pre-release first. What do you think?

no pre-release necessary

can you check what's up with the node 10 tests?

checking Node 10 issue

@gr2m
Copy link
Contributor

gr2m commented Aug 1, 2021

Thanks Oscar!

@gr2m gr2m merged commit e0dc894 into master Aug 1, 2021
@gr2m gr2m deleted the improve-error-when-private-key-is-incomplete branch August 1, 2021 20:41
@github-actions
Copy link
Contributor

github-actions bot commented Aug 1, 2021

πŸŽ‰ This PR is included in version 3.6.0 πŸŽ‰

The release is available on:

Your semantic-release bot πŸ“¦πŸš€

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve error message when privateKey is not a single line String
2 participants