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

Remove crypto.Credentials API #21153

Closed
wants to merge 1 commit into from

Conversation

aduh95
Copy link
Contributor

@aduh95 aduh95 commented Jun 5, 2018

Fix #20793

The crypto.Credentials legacy API has been Runtime deprecated since
v0.11.13 and users had been adviced to use tls.SecureContext instead.

This PR removes it from the crypto module.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • documentation is changed or added
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added the crypto Issues and PRs related to the crypto subsystem. label Jun 5, 2018
@mscdex mscdex added the semver-major PRs that contain breaking changes and should be released in the next major version. label Jun 5, 2018
lib/crypto.js Outdated
@@ -211,7 +211,7 @@ Object.defineProperties(exports, {
fipsForced ? setFipsForced : setFipsCrypto
},
DEFAULT_ENCODING: {
enumerable: true,
enumerable: false,
Copy link
Member

Choose a reason for hiding this comment

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

this change seems unrelated

@targos
Copy link
Member

targos commented Jun 5, 2018

@nodejs/crypto @nodejs/tsc

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

LGTM with the changes @targos mentioned

@aduh95 aduh95 force-pushed the fix-crypto-deprecation-warnings branch from 8163a85 to e0acbef Compare June 5, 2018 21:07

The [`crypto.createCredentials()`][] API is deprecated. Please use
The [`crypto.createCredentials()`][] API has been removed. Please use
Copy link
Member

Choose a reason for hiding this comment

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

has been removed -> was removed (ditto on line 155)
Similar to PR #21043

lib/crypto.js Outdated
@@ -223,22 +223,4 @@ Object.defineProperties(exports, {
enumerable: true,
value: constants
},
Copy link
Member

Choose a reason for hiding this comment

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

The rest of the file does not use trailing commas, please remove this. I don't want to start any new discussions about trailing commas, but I'd go for consistency in this case.

Copy link
Contributor

Choose a reason for hiding this comment

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

The line right above doesn't have a trailing comma either, but @bnoordhuis suggests we use trailing commas moving forwards?

Idk, sounds reasonable to just add them wherever you go.

Copy link
Member

@tniessen tniessen Jun 6, 2018

Choose a reason for hiding this comment

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

Are you referring to #20703 (comment)? ESLint still doesn't have a file-by-file rule as far as I know, so that doesn't really apply here. Personally, I am not a fan of dangling commas, and we discussed that topic numerous times (e.g. #19131 (comment)). I totally understand Ben's reasoning, but this kind of "churn" isn't that common from my perspective, correct me if I am wrong.

Edit: Striked my own comment because I promised not to start a new debate about trailing commas.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, let's not. We should probably skip the comma for consistency, you're right.

@aduh95 aduh95 force-pushed the fix-crypto-deprecation-warnings branch from e0acbef to 966bdf8 Compare June 6, 2018 17:51
@Trott
Copy link
Member

Trott commented Jun 6, 2018

semver-major so needs two TSC approvals (already has one) + CITGM before landing


The [`crypto.createCredentials()`][] API is deprecated. Please use
The [`crypto.createCredentials()`][] API was removed. Please use
Copy link
Contributor

@vsemozhetbyt vsemozhetbyt Jun 6, 2018

Choose a reason for hiding this comment

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

It seems this link will not be valid after this PR, so we need to delinkify `crypto.createCredentials()` here and remove the bottom reference.

@vsemozhetbyt vsemozhetbyt added the deprecations Issues and PRs related to deprecations. label Jun 6, 2018
@aduh95 aduh95 force-pushed the fix-crypto-deprecation-warnings branch from 966bdf8 to 29be62f Compare June 6, 2018 21:49
Copy link
Member

@addaleax addaleax left a comment

Choose a reason for hiding this comment

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

LGTM, but only because of the existing runtime deprecation.

If we had had our process back then, this should just have gotten stuck at a documentation deprecation and a one-line alias.

@vsemozhetbyt
Copy link
Contributor

@nodejs/crypto is this ready to land?

@tniessen
Copy link
Member

@tniessen tniessen added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jun 24, 2018
@apapirovski apapirovski removed the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jun 25, 2018
@apapirovski
Copy link
Member

apapirovski commented Jun 25, 2018

@aduh95 could you have a look at the test failures please?

@tniessen
Copy link
Member

You need to remove the Credentials line from test-crypto-classes.js.

@aduh95
Copy link
Contributor Author

aduh95 commented Jun 25, 2018

@tniessen Thank you for spotting that, I'll take care of that this evening (that is to say in ten hours from my time zone).

The `crypto.Credentials` legacy API has been Runtime deprecated since
v0.11.13 and users had been adviced to use `tls.SecureContext` instead.

Fixes: nodejs#20793
@aduh95 aduh95 force-pushed the fix-crypto-deprecation-warnings branch from 29be62f to f758e89 Compare June 25, 2018 21:33
@vsemozhetbyt
Copy link
Contributor

@mhdawson
Copy link
Member

@shigeki any concerns ?

@vsemozhetbyt
Copy link
Contributor

@nodejs/crypto is this landable? Are there any concerns?

@tniessen
Copy link
Member

I am fine with this change, I don't know of any potential breakage or downsides.

@vsemozhetbyt
Copy link
Contributor

Let's land this tomorrow if there are no objections then.

@vsemozhetbyt
Copy link
Contributor

Landed in d2ee7d6
Thank you!

vsemozhetbyt pushed a commit that referenced this pull request Jul 13, 2018
The `crypto.Credentials` legacy API has been Runtime deprecated since
v0.11.13 and users had been adviced to use `tls.SecureContext` instead.

PR-URL: #21153
Fixes: #20793
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crypto Issues and PRs related to the crypto subsystem. deprecations Issues and PRs related to deprecations. semver-major PRs that contain breaking changes and should be released in the next major version.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet