-
-
Notifications
You must be signed in to change notification settings - Fork 16
feat(crypto-fips): add migration recipe for crypto.fips #177
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
max-programming
wants to merge
13
commits into
nodejs:main
Choose a base branch
from
max-programming:crypto-fips
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 all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
39f92b0
feat(crypto-fips): add migration recipe for transitioning from crypto…
max-programming 0b7a664
Use one-liner arrow function
max-programming 17c3bc9
chore(vscode): revert settings json file to default
max-programming 078fecd
refactor(crypto-fips): streamline crypto base path retrieval and impr…
max-programming 7cd8777
refactor(crypto-fips): use generators for crypto base path collection
max-programming 866e1fc
refactor(crypto-fips): enhance code formatting and improve readability
max-programming 7200be7
refactor(crypto-fips): rename functions and variables for clarity in …
max-programming b4d9c0c
refactor(crypto-fips): implement transformation for crypto.fips to ge…
max-programming fe9ec48
refactor(crypto-fips): update README examplesto have import statement
max-programming 8c3bd84
refactor(crypto-fips): use existing utility function and reformat cod…
max-programming 91a80be
refactor(crypto-fips): added missing jsdoc for a functions
max-programming 92a829e
refactor(crypto-fips): add an extra line
max-programming 515da7d
docs(crypto-fips): fix description
max-programming 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 |
---|---|---|
|
@@ -8,4 +8,4 @@ | |
"[markdown]": { | ||
"editor.wordWrap": "off" | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,45 @@ | ||
# `crypto.fips` DEP0093 | ||
|
||
This recipe transforms the usage from the deprecated `crypto.fips` to `crypto.getFips()` and `crypto.setFips()`. | ||
|
||
See [DEP0093](https://nodejs.org/api/deprecations.html#DEP0093). | ||
|
||
## Examples | ||
|
||
**Before:** | ||
|
||
```js | ||
import crypto from "node:crypto"; | ||
import { fips } from "node:crypto"; | ||
|
||
// Using crypto.fips | ||
crypto.fips; | ||
fips; | ||
|
||
// Using crypto.fips = true | ||
crypto.fips = true; | ||
fips = true; | ||
|
||
// Using crypto.fips = false | ||
crypto.fips = false; | ||
fips = false; | ||
``` | ||
|
||
**After:** | ||
|
||
```js | ||
import crypto from "node:crypto"; | ||
import { getFips, setFips } from "node:crypto"; | ||
|
||
// Using crypto.getFips() | ||
crypto.getFips(); | ||
getFips(); | ||
|
||
// Using crypto.setFips(true) | ||
crypto.setFips(true); | ||
setFips(true); | ||
|
||
// Using crypto.setFips(false) | ||
crypto.setFips(false); | ||
setFips(false); | ||
``` |
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-fips" | ||
version: 1.0.0 | ||
description: Handle DEP0093 via transforming `crypto.fips` to `crypto.getFips()` and `crypto.setFips()` | ||
author: Usman S. | ||
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,24 @@ | ||
{ | ||
"name": "@nodejs/crypto-fips", | ||
"version": "1.0.0", | ||
"description": "Handle DEP0093 via transforming `crypto.fips` to `crypto.getFips()` and `crypto.setFips()`", | ||
"type": "module", | ||
"scripts": { | ||
"test": "npx codemod jssg test -l typescript ./src/workflow.ts ./" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/nodejs/userland-migrations.git", | ||
"directory": "recipes/crypto-fips", | ||
"bugs": "https://github.com/nodejs/userland-migrations/issues" | ||
}, | ||
"author": "Usman S.", | ||
"license": "MIT", | ||
"homepage": "https://github.com/nodejs/userland-migrations/blob/main/recipes/crypto-fips/README.md", | ||
"devDependencies": { | ||
"@codemod.com/jssg-types": "^1.0.3" | ||
}, | ||
"dependencies": { | ||
"@nodejs/codemod-utils": "*" | ||
} | ||
} |
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.
Uh oh!
There was an error while loading. Please reload this page.