diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2023-03-08 07:44:54 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-08 12:44:54 +0100 |
commit | 72fe9bb47005e720444e65a66e91559287137780 (patch) | |
tree | d529ee7f3b2c33063ba4496f8fd3dfdbac0d1355 /ext/node/polyfills/internal/crypto | |
parent | d24c6ea27f7dea57e3bc0cda342d6cbe59782f7d (diff) |
refactor: rename InternalModuleLoader to ExtModuleLoader, use ext: scheme for snapshotted modules (#18041)
This commit renames "deno_core::InternalModuleLoader" to
"ExtModuleLoader" and changes the specifiers used by the
modules loaded from this loader to "ext:".
"internal:" scheme was really ambiguous and it's more characters than
"ext:", which should result in slightly smaller snapshot size.
Closes https://github.com/denoland/deno/issues/18020
Diffstat (limited to 'ext/node/polyfills/internal/crypto')
-rw-r--r-- | ext/node/polyfills/internal/crypto/_keys.ts | 2 | ||||
-rw-r--r-- | ext/node/polyfills/internal/crypto/_randomBytes.ts | 2 | ||||
-rw-r--r-- | ext/node/polyfills/internal/crypto/_randomFill.ts | 4 | ||||
-rw-r--r-- | ext/node/polyfills/internal/crypto/certificate.ts | 6 | ||||
-rw-r--r-- | ext/node/polyfills/internal/crypto/cipher.ts | 18 | ||||
-rw-r--r-- | ext/node/polyfills/internal/crypto/diffiehellman.ts | 18 | ||||
-rw-r--r-- | ext/node/polyfills/internal/crypto/hash.ts | 18 | ||||
-rw-r--r-- | ext/node/polyfills/internal/crypto/hkdf.ts | 16 | ||||
-rw-r--r-- | ext/node/polyfills/internal/crypto/keygen.ts | 11 | ||||
-rw-r--r-- | ext/node/polyfills/internal/crypto/keys.ts | 16 | ||||
-rw-r--r-- | ext/node/polyfills/internal/crypto/pbkdf2.ts | 6 | ||||
-rw-r--r-- | ext/node/polyfills/internal/crypto/random.ts | 14 | ||||
-rw-r--r-- | ext/node/polyfills/internal/crypto/scrypt.ts | 6 | ||||
-rw-r--r-- | ext/node/polyfills/internal/crypto/sig.ts | 14 | ||||
-rw-r--r-- | ext/node/polyfills/internal/crypto/util.ts | 12 | ||||
-rw-r--r-- | ext/node/polyfills/internal/crypto/x509.ts | 12 |
16 files changed, 86 insertions, 89 deletions
diff --git a/ext/node/polyfills/internal/crypto/_keys.ts b/ext/node/polyfills/internal/crypto/_keys.ts index 853777976..f423bad61 100644 --- a/ext/node/polyfills/internal/crypto/_keys.ts +++ b/ext/node/polyfills/internal/crypto/_keys.ts @@ -1,5 +1,5 @@ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. -import { kKeyObject } from "internal:deno_node/internal/crypto/constants.ts"; +import { kKeyObject } from "ext:deno_node/internal/crypto/constants.ts"; export const kKeyType = Symbol("kKeyType"); diff --git a/ext/node/polyfills/internal/crypto/_randomBytes.ts b/ext/node/polyfills/internal/crypto/_randomBytes.ts index 16b779a02..1b2595e1b 100644 --- a/ext/node/polyfills/internal/crypto/_randomBytes.ts +++ b/ext/node/polyfills/internal/crypto/_randomBytes.ts @@ -1,5 +1,5 @@ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. -import { Buffer } from "internal:deno_node/buffer.ts"; +import { Buffer } from "ext:deno_node/buffer.ts"; export const MAX_RANDOM_VALUES = 65536; export const MAX_SIZE = 4294967295; diff --git a/ext/node/polyfills/internal/crypto/_randomFill.ts b/ext/node/polyfills/internal/crypto/_randomFill.ts index 9acff9b9b..ba8b9cbec 100644 --- a/ext/node/polyfills/internal/crypto/_randomFill.ts +++ b/ext/node/polyfills/internal/crypto/_randomFill.ts @@ -1,8 +1,8 @@ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. import randomBytes, { MAX_SIZE as kMaxUint32, -} from "internal:deno_node/internal/crypto/_randomBytes.ts"; -import { Buffer } from "internal:deno_node/buffer.ts"; +} from "ext:deno_node/internal/crypto/_randomBytes.ts"; +import { Buffer } from "ext:deno_node/buffer.ts"; const kBufferMaxLength = 0x7fffffff; diff --git a/ext/node/polyfills/internal/crypto/certificate.ts b/ext/node/polyfills/internal/crypto/certificate.ts index bfa171ad3..ebcfecbda 100644 --- a/ext/node/polyfills/internal/crypto/certificate.ts +++ b/ext/node/polyfills/internal/crypto/certificate.ts @@ -1,9 +1,9 @@ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. // Copyright Joyent, Inc. and Node.js contributors. All rights reserved. MIT license. -import { notImplemented } from "internal:deno_node/_utils.ts"; -import { Buffer } from "internal:deno_node/buffer.ts"; -import { BinaryLike } from "internal:deno_node/internal/crypto/types.ts"; +import { notImplemented } from "ext:deno_node/_utils.ts"; +import { Buffer } from "ext:deno_node/buffer.ts"; +import { BinaryLike } from "ext:deno_node/internal/crypto/types.ts"; export class Certificate { static Certificate = Certificate; diff --git a/ext/node/polyfills/internal/crypto/cipher.ts b/ext/node/polyfills/internal/crypto/cipher.ts index 943783cb3..34776e3ab 100644 --- a/ext/node/polyfills/internal/crypto/cipher.ts +++ b/ext/node/polyfills/internal/crypto/cipher.ts @@ -1,21 +1,21 @@ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. // Copyright Joyent, Inc. and Node.js contributors. All rights reserved. MIT license. -import { ERR_INVALID_ARG_TYPE } from "internal:deno_node/internal/errors.ts"; +import { ERR_INVALID_ARG_TYPE } from "ext:deno_node/internal/errors.ts"; import { validateInt32, validateObject, -} from "internal:deno_node/internal/validators.mjs"; -import { Buffer } from "internal:deno_node/buffer.ts"; -import { notImplemented } from "internal:deno_node/_utils.ts"; -import type { TransformOptions } from "internal:deno_node/_stream.d.ts"; -import { Transform } from "internal:deno_node/_stream.mjs"; -import { KeyObject } from "internal:deno_node/internal/crypto/keys.ts"; -import type { BufferEncoding } from "internal:deno_node/_global.d.ts"; +} from "ext:deno_node/internal/validators.mjs"; +import { Buffer } from "ext:deno_node/buffer.ts"; +import { notImplemented } from "ext:deno_node/_utils.ts"; +import type { TransformOptions } from "ext:deno_node/_stream.d.ts"; +import { Transform } from "ext:deno_node/_stream.mjs"; +import { KeyObject } from "ext:deno_node/internal/crypto/keys.ts"; +import type { BufferEncoding } from "ext:deno_node/_global.d.ts"; import type { BinaryLike, Encoding, -} from "internal:deno_node/internal/crypto/types.ts"; +} from "ext:deno_node/internal/crypto/types.ts"; const { ops } = globalThis.__bootstrap.core; diff --git a/ext/node/polyfills/internal/crypto/diffiehellman.ts b/ext/node/polyfills/internal/crypto/diffiehellman.ts index 6e35ebaf4..3aa1f8080 100644 --- a/ext/node/polyfills/internal/crypto/diffiehellman.ts +++ b/ext/node/polyfills/internal/crypto/diffiehellman.ts @@ -1,28 +1,28 @@ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. // Copyright Joyent, Inc. and Node.js contributors. All rights reserved. MIT license. -import { notImplemented } from "internal:deno_node/_utils.ts"; +import { notImplemented } from "ext:deno_node/_utils.ts"; import { isAnyArrayBuffer, isArrayBufferView, -} from "internal:deno_node/internal/util/types.ts"; -import { ERR_INVALID_ARG_TYPE } from "internal:deno_node/internal/errors.ts"; +} from "ext:deno_node/internal/util/types.ts"; +import { ERR_INVALID_ARG_TYPE } from "ext:deno_node/internal/errors.ts"; import { validateInt32, validateString, -} from "internal:deno_node/internal/validators.mjs"; -import { Buffer } from "internal:deno_node/buffer.ts"; +} from "ext:deno_node/internal/validators.mjs"; +import { Buffer } from "ext:deno_node/buffer.ts"; import { getDefaultEncoding, toBuf, -} from "internal:deno_node/internal/crypto/util.ts"; +} from "ext:deno_node/internal/crypto/util.ts"; import type { BinaryLike, BinaryToTextEncoding, ECDHKeyFormat, -} from "internal:deno_node/internal/crypto/types.ts"; -import { KeyObject } from "internal:deno_node/internal/crypto/keys.ts"; -import type { BufferEncoding } from "internal:deno_node/_global.d.ts"; +} from "ext:deno_node/internal/crypto/types.ts"; +import { KeyObject } from "ext:deno_node/internal/crypto/keys.ts"; +import type { BufferEncoding } from "ext:deno_node/_global.d.ts"; const DH_GENERATOR = 2; diff --git a/ext/node/polyfills/internal/crypto/hash.ts b/ext/node/polyfills/internal/crypto/hash.ts index e2907632f..de7b16297 100644 --- a/ext/node/polyfills/internal/crypto/hash.ts +++ b/ext/node/polyfills/internal/crypto/hash.ts @@ -1,24 +1,24 @@ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. // Copyright Joyent, Inc. and Node.js contributors. All rights reserved. MIT license. -import { TextEncoder } from "internal:deno_web/08_text_encoding.js"; -import { Buffer } from "internal:deno_node/buffer.ts"; -import { Transform } from "internal:deno_node/stream.ts"; +import { TextEncoder } from "ext:deno_web/08_text_encoding.js"; +import { Buffer } from "ext:deno_node/buffer.ts"; +import { Transform } from "ext:deno_node/stream.ts"; import { forgivingBase64Encode as encodeToBase64, forgivingBase64UrlEncode as encodeToBase64Url, -} from "internal:deno_web/00_infra.js"; -import type { TransformOptions } from "internal:deno_node/_stream.d.ts"; -import { validateString } from "internal:deno_node/internal/validators.mjs"; +} from "ext:deno_web/00_infra.js"; +import type { TransformOptions } from "ext:deno_node/_stream.d.ts"; +import { validateString } from "ext:deno_node/internal/validators.mjs"; import type { BinaryToTextEncoding, Encoding, -} from "internal:deno_node/internal/crypto/types.ts"; +} from "ext:deno_node/internal/crypto/types.ts"; import { KeyObject, prepareSecretKey, -} from "internal:deno_node/internal/crypto/keys.ts"; -import { notImplemented } from "internal:deno_node/_utils.ts"; +} from "ext:deno_node/internal/crypto/keys.ts"; +import { notImplemented } from "ext:deno_node/_utils.ts"; const { ops } = globalThis.__bootstrap.core; diff --git a/ext/node/polyfills/internal/crypto/hkdf.ts b/ext/node/polyfills/internal/crypto/hkdf.ts index 1bd652862..deeba102f 100644 --- a/ext/node/polyfills/internal/crypto/hkdf.ts +++ b/ext/node/polyfills/internal/crypto/hkdf.ts @@ -5,28 +5,28 @@ import { validateFunction, validateInteger, validateString, -} from "internal:deno_node/internal/validators.mjs"; +} from "ext:deno_node/internal/validators.mjs"; import { ERR_INVALID_ARG_TYPE, ERR_OUT_OF_RANGE, hideStackFrames, -} from "internal:deno_node/internal/errors.ts"; +} from "ext:deno_node/internal/errors.ts"; import { toBuf, validateByteSource, -} from "internal:deno_node/internal/crypto/util.ts"; +} from "ext:deno_node/internal/crypto/util.ts"; import { createSecretKey, isKeyObject, KeyObject, -} from "internal:deno_node/internal/crypto/keys.ts"; -import type { BinaryLike } from "internal:deno_node/internal/crypto/types.ts"; -import { kMaxLength } from "internal:deno_node/internal/buffer.mjs"; +} from "ext:deno_node/internal/crypto/keys.ts"; +import type { BinaryLike } from "ext:deno_node/internal/crypto/types.ts"; +import { kMaxLength } from "ext:deno_node/internal/buffer.mjs"; import { isAnyArrayBuffer, isArrayBufferView, -} from "internal:deno_node/internal/util/types.ts"; -import { notImplemented } from "internal:deno_node/_utils.ts"; +} from "ext:deno_node/internal/util/types.ts"; +import { notImplemented } from "ext:deno_node/_utils.ts"; const validateParameters = hideStackFrames((hash, key, salt, info, length) => { key = prepareKey(key); diff --git a/ext/node/polyfills/internal/crypto/keygen.ts b/ext/node/polyfills/internal/crypto/keygen.ts index d8cd311a9..dadc9c198 100644 --- a/ext/node/polyfills/internal/crypto/keygen.ts +++ b/ext/node/polyfills/internal/crypto/keygen.ts @@ -1,13 +1,10 @@ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. // Copyright Joyent, Inc. and Node.js contributors. All rights reserved. MIT license. -import { KeyObject } from "internal:deno_node/internal/crypto/keys.ts"; -import { notImplemented } from "internal:deno_node/_utils.ts"; -import { Buffer } from "internal:deno_node/buffer.ts"; -import { - KeyFormat, - KeyType, -} from "internal:deno_node/internal/crypto/types.ts"; +import { KeyObject } from "ext:deno_node/internal/crypto/keys.ts"; +import { notImplemented } from "ext:deno_node/_utils.ts"; +import { Buffer } from "ext:deno_node/buffer.ts"; +import { KeyFormat, KeyType } from "ext:deno_node/internal/crypto/types.ts"; export function generateKey( _type: "hmac" | "aes", diff --git a/ext/node/polyfills/internal/crypto/keys.ts b/ext/node/polyfills/internal/crypto/keys.ts index 9a2800e7f..0348ee0e4 100644 --- a/ext/node/polyfills/internal/crypto/keys.ts +++ b/ext/node/polyfills/internal/crypto/keys.ts @@ -4,30 +4,30 @@ import { kHandle, kKeyObject, -} from "internal:deno_node/internal/crypto/constants.ts"; +} from "ext:deno_node/internal/crypto/constants.ts"; import { ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE, ERR_INVALID_ARG_TYPE, ERR_INVALID_ARG_VALUE, -} from "internal:deno_node/internal/errors.ts"; -import { notImplemented } from "internal:deno_node/_utils.ts"; +} from "ext:deno_node/internal/errors.ts"; +import { notImplemented } from "ext:deno_node/_utils.ts"; import type { KeyFormat, KeyType, PrivateKeyInput, PublicKeyInput, -} from "internal:deno_node/internal/crypto/types.ts"; -import { Buffer } from "internal:deno_node/buffer.ts"; +} from "ext:deno_node/internal/crypto/types.ts"; +import { Buffer } from "ext:deno_node/buffer.ts"; import { isAnyArrayBuffer, isArrayBufferView, -} from "internal:deno_node/internal/util/types.ts"; -import { hideStackFrames } from "internal:deno_node/internal/errors.ts"; +} from "ext:deno_node/internal/util/types.ts"; +import { hideStackFrames } from "ext:deno_node/internal/errors.ts"; import { isCryptoKey as isCryptoKey_, isKeyObject as isKeyObject_, kKeyType, -} from "internal:deno_node/internal/crypto/_keys.ts"; +} from "ext:deno_node/internal/crypto/_keys.ts"; const getArrayBufferOrView = hideStackFrames( ( diff --git a/ext/node/polyfills/internal/crypto/pbkdf2.ts b/ext/node/polyfills/internal/crypto/pbkdf2.ts index efd520f76..c744965ed 100644 --- a/ext/node/polyfills/internal/crypto/pbkdf2.ts +++ b/ext/node/polyfills/internal/crypto/pbkdf2.ts @@ -1,7 +1,7 @@ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. -import { Buffer } from "internal:deno_node/buffer.ts"; -import { createHash } from "internal:deno_node/internal/crypto/hash.ts"; -import { HASH_DATA } from "internal:deno_node/internal/crypto/types.ts"; +import { Buffer } from "ext:deno_node/buffer.ts"; +import { createHash } from "ext:deno_node/internal/crypto/hash.ts"; +import { HASH_DATA } from "ext:deno_node/internal/crypto/types.ts"; export const MAX_ALLOC = Math.pow(2, 30) - 1; diff --git a/ext/node/polyfills/internal/crypto/random.ts b/ext/node/polyfills/internal/crypto/random.ts index def9e639d..cd2333d8c 100644 --- a/ext/node/polyfills/internal/crypto/random.ts +++ b/ext/node/polyfills/internal/crypto/random.ts @@ -1,19 +1,19 @@ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. // Copyright Joyent, Inc. and Node.js contributors. All rights reserved. MIT license. -import { notImplemented } from "internal:deno_node/_utils.ts"; -import randomBytes from "internal:deno_node/internal/crypto/_randomBytes.ts"; +import { notImplemented } from "ext:deno_node/_utils.ts"; +import randomBytes from "ext:deno_node/internal/crypto/_randomBytes.ts"; import randomFill, { randomFillSync, -} from "internal:deno_node/internal/crypto/_randomFill.ts"; -import randomInt from "internal:deno_node/internal/crypto/_randomInt.ts"; +} from "ext:deno_node/internal/crypto/_randomFill.ts"; +import randomInt from "ext:deno_node/internal/crypto/_randomInt.ts"; -export { default as randomBytes } from "internal:deno_node/internal/crypto/_randomBytes.ts"; +export { default as randomBytes } from "ext:deno_node/internal/crypto/_randomBytes.ts"; export { default as randomFill, randomFillSync, -} from "internal:deno_node/internal/crypto/_randomFill.ts"; -export { default as randomInt } from "internal:deno_node/internal/crypto/_randomInt.ts"; +} from "ext:deno_node/internal/crypto/_randomFill.ts"; +export { default as randomInt } from "ext:deno_node/internal/crypto/_randomInt.ts"; export type LargeNumberLike = | ArrayBufferView diff --git a/ext/node/polyfills/internal/crypto/scrypt.ts b/ext/node/polyfills/internal/crypto/scrypt.ts index 46afd0f8a..5e6586906 100644 --- a/ext/node/polyfills/internal/crypto/scrypt.ts +++ b/ext/node/polyfills/internal/crypto/scrypt.ts @@ -23,9 +23,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -import { Buffer } from "internal:deno_node/buffer.ts"; -import { pbkdf2Sync as pbkdf2 } from "internal:deno_node/internal/crypto/pbkdf2.ts"; -import { HASH_DATA } from "internal:deno_node/internal/crypto/types.ts"; +import { Buffer } from "ext:deno_node/buffer.ts"; +import { pbkdf2Sync as pbkdf2 } from "ext:deno_node/internal/crypto/pbkdf2.ts"; +import { HASH_DATA } from "ext:deno_node/internal/crypto/types.ts"; type Opts = Partial<{ N: number; diff --git a/ext/node/polyfills/internal/crypto/sig.ts b/ext/node/polyfills/internal/crypto/sig.ts index 8c9af3b98..d61f82b0e 100644 --- a/ext/node/polyfills/internal/crypto/sig.ts +++ b/ext/node/polyfills/internal/crypto/sig.ts @@ -1,19 +1,19 @@ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. // Copyright Joyent, Inc. and Node.js contributors. All rights reserved. MIT license. -import { notImplemented } from "internal:deno_node/_utils.ts"; -import { validateString } from "internal:deno_node/internal/validators.mjs"; -import { Buffer } from "internal:deno_node/buffer.ts"; -import type { WritableOptions } from "internal:deno_node/_stream.d.ts"; -import Writable from "internal:deno_node/internal/streams/writable.mjs"; +import { notImplemented } from "ext:deno_node/_utils.ts"; +import { validateString } from "ext:deno_node/internal/validators.mjs"; +import { Buffer } from "ext:deno_node/buffer.ts"; +import type { WritableOptions } from "ext:deno_node/_stream.d.ts"; +import Writable from "ext:deno_node/internal/streams/writable.mjs"; import type { BinaryLike, BinaryToTextEncoding, Encoding, PrivateKeyInput, PublicKeyInput, -} from "internal:deno_node/internal/crypto/types.ts"; -import { KeyObject } from "internal:deno_node/internal/crypto/keys.ts"; +} from "ext:deno_node/internal/crypto/types.ts"; +import { KeyObject } from "ext:deno_node/internal/crypto/keys.ts"; export type DSAEncoding = "der" | "ieee-p1363"; diff --git a/ext/node/polyfills/internal/crypto/util.ts b/ext/node/polyfills/internal/crypto/util.ts index 75e8e4ea7..317c1d503 100644 --- a/ext/node/polyfills/internal/crypto/util.ts +++ b/ext/node/polyfills/internal/crypto/util.ts @@ -1,21 +1,21 @@ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. // Copyright Joyent, Inc. and Node.js contributors. All rights reserved. MIT license. -import { notImplemented } from "internal:deno_node/_utils.ts"; -import { Buffer } from "internal:deno_node/buffer.ts"; +import { notImplemented } from "ext:deno_node/_utils.ts"; +import { Buffer } from "ext:deno_node/buffer.ts"; import { ERR_INVALID_ARG_TYPE, hideStackFrames, -} from "internal:deno_node/internal/errors.ts"; +} from "ext:deno_node/internal/errors.ts"; import { isAnyArrayBuffer, isArrayBufferView, -} from "internal:deno_node/internal/util/types.ts"; -import { crypto as constants } from "internal:deno_node/internal_binding/constants.ts"; +} from "ext:deno_node/internal/util/types.ts"; +import { crypto as constants } from "ext:deno_node/internal_binding/constants.ts"; import { kHandle, kKeyObject, -} from "internal:deno_node/internal/crypto/constants.ts"; +} from "ext:deno_node/internal/crypto/constants.ts"; // TODO(kt3k): Generate this list from `digestAlgorithms` // of std/crypto/_wasm/mod.ts diff --git a/ext/node/polyfills/internal/crypto/x509.ts b/ext/node/polyfills/internal/crypto/x509.ts index 4e47e1de6..e18d4fe68 100644 --- a/ext/node/polyfills/internal/crypto/x509.ts +++ b/ext/node/polyfills/internal/crypto/x509.ts @@ -1,12 +1,12 @@ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. // Copyright Joyent, Inc. and Node.js contributors. All rights reserved. MIT license. -import { KeyObject } from "internal:deno_node/internal/crypto/keys.ts"; -import { Buffer } from "internal:deno_node/buffer.ts"; -import { ERR_INVALID_ARG_TYPE } from "internal:deno_node/internal/errors.ts"; -import { isArrayBufferView } from "internal:deno_node/internal/util/types.ts"; -import { notImplemented } from "internal:deno_node/_utils.ts"; -import { BinaryLike } from "internal:deno_node/internal/crypto/types.ts"; +import { KeyObject } from "ext:deno_node/internal/crypto/keys.ts"; +import { Buffer } from "ext:deno_node/buffer.ts"; +import { ERR_INVALID_ARG_TYPE } from "ext:deno_node/internal/errors.ts"; +import { isArrayBufferView } from "ext:deno_node/internal/util/types.ts"; +import { notImplemented } from "ext:deno_node/_utils.ts"; +import { BinaryLike } from "ext:deno_node/internal/crypto/types.ts"; // deno-lint-ignore no-explicit-any export type PeerCertificate = any; |