-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
Throw helpful error if privateKey
is set to only the first line, e.g. -----BEGIN RSA PRIVATE KEY-----
#71
Comments
in particular I would love to see if we can support |
Is there any |
A simpler approach with
|
yeah good idea with the regex. I'd just add two spaces around if (/^-----BEGIN .* PRIVATE KEY-----$/.test(privateKey.trim()) {
throw new Error("privateKey only contains the first line. Try replacing line breaks with \n")
} |
We don't need a sophisticated private key validation library. This is about the very specific and common problem that only the first line is passed as the |
Created a PR: octokit/auth-app.js#482 |
Follow up to octokit/auth-app.js#465 (comment), reported by @reza-ebrahimi
The first line might be
-----BEGIN PRIVATE KEY-----
or-----BEGIN RSA PRIVATE KEY-----
, maybe we will support other variations in future. But they all have the format-----BEGIN * KEY-----
I would suggest we add a check like
The text was updated successfully, but these errors were encountered: