Skip to content

Commit

Permalink
chore: adjust node module imports
Browse files Browse the repository at this point in the history
  • Loading branch information
erossignon committed Oct 5, 2024
1 parent 1a12802 commit c5e59a3
Show file tree
Hide file tree
Showing 17 changed files with 36 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ---------------------------------------------------------------------------------------------------------------------

import fs from "fs";
import path from "path";
import os from "os";
import fs from "node:fs";
import path from "node:path";
import os from "node:os";

import "should";

Expand Down
6 changes: 3 additions & 3 deletions packages/node-opcua-crypto-test/test/test_create_key_pair.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ---------------------------------------------------------------------------------------------------------------------

import fs from "fs";
import path from "path";
import os from "os";
import fs from "node:fs";
import path from "node:path";
import os from "node:os";
import should from "should";

import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ---------------------------------------------------------------------------------------------------------------------

import fs from "fs";
import path from "path";
import os from "os";
import util from "util";
import fs from "node:fs";
import path from "node:path";
import os from "node:os";
import util from "node:util";
import should from "should";
import x509 from "@peculiar/x509";
import {
Expand Down
6 changes: 3 additions & 3 deletions packages/node-opcua-crypto-test/test/test_crypto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
// ---------------------------------------------------------------------------------------------------------------------

import assert from "assert";
import fs from "node:fs";
import path from "node:path";
import {
createHmac,
createCipheriv,
Expand All @@ -32,9 +34,7 @@ import {
publicEncrypt as publicEncrypt_fromCrypto,
randomBytes,
KeyObject,
} from "crypto";
import fs from "fs";
import path from "path";
} from "node:crypto";
import should from "should";
import * as loremIpsum1 from "lorem-ipsum";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
// ---------------------------------------------------------------------------------------------------------------------

import should from "should";
import path from "path";
import fs from "fs";
import path from "node:path";
import fs from "node:fs";

import {
readCertificate,
Expand Down
6 changes: 3 additions & 3 deletions packages/node-opcua-crypto-test/test/test_crypto_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ---------------------------------------------------------------------------------------------------------------------

import fs from "fs";
import os from "os";
import path from "path";
import fs from "node:fs";
import os from "node:os";
import path from "node:path";

import * as loremIpsum from "lorem-ipsum";
import "should";
Expand Down
2 changes: 1 addition & 1 deletion packages/node-opcua-crypto-test/test/test_explore_crl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ---------------------------------------------------------------------------------------------------------------------

import path from "path";
import path from "node:path";
import {
verifyCertificateRevocationListSignature,
exploreCertificateRevocationList,
Expand Down
2 changes: 1 addition & 1 deletion packages/node-opcua-crypto-test/test/test_explore_csr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ---------------------------------------------------------------------------------------------------------------------

import path from "path";
import path from "node:path";
import { exploreCertificateSigningRequest } from "node-opcua-crypto";

import { readCertificateSigningRequest } from "node-opcua-crypto";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ---------------------------------------------------------------------------------------------------------------------

import path from "path";
import path from "node:path";
import { explorePrivateKey } from "node-opcua-crypto";
import { readPrivateRsaKey, readPrivateKey } from "node-opcua-crypto";
import "should";
Expand Down
4 changes: 2 additions & 2 deletions packages/node-opcua-crypto-test/test/test_extKeyUsage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ---------------------------------------------------------------------------------------------------------------------

import path from "path";
import { exploreCertificate, readCertificate } from "node-opcua-crypto";
import path from "node:path";
import should from "should";
import { exploreCertificate, readCertificate } from "node-opcua-crypto";

describe("X509ExtKeyUsage", () => {
it("should parse extKeyUsage 1", () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/node-opcua-crypto-test/test/test_makeThumprint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ---------------------------------------------------------------------------------------------------------------------

import path from "path";
import path from "node:path";
import { makeSHA1Thumbprint } from "node-opcua-crypto";
import { readCertificate } from "node-opcua-crypto";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import path from "path";
import path from "node:path";
import "should";
import {
makePrivateKeyFromPem,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from "path";
import fs from "fs";
import { tmpdir } from "os";
import path from "node:path";
import fs from "node:fs";
import { tmpdir } from "node:os";
import { Crypto as PeculiarWebCrypto } from "@peculiar/webcrypto";
import * as x509 from "@peculiar/x509";
import { AsnConvert, AsnUtf8StringConverter } from "@peculiar/asn1-schema";
Expand Down Expand Up @@ -116,7 +116,7 @@ declare const window: any;

const ignoreCrypto = process.env.IGNORE_SUBTLE_FROM_CRYPTO;

import nativeCrypto from "crypto";
import nativeCrypto from "node:crypto";

if (typeof window === "undefined") {
_crypto = nativeCrypto as any;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ---------------------------------------------------------------------------------------------------------------------

import path from "path";
import path from "node:path";
import { exploreCertificate, explorePrivateKey } from "node-opcua-crypto";
import { publicKeyAndPrivateKeyMatches, certificateMatchesPrivateKey } from "node-opcua-crypto";
import { readCertificate, readPrivateKey } from "node-opcua-crypto";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ---------------------------------------------------------------------------------------------------------------------

import { createPublicKey } from "crypto";
import path from "path";
import { createPublicKey } from "node:crypto";
import path from "node:path";
import { rsaLengthPublicKey } from "node-opcua-crypto";
import { readCertificate, readCertificatePEM } from "node-opcua-crypto";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ---------------------------------------------------------------------------------------------------------------------

import path from "path";
import { verifyCertificateChain } from "node-opcua-crypto";
import { readCertificate } from "node-opcua-crypto";
import path from "node:path";
import { verifyCertificateChain, readCertificate } from "node-opcua-crypto";

describe("Test Certificate Chain", () => {
it("DX should verify a certificate chain", async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ---------------------------------------------------------------------------------------------------------------------

import path from "path";
import { SignPrivateKeyInput, constants, createSign } from "crypto";
import path from "node:path";
import { SignPrivateKeyInput, constants, createSign } from "node:crypto";
import { verifyCertificateSignature, Certificate, toPem2, PrivateKey } from "node-opcua-crypto";
import { asn1 } from "node-opcua-crypto";
import { readCertificate, readPrivateKey } from "node-opcua-crypto";
Expand Down

0 comments on commit c5e59a3

Please sign in to comment.