-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
refactors and new algorithms #978
Draft
panva
wants to merge
7
commits into
auth0:master
Choose a base branch
from
panva:wip
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+620
−267
Draft
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
2c0e670
chore: ignore package-lock.json
panva e54aa61
refactor: use async node:crypto methods when available
panva 75d947c
test: remove deprecated use of Buffer()
panva eb18c08
feat: add support for curve secp256k1 (ES256K)
panva f508199
feat: add support for Ed25519 and Ed448 (EdDSA)
panva e378449
docs: update README.md
panva 852147a
docs: update README.md
panva File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ node_modules | |
.DS_Store | ||
.nyc_output | ||
coverage | ||
package-lock.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/* istanbul ignore file */ | ||
if (Buffer.isEncoding("base64url")) { | ||
module.exports = (buf) => buf.toString("base64url"); | ||
} else { | ||
const fromBase64 = (base64) => | ||
// eslint-disable-next-line no-div-regex | ||
base64.replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_"); | ||
module.exports = (buf) => fromBase64(buf.toString("base64")); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/* istanbul ignore file */ | ||
const [major, minor] = process.versions.node.split('.').map((v) => parseInt(v, 10)); | ||
|
||
module.exports.RSA_PSS_KEY_DETAILS_SUPPORTED = major > 16 || (major === 16 && minor >= 9); | ||
module.exports.ASYMMETRIC_KEY_DETAILS_SUPPORTED = major > 15 || (major === 15 && minor >= 7); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
const { constants } = require("crypto"); | ||
|
||
module.exports = function(alg, key) { | ||
switch (alg) { | ||
case 'RS256': | ||
return { | ||
digest: 'sha256', | ||
key: { key, padding: constants.RSA_PKCS1_PADDING }, | ||
}; | ||
case 'RS384': | ||
return { | ||
digest: 'sha384', | ||
key: { key, padding: constants.RSA_PKCS1_PADDING }, | ||
}; | ||
case 'RS512': | ||
return { | ||
digest: 'sha512', | ||
key: { key, padding: constants.RSA_PKCS1_PADDING }, | ||
}; | ||
case 'PS256': | ||
return { | ||
digest: 'sha256', | ||
key: { key, padding: constants.RSA_PKCS1_PSS_PADDING, saltLength: constants.RSA_PSS_SALTLEN_DIGEST }, | ||
}; | ||
case 'PS384': | ||
return { | ||
digest: 'sha384', | ||
key: { key, padding: constants.RSA_PKCS1_PSS_PADDING, saltLength: constants.RSA_PSS_SALTLEN_DIGEST }, | ||
}; | ||
case 'PS512': | ||
return { | ||
digest: 'sha512', | ||
key: { key, padding: constants.RSA_PKCS1_PSS_PADDING, saltLength: constants.RSA_PSS_SALTLEN_DIGEST }, | ||
}; | ||
case 'ES256': | ||
return { | ||
digest: 'sha256', | ||
key: { key, dsaEncoding: 'ieee-p1363' }, | ||
}; | ||
case 'ES256K': | ||
return { | ||
digest: 'sha256', | ||
key: { key, dsaEncoding: 'ieee-p1363' }, | ||
}; | ||
case 'ES384': | ||
return { | ||
digest: 'sha384', | ||
key: { key, dsaEncoding: 'ieee-p1363' }, | ||
}; | ||
case 'ES512': | ||
return { | ||
digest: 'sha512', | ||
key: { key, dsaEncoding: 'ieee-p1363' }, | ||
}; | ||
case 'EdDSA': | ||
return { | ||
digest: undefined, | ||
key: { key }, | ||
}; | ||
default: | ||
throw new Error('unreachable'); | ||
} | ||
}; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we bump the version to
"version" : "10.0.0"
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, this is not breaking the declared supported engines.
Nothing from my end.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to add a few more reviewers?
Seems that ci/circleci is still having some issues
ci/circleci: node-v18 Expected — Waiting for status to be reported
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've linked the actual pipeline results above. In a followup to this @frederikprijck mentioned migrating to github actions.