-
-
Notifications
You must be signed in to change notification settings - Fork 20
feat(tls.createSecureContext): introduce #156
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
Open
0hmX
wants to merge
33
commits into
nodejs:main
Choose a base branch
from
0hmX:crypto-createCredentials
base: main
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.
Open
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
21b6e0b
feat(tls.createSecureContext): introduce
0hmX 144c006
Update recipes/crypto-createCredentials/codemod.yaml
0hmX f65c839
Update recipes/crypto-createCredentials/package.json
0hmX 8f7bae7
Update recipes/crypto-createCredentials/package.json
0hmX 0b4c417
rename to crypto-create-credentials
0hmX e36f7be
Update recipes/crypto-create-credentials/workflow.yaml
0hmX 6525cfd
Update recipes/crypto-create-credentials/workflow.yaml
0hmX a56c4bb
Update recipes/crypto-create-credentials/README.md
0hmX e6bf56e
sync package-lock.json
0hmX 9ac7b8b
refactor workflow.ts
0hmX 74d8025
fix lint codemod.yml
0hmX 81b8480
Update recipes/crypto-create-credentials/README.md
0hmX 7b8633f
Update recipes/crypto-create-credentials/README.md
0hmX 55bddce
Update recipes/crypto-create-credentials/package.json
0hmX c08282f
added os.EOL
0hmX 202b99f
lint fix
0hmX 67579ea
Update recipes/crypto-create-credentials/README.md
0hmX f36f0ee
Update recipes/crypto-create-credentials/README.md
0hmX 21ce469
Update recipes/crypto-create-credentials/src/workflow.ts
0hmX 1a8b640
Update recipes/crypto-create-credentials/src/workflow.ts
0hmX dfeb476
Update recipes/crypto-create-credentials/src/workflow.ts
0hmX b3f8bef
Update recipes/crypto-create-credentials/src/workflow.ts
0hmX f3dde78
rename to createCredentials-to-createSecureContext
0hmX 884a44d
updated to use destructred import
0hmX 015cd21
stable
0hmX 152e90f
fix
0hmX c0fd8e0
update to test
0hmX d057380
remove
0hmX f721b00
resize
0hmX adc08e3
remove line not needed
0hmX 7dbb6b2
Update recipes/createCredentials-to-createSecureContext/src/workflow.ts
0hmX c3fc053
remove wasTranformed var
0hmX 44015c1
update package-lock.json
0hmX 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 hidden or 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,51 @@ | ||
# `fs.rmdir` DEP0147 | ||
|
||
This recipe provides a guide for migrating from the deprecated `crypto.createCredentials` method in Node.js. | ||
|
||
See [DEP0010](https://nodejs.org/api/deprecations.html#DEP0010). | ||
|
||
## Examples | ||
|
||
**Before:** | ||
|
||
```js | ||
// Using the deprecated createCredentials from node:crypto | ||
const { createCredentials } = require('node:crypto'); | ||
|
||
const credentials = createCredentials({ | ||
key: privateKey, | ||
cert: certificate, | ||
ca: [caCertificate] | ||
}); | ||
|
||
// Using destructuring with ES module imports | ||
import { createCredentials } from 'node:crypto'; | ||
|
||
const credentials = createCredentials({ | ||
key: privateKey, | ||
cert: certificate, | ||
ca: [caCertificate] | ||
}); | ||
``` | ||
|
||
**After:** | ||
|
||
```js | ||
// Updated to use createSecureContext from node:tls | ||
const { createSecureContext } = require('node:tls'); | ||
|
||
const credentials = createSecureContext({ | ||
key: privateKey, | ||
cert: certificate, | ||
ca: [caCertificate] | ||
}); | ||
|
||
// Updated ES module import | ||
import { createSecureContext } from 'node:tls'; | ||
|
||
const credentials = createSecureContext({ | ||
key: privateKey, | ||
cert: certificate, | ||
ca: [caCertificate] | ||
}); | ||
``` |
This file contains hidden or 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,21 @@ | ||
schema_version: "1.0" | ||
name: "@nodejs/crypto-createCredentials" | ||
0hmX marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
version: 1.0.0 | ||
description: Handle DEP0010 via transforming `crypto.createCredentials` to `tls.createSecureContext` | ||
author: 0hmx | ||
license: MIT | ||
workflow: workflow.yaml | ||
category: migration | ||
|
||
targets: | ||
languages: | ||
- javascript | ||
- typescript | ||
|
||
keywords: | ||
- transformation | ||
- migration | ||
|
||
registry: | ||
access: public | ||
visibility: public |
This file contains hidden or 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,25 @@ | ||
{ | ||
"name": "@nodejs/crypto-createCredentials", | ||
"version": "1.0.0", | ||
"description": "Handle DEP0010 via transforming `crypto.createCredentials` to `tls.createSecureContext` with the appropriate options.", | ||
"type": "module", | ||
"scripts": { | ||
"test": "npx codemod@next jssg test -l typescript ./src/workflow.ts ./" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/nodejs/userland-migrations.git", | ||
"directory": "recipes/rmdirs", | ||
"bugs": "https://github.com/nodejs/userland-migrations/issues" | ||
}, | ||
"author": "0hmx", | ||
"license": "MIT", | ||
"homepage": "https://github.com/nodejs/userland-migrations/blob/main/recipes/rmdirs/README.md", | ||
0hmX marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
"devDependencies": { | ||
"@types/node": "^24.0.3", | ||
0hmX marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
"@codemod.com/jssg-types": "^1.0.3" | ||
}, | ||
"dependencies": { | ||
"@nodejs/codemod-utils": "*" | ||
} | ||
} |
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.
Uh oh!
There was an error while loading. Please reload this page.