@zuplo/cli 7.6.9 → 7.6.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/node_modules/@inquirer/checkbox/package.json +3 -3
- package/node_modules/@inquirer/confirm/dist/index.js +1 -1
- package/node_modules/@inquirer/confirm/package.json +3 -3
- package/node_modules/@inquirer/core/dist/lib/create-prompt.js +66 -47
- package/node_modules/@inquirer/core/package.json +2 -2
- package/node_modules/@inquirer/editor/package.json +3 -3
- package/node_modules/@inquirer/expand/package.json +3 -3
- package/node_modules/@inquirer/input/package.json +3 -3
- package/node_modules/@inquirer/number/package.json +3 -3
- package/node_modules/@inquirer/password/package.json +3 -3
- package/node_modules/@inquirer/rawlist/package.json +3 -3
- package/node_modules/@inquirer/search/package.json +3 -3
- package/node_modules/@inquirer/select/package.json +3 -3
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/index.d.ts +1 -2
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jwe/compact/decrypt.d.ts +7 -11
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jwe/compact/encrypt.d.ts +13 -16
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jwe/flattened/decrypt.d.ts +7 -11
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jwe/flattened/encrypt.d.ts +16 -19
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jwe/general/decrypt.d.ts +10 -16
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jwe/general/encrypt.d.ts +18 -21
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jwk/embedded.d.ts +3 -1
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jwk/thumbprint.d.ts +4 -6
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jwks/local.d.ts +5 -4
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jwks/remote.d.ts +20 -21
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jws/compact/sign.d.ts +4 -4
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jws/compact/verify.d.ts +8 -11
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jws/flattened/sign.d.ts +5 -5
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jws/flattened/verify.d.ts +8 -11
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jws/general/sign.d.ts +10 -14
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jws/general/verify.d.ts +11 -17
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jwt/decrypt.d.ts +14 -11
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jwt/encrypt.d.ts +24 -22
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jwt/sign.d.ts +3 -7
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jwt/unsecured.d.ts +2 -6
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jwt/verify.d.ts +13 -6
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/key/export.d.ts +6 -6
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/key/generate_key_pair.d.ts +9 -14
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/key/generate_secret.d.ts +10 -10
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/key/import.d.ts +19 -18
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/types.d.ts +152 -247
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/util/base64url.d.ts +7 -7
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/util/decode_jwt.d.ts +6 -1
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/util/decode_protected_header.d.ts +4 -3
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/util/errors.d.ts +29 -40
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwe/compact/decrypt.js +1 -2
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwe/compact/encrypt.js +9 -26
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwe/flattened/decrypt.js +3 -3
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwe/flattened/encrypt.js +11 -30
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwe/general/decrypt.js +6 -6
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwe/general/encrypt.js +33 -57
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwk/embedded.js +3 -4
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwk/thumbprint.js +3 -6
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwks/local.js +16 -10
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwks/remote.js +2 -2
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jws/compact/sign.js +2 -4
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jws/compact/verify.js +2 -2
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jws/flattened/sign.js +8 -15
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jws/flattened/verify.js +4 -14
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jws/general/sign.js +4 -11
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jws/general/verify.js +5 -7
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwt/decrypt.js +2 -3
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwt/encrypt.js +11 -25
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwt/sign.js +1 -1
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwt/unsecured.js +1 -2
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwt/verify.js +4 -4
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/key/export.js +12 -16
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/key/generate_key_pair.js +4 -13
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/key/generate_secret.js +1 -1
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/key/import.js +5 -9
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/asn1.js +2 -4
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/buffer_utils.js +35 -0
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/content_encryption.js +21 -29
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/deflate.js +9 -19
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/jwe_algorithms.js +0 -4
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/jwe_decrypt.js +21 -54
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/jwe_encrypt.js +26 -59
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/jws_sign.js +29 -43
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/jws_verify.js +37 -45
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/jwt_claims_set.js +1 -1
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/key.js +119 -59
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/key_management.js +45 -80
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/{options.js → validate.js} +64 -3
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/util/base64url.js +5 -19
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/util/decode_jwt.js +1 -1
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/util/decode_protected_header.js +1 -1
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/package.json +1 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/index.d.ts +1 -2
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwe/compact/decrypt.d.ts +7 -11
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwe/compact/encrypt.d.ts +13 -16
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwe/flattened/decrypt.d.ts +7 -11
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwe/flattened/encrypt.d.ts +16 -19
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwe/general/decrypt.d.ts +10 -16
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwe/general/encrypt.d.ts +18 -21
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwk/embedded.d.ts +3 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwk/thumbprint.d.ts +4 -6
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwks/local.d.ts +5 -4
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwks/remote.d.ts +20 -21
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jws/compact/sign.d.ts +4 -4
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jws/compact/verify.d.ts +8 -11
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jws/flattened/sign.d.ts +5 -5
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jws/flattened/verify.d.ts +8 -11
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jws/general/sign.d.ts +10 -14
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jws/general/verify.d.ts +11 -17
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwt/decrypt.d.ts +14 -11
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwt/encrypt.d.ts +24 -22
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwt/sign.d.ts +3 -7
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwt/unsecured.d.ts +2 -6
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwt/verify.d.ts +13 -6
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/key/export.d.ts +6 -6
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/key/generate_key_pair.d.ts +9 -14
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/key/generate_secret.d.ts +10 -10
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/key/import.d.ts +19 -18
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/types.d.ts +152 -247
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/util/base64url.d.ts +7 -7
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/util/decode_jwt.d.ts +6 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/util/decode_protected_header.d.ts +4 -3
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/util/errors.d.ts +29 -40
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwe/compact/decrypt.js +1 -2
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwe/compact/encrypt.js +9 -26
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwe/flattened/decrypt.js +3 -3
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwe/flattened/encrypt.js +11 -30
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwe/general/decrypt.js +6 -6
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwe/general/encrypt.js +33 -57
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwk/embedded.js +3 -4
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwk/thumbprint.js +3 -6
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwks/local.js +16 -10
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwks/remote.js +2 -2
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jws/compact/sign.js +2 -4
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jws/compact/verify.js +2 -2
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jws/flattened/sign.js +8 -15
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jws/flattened/verify.js +4 -14
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jws/general/sign.js +4 -11
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jws/general/verify.js +5 -7
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwt/decrypt.js +2 -3
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwt/encrypt.js +11 -25
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwt/sign.js +1 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwt/unsecured.js +1 -2
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwt/verify.js +4 -4
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/key/export.js +12 -16
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/key/generate_key_pair.js +4 -13
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/key/generate_secret.js +1 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/key/import.js +5 -9
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/asn1.js +2 -4
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/buffer_utils.js +35 -0
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/content_encryption.js +21 -29
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/deflate.js +9 -19
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/jwe_algorithms.js +0 -4
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/jwe_decrypt.js +21 -54
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/jwe_encrypt.js +26 -59
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/jws_sign.js +29 -43
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/jws_verify.js +37 -45
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/jwt_claims_set.js +1 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/key.js +119 -59
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/key_management.js +45 -80
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/{options.js → validate.js} +64 -3
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/util/base64url.js +5 -19
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/util/decode_jwt.js +1 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/util/decode_protected_header.js +1 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/package.json +1 -1
- package/node_modules/@posthog/core/dist/posthog-core.d.ts +14 -0
- package/node_modules/@posthog/core/dist/posthog-core.d.ts.map +1 -1
- package/node_modules/@posthog/core/dist/types.d.ts +1 -0
- package/node_modules/@posthog/core/dist/types.d.ts.map +1 -1
- package/node_modules/@posthog/core/dist/utils/index.d.ts +1 -0
- package/node_modules/@posthog/core/dist/utils/index.d.ts.map +1 -1
- package/node_modules/@posthog/core/dist/utils/index.js +26 -0
- package/node_modules/@posthog/core/dist/utils/index.mjs +1 -0
- package/node_modules/@posthog/core/dist/utils/webview-app-utils.d.ts +12 -0
- package/node_modules/@posthog/core/dist/utils/webview-app-utils.d.ts.map +1 -0
- package/node_modules/@posthog/core/dist/utils/webview-app-utils.js +132 -0
- package/node_modules/@posthog/core/dist/utils/webview-app-utils.mjs +94 -0
- package/node_modules/@posthog/core/package.json +2 -2
- package/node_modules/@posthog/core/src/featureFlagLocalEvaluation.ts +1 -1
- package/node_modules/@posthog/core/src/posthog-core.ts +14 -0
- package/node_modules/@posthog/core/src/types.ts +1 -0
- package/node_modules/@posthog/core/src/utils/index.ts +1 -0
- package/node_modules/@posthog/core/src/utils/otlp-any-value.spec.ts +1 -1
- package/node_modules/@posthog/core/src/utils/type-utils.ts +4 -4
- package/node_modules/@posthog/core/src/utils/webview-app-utils.spec.ts +118 -0
- package/node_modules/@posthog/core/src/utils/webview-app-utils.ts +49 -0
- package/node_modules/@posthog/types/dist/feature-flags.d.ts +1 -1
- package/node_modules/@posthog/types/dist/feature-flags.d.ts.map +1 -1
- package/node_modules/@posthog/types/dist/posthog-config.d.ts +7 -1
- package/node_modules/@posthog/types/dist/posthog-config.d.ts.map +1 -1
- package/node_modules/@posthog/types/package.json +1 -1
- package/node_modules/@posthog/types/src/feature-flags.ts +1 -1
- package/node_modules/@posthog/types/src/posthog-config.ts +7 -1
- package/node_modules/@posthog/types/src/tree-shakeable.ts +1 -1
- package/node_modules/@zuplo/core/package.json +1 -1
- package/node_modules/@zuplo/graphql/package.json +1 -1
- package/node_modules/@zuplo/openapi-tools/package.json +1 -1
- package/node_modules/@zuplo/otel/package.json +1 -1
- package/node_modules/@zuplo/runtime/out/esm/{chunk-Z3IKCP3N.js → chunk-R4PTES5B.js} +93 -93
- package/node_modules/@zuplo/runtime/out/esm/chunk-R4PTES5B.js.map +1 -0
- package/node_modules/@zuplo/runtime/out/esm/index.js +1 -1
- package/node_modules/@zuplo/runtime/out/esm/mcp-gateway/index.js +1 -1
- package/node_modules/@zuplo/runtime/package.json +1 -1
- package/package.json +11 -11
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/base64.js +0 -20
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/crypto_key.js +0 -27
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/helpers.js +0 -45
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/invalid_key_input.js +0 -12
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/is_key_like.js +0 -19
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/jwk_metadata.js +0 -19
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/jwk_to_key.js +0 -10
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/key_options.js +0 -8
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/signing.js +0 -22
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/type_checks.js +0 -30
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/base64.js +0 -20
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/crypto_key.js +0 -27
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/helpers.js +0 -45
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/invalid_key_input.js +0 -12
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/is_key_like.js +0 -19
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/jwk_metadata.js +0 -19
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/jwk_to_key.js +0 -10
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/key_options.js +0 -8
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/signing.js +0 -22
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/type_checks.js +0 -30
- package/node_modules/@zuplo/runtime/out/esm/chunk-Z3IKCP3N.js.map +0 -1
- /package/node_modules/@zuplo/runtime/out/esm/{chunk-Z3IKCP3N.js.LEGAL.txt → chunk-R4PTES5B.js.LEGAL.txt} +0 -0
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { isKeyLike, isCryptoKey } from "./is_key_like.js";
|
|
3
|
-
import { isObject } from "./type_checks.js";
|
|
1
|
+
import { isObject } from "./validate.js";
|
|
4
2
|
import { decode } from "../util/base64url.js";
|
|
5
|
-
import {
|
|
6
|
-
import { normalizeJwk } from "./jwk_metadata.js";
|
|
3
|
+
import { JOSENotSupported } from "../util/errors.js";
|
|
7
4
|
const tag = (key) => key[Symbol.toStringTag], jwkMatchesOp = (entry, key, usage) => {
|
|
8
5
|
const { alg } = entry;
|
|
9
6
|
if (key.use !== void 0) {
|
|
@@ -19,35 +16,44 @@ const tag = (key) => key[Symbol.toStringTag], jwkMatchesOp = (entry, key, usage)
|
|
|
19
16
|
throw new TypeError(`Invalid key for this operation, its "key_ops" must include "${expectedKeyOp}" when present`);
|
|
20
17
|
}
|
|
21
18
|
};
|
|
22
|
-
function
|
|
19
|
+
async function prepareKey(entry, key, usage) {
|
|
23
20
|
const { alg, secret } = entry, privateKey = usage === "decrypt" || usage === "sign";
|
|
24
21
|
if (secret && key instanceof Uint8Array)
|
|
25
|
-
return
|
|
22
|
+
return key;
|
|
23
|
+
let normalized, keyObject;
|
|
26
24
|
if (isObject(key)) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
throw new TypeError(secret ? invalidKeyInput(alg, key, "CryptoKey", "KeyObject", "JSON Web Key", "Uint8Array") : invalidKeyInput(alg, key, "CryptoKey", "KeyObject", "JSON Web Key"));
|
|
25
|
+
if (normalized = normalizeJwk(key), typeof normalized.kty != "string")
|
|
26
|
+
throw invalidKeyType(alg, key, secret);
|
|
30
27
|
if (!(secret ? normalized.kty === "oct" && typeof normalized.k == "string" : normalized.kty !== "oct" && (privateKey ? normalized.kty === "AKP" && typeof normalized.priv == "string" || typeof normalized.d == "string" : normalized.d === void 0 && normalized.priv === void 0)))
|
|
31
28
|
throw new TypeError(secret ? 'JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present' : `JSON Web Key for this operation must be a ${privateKey ? "private" : "public"} JWK`);
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
if (key.type !== "secret")
|
|
38
|
-
throw new TypeError(`${tag(key)} instances for symmetric algorithms must be of type "secret"`);
|
|
39
|
-
} else {
|
|
40
|
-
if (key.type === "secret")
|
|
41
|
-
throw new TypeError(`${tag(key)} instances for asymmetric algorithms must not be of type "secret"`);
|
|
42
|
-
const expectedType = privateKey ? "private" : "public";
|
|
43
|
-
if ((key.type === "public" || key.type === "private") && key.type !== expectedType) {
|
|
44
|
-
const operation = usage === "sign" ? "signing" : usage === "verify" ? "verifying" : `${usage.slice(0, -1)}tion`;
|
|
45
|
-
throw new TypeError(`${tag(key)} instances for asymmetric algorithm ${operation} must be of type "${expectedType}"`);
|
|
29
|
+
if (jwkMatchesOp(entry, normalized, usage), normalized.kty === "oct")
|
|
30
|
+
return decode(normalized.k);
|
|
31
|
+
if (!Object.isFrozen(key)) {
|
|
32
|
+
const { key_ops } = key;
|
|
33
|
+
Array.isArray(key_ops) && Object.freeze(key_ops), Object.freeze(key);
|
|
46
34
|
}
|
|
35
|
+
} else {
|
|
36
|
+
if (!isKeyLike(key))
|
|
37
|
+
throw invalidKeyType(alg, key, secret);
|
|
38
|
+
const expectedType = secret ? "secret" : privateKey ? "private" : "public";
|
|
39
|
+
if (key.type !== expectedType && (secret || ["secret", "public", "private"].includes(key.type)))
|
|
40
|
+
throw new TypeError(`${tag(key)} instances must be of type "${expectedType}" for the ${alg} algorithm`);
|
|
41
|
+
if (isCryptoKey(key))
|
|
42
|
+
return key;
|
|
43
|
+
if (keyObject = key, keyObject.type === "secret")
|
|
44
|
+
return keyObject.export();
|
|
45
|
+
}
|
|
46
|
+
cache ||= /* @__PURE__ */ new WeakMap();
|
|
47
|
+
const cacheKey = key;
|
|
48
|
+
let cached = cache.get(cacheKey);
|
|
49
|
+
if (cached?.[alg])
|
|
50
|
+
return cached[alg];
|
|
51
|
+
if (cached || cache.set(cacheKey, cached = {}), keyObject && typeof keyObject.toCryptoKey == "function") {
|
|
52
|
+
const isPublic = keyObject.type === "public", crv = nist[keyObject.asymmetricKeyDetails?.namedCurve], params = entry.resolve?.({ crv, asymmetricKeyType: keyObject.asymmetricKeyType }) ?? entry.subtle;
|
|
53
|
+
return cached[alg] = keyObject.toCryptoKey(params, isPublic, entry.usages[isPublic ? 0 : 1]);
|
|
47
54
|
}
|
|
48
|
-
return
|
|
55
|
+
return normalized ??= keyObject.export({ format: "jwk" }), normalized.alg = alg, cached[alg] = await jwkToKey(entry, normalized);
|
|
49
56
|
}
|
|
50
|
-
const BYTES = 0, CRYPTO = 1, KEYOBJECT = 2, JWK = 3;
|
|
51
57
|
let cache;
|
|
52
58
|
const nist = {
|
|
53
59
|
__proto__: null,
|
|
@@ -55,41 +61,95 @@ const nist = {
|
|
|
55
61
|
secp384r1: "P-384",
|
|
56
62
|
secp521r1: "P-521"
|
|
57
63
|
};
|
|
58
|
-
function
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
return value && (entry ? entry[alg] = value : cache.set(key, { [alg]: value })), value ?? entry?.[alg];
|
|
64
|
+
function assertCryptoKey(key) {
|
|
65
|
+
if (!isCryptoKey(key))
|
|
66
|
+
throw new Error("CryptoKey instance expected");
|
|
62
67
|
}
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
async function prepareKey(entry, key, usage) {
|
|
71
|
-
const tagged = checkKeyType(entry, key, usage);
|
|
72
|
-
switch (tagged[0]) {
|
|
73
|
-
case BYTES:
|
|
74
|
-
case CRYPTO:
|
|
75
|
-
return tagged[1];
|
|
76
|
-
case JWK: {
|
|
77
|
-
const key2 = tagged[1], normalized = tagged[2];
|
|
78
|
-
if (normalized.kty === "oct")
|
|
79
|
-
return decode(normalized.k);
|
|
80
|
-
if (!Object.isFrozen(key2)) {
|
|
81
|
-
const { key_ops } = key2;
|
|
82
|
-
Array.isArray(key_ops) && Object.freeze(key_ops), Object.freeze(key2);
|
|
83
|
-
}
|
|
84
|
-
return handleJWK(key2, normalized, entry);
|
|
85
|
-
}
|
|
86
|
-
case KEYOBJECT: {
|
|
87
|
-
const keyObject = tagged[1];
|
|
88
|
-
return keyObject.type === "secret" ? keyObject.export() : "toCryptoKey" in keyObject && typeof keyObject.toCryptoKey == "function" ? handleKeyObject(keyObject, entry) : handleJWK(keyObject, keyObject.export({ format: "jwk" }), entry);
|
|
89
|
-
}
|
|
68
|
+
const isCryptoKey = (key) => {
|
|
69
|
+
if (key?.[Symbol.toStringTag] === "CryptoKey")
|
|
70
|
+
return !0;
|
|
71
|
+
try {
|
|
72
|
+
return key instanceof CryptoKey;
|
|
73
|
+
} catch {
|
|
74
|
+
return !1;
|
|
90
75
|
}
|
|
76
|
+
}, isKeyObject = (key) => key?.[Symbol.toStringTag] === "KeyObject", isKeyLike = (key) => isCryptoKey(key) || isKeyObject(key);
|
|
77
|
+
function message(msg, actual, ...types) {
|
|
78
|
+
if (types.length > 2) {
|
|
79
|
+
const last = types.pop();
|
|
80
|
+
msg += `one of type ${types.join(", ")}, or ${last}.`;
|
|
81
|
+
} else types.length === 2 ? msg += `one of type ${types[0]} or ${types[1]}.` : msg += `of type ${types[0]}.`;
|
|
82
|
+
return actual == null ? msg += ` Received ${actual}` : typeof actual == "function" && actual.name ? msg += ` Received function ${actual.name}` : typeof actual == "object" && actual != null && actual.constructor?.name && (msg += ` Received an instance of ${actual.constructor.name}`), msg;
|
|
83
|
+
}
|
|
84
|
+
const invalidKeyInput = (actual, ...types) => message("Key must be ", actual, ...types);
|
|
85
|
+
function invalidKeyType(alg, actual, secret) {
|
|
86
|
+
const types = ["CryptoKey", "KeyObject", "JSON Web Key"];
|
|
87
|
+
return secret && types.push("Uint8Array"), new TypeError(message(`Key for the ${alg} algorithm must be `, actual, ...types));
|
|
88
|
+
}
|
|
89
|
+
const unusable = (name, prop = "algorithm.name") => new TypeError(`CryptoKey does not support this operation, its ${prop} must be ${name}`);
|
|
90
|
+
function checkUsage(key, usage) {
|
|
91
|
+
if (usage && !key.usages.includes(usage))
|
|
92
|
+
throw new TypeError(`CryptoKey does not support this operation, its usages must include ${usage}.`);
|
|
93
|
+
}
|
|
94
|
+
function checkModulusLength(alg, key) {
|
|
95
|
+
const { modulusLength } = key.algorithm;
|
|
96
|
+
if (typeof modulusLength != "number" || modulusLength < 2048)
|
|
97
|
+
throw new TypeError(`${alg} requires key modulusLength to be 2048 bits or larger`);
|
|
98
|
+
}
|
|
99
|
+
function checkCryptoKey(key, expected, usage) {
|
|
100
|
+
const algorithm = key.algorithm;
|
|
101
|
+
if (algorithm.name !== expected.name)
|
|
102
|
+
throw unusable(expected.name);
|
|
103
|
+
if (expected.hash && algorithm.hash?.name !== expected.hash)
|
|
104
|
+
throw unusable(expected.hash, "algorithm.hash");
|
|
105
|
+
if (expected.namedCurve && algorithm.namedCurve !== expected.namedCurve)
|
|
106
|
+
throw unusable(expected.namedCurve, "algorithm.namedCurve");
|
|
107
|
+
if (expected.length !== void 0 && algorithm.length !== expected.length)
|
|
108
|
+
throw unusable(expected.length, "algorithm.length");
|
|
109
|
+
checkUsage(key, usage);
|
|
110
|
+
}
|
|
111
|
+
function snapshotJwk(jwk) {
|
|
112
|
+
return { __proto__: null, ...jwk };
|
|
113
|
+
}
|
|
114
|
+
function normalizeJwk(jwk) {
|
|
115
|
+
const normalized = snapshotJwk(jwk);
|
|
116
|
+
if (normalized.ext !== void 0 && typeof normalized.ext != "boolean")
|
|
117
|
+
throw new TypeError('"ext" (Extractable) Parameter must be a boolean');
|
|
118
|
+
if (normalized.key_ops !== void 0) {
|
|
119
|
+
const value = normalized.key_ops, keyOps = Array.isArray(value) ? [...value] : void 0;
|
|
120
|
+
if (!keyOps || keyOps.some((operation) => typeof operation != "string") || new Set(keyOps).size !== keyOps.length)
|
|
121
|
+
throw new TypeError('"key_ops" (Key Operations) Parameter must be an array of unique strings');
|
|
122
|
+
normalized.key_ops = keyOps;
|
|
123
|
+
}
|
|
124
|
+
return normalized;
|
|
125
|
+
}
|
|
126
|
+
function validateExtractableOption(extractable) {
|
|
127
|
+
if (extractable !== void 0 && typeof extractable != "boolean")
|
|
128
|
+
throw new TypeError('"extractable" option must be a boolean');
|
|
129
|
+
return extractable;
|
|
130
|
+
}
|
|
131
|
+
async function jwkToKey(entry, jwk, extractable) {
|
|
132
|
+
if (!entry.kty.includes(jwk.kty))
|
|
133
|
+
throw new JOSENotSupported('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
|
|
134
|
+
const algorithm = entry.resolve?.({ kty: jwk.kty, crv: jwk.crv }) ?? entry.subtle, isPrivate = !!(jwk.d || jwk.priv), keyData = { ...jwk, ext: extractable ?? jwk.ext };
|
|
135
|
+
return keyData.kty !== "AKP" && delete keyData.alg, delete keyData.use, crypto.subtle.importKey("jwk", keyData, algorithm, keyData.ext ?? !isPrivate, jwk.key_ops ?? entry.usages[isPrivate ? 1 : 0]);
|
|
136
|
+
}
|
|
137
|
+
async function rawKey(key, expected, usage, extractable = !1) {
|
|
138
|
+
return key instanceof Uint8Array && (key = await crypto.subtle.importKey("raw", key, expected, extractable, [usage])), checkCryptoKey(key, expected, usage), key;
|
|
91
139
|
}
|
|
92
140
|
export {
|
|
93
|
-
|
|
94
|
-
|
|
141
|
+
assertCryptoKey,
|
|
142
|
+
checkCryptoKey,
|
|
143
|
+
checkModulusLength,
|
|
144
|
+
checkUsage,
|
|
145
|
+
invalidKeyInput,
|
|
146
|
+
isCryptoKey,
|
|
147
|
+
isKeyLike,
|
|
148
|
+
isKeyObject,
|
|
149
|
+
jwkToKey,
|
|
150
|
+
normalizeJwk,
|
|
151
|
+
prepareKey,
|
|
152
|
+
rawKey,
|
|
153
|
+
snapshotJwk,
|
|
154
|
+
validateExtractableOption
|
|
95
155
|
};
|
|
@@ -1,41 +1,26 @@
|
|
|
1
1
|
import { encode as b64u } from "../util/base64url.js";
|
|
2
|
-
import { prepareKey } from "./key.js";
|
|
3
|
-
import {
|
|
4
|
-
import { jweAlgorithm, jweEncryption } from "./jwe_algorithms.js";
|
|
2
|
+
import { prepareKey, rawKey, jwkToKey, checkCryptoKey, checkModulusLength, checkUsage, assertCryptoKey } from "./key.js";
|
|
3
|
+
import { jweAlgorithm, jweEncryption, isJWECEKTransport } from "./jwe_algorithms.js";
|
|
5
4
|
import { JOSENotSupported, JWEInvalid } from "../util/errors.js";
|
|
6
|
-
import { decodeBase64url,
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { checkCryptoKey, checkModulusLength, checkUsage } from "./crypto_key.js";
|
|
10
|
-
import { concat, encode, uint32be } from "./buffer_utils.js";
|
|
11
|
-
import { assertCryptoKey } from "./is_key_like.js";
|
|
5
|
+
import { decodeBase64url, assertUint8Array, isObject } from "./validate.js";
|
|
6
|
+
import { digest, concat, encode, uint32be } from "./buffer_utils.js";
|
|
7
|
+
import { checkCekLength, generateCek, encrypt, decrypt } from "./content_encryption.js";
|
|
12
8
|
function checkEcdhCryptoKey(key, usage) {
|
|
13
9
|
if (key.algorithm.name !== "ECDH" && key.algorithm.name !== "X25519")
|
|
14
10
|
throw new TypeError("CryptoKey does not support this operation, its algorithm.name must be ECDH or X25519");
|
|
15
11
|
checkUsage(key, usage);
|
|
16
12
|
}
|
|
17
|
-
async function aeskwCryptoKey(key, alg, usage) {
|
|
18
|
-
const expected = jweAlgorithm(alg).subtle, cryptoKey = key instanceof Uint8Array ? await crypto.subtle.importKey("raw", key, "AES-KW", !0, [
|
|
19
|
-
usage
|
|
20
|
-
]) : key;
|
|
21
|
-
return checkCryptoKey(cryptoKey, expected, usage), cryptoKey;
|
|
22
|
-
}
|
|
23
13
|
async function aeskwWrap(alg, key, cek) {
|
|
24
|
-
const cryptoKey = await
|
|
14
|
+
const cryptoKey = await rawKey(key, jweAlgorithm(alg).subtle, "wrapKey", !0), cryptoKeyCek = await crypto.subtle.importKey("raw", cek, { hash: "SHA-256", name: "HMAC" }, !0, ["sign"]);
|
|
25
15
|
return new Uint8Array(await crypto.subtle.wrapKey("raw", cryptoKeyCek, cryptoKey, "AES-KW"));
|
|
26
16
|
}
|
|
27
17
|
async function aeskwUnwrap(alg, key, encryptedKey) {
|
|
28
|
-
const cryptoKey = await
|
|
18
|
+
const cryptoKey = await rawKey(key, jweAlgorithm(alg).subtle, "unwrapKey", !0), cryptoKeyCek = await crypto.subtle.unwrapKey("raw", encryptedKey, cryptoKey, "AES-KW", { hash: "SHA-256", name: "HMAC" }, !0, ["sign"]);
|
|
29
19
|
return new Uint8Array(await crypto.subtle.exportKey("raw", cryptoKeyCek));
|
|
30
20
|
}
|
|
31
21
|
function checkRsaKey(alg, key, usage) {
|
|
32
22
|
checkCryptoKey(key, jweAlgorithm(alg).subtle, usage), checkModulusLength(alg, key);
|
|
33
23
|
}
|
|
34
|
-
function pbes2CryptoKey(key, alg) {
|
|
35
|
-
return key instanceof Uint8Array ? crypto.subtle.importKey("raw", key, "PBKDF2", !1, [
|
|
36
|
-
"deriveBits"
|
|
37
|
-
]) : (checkCryptoKey(key, jweAlgorithm(alg).subtle, "deriveBits"), key);
|
|
38
|
-
}
|
|
39
24
|
async function deriveKey(p2s, alg, p2c, key) {
|
|
40
25
|
if (!(p2s instanceof Uint8Array) || p2s.length < 8)
|
|
41
26
|
throw new JWEInvalid("PBES2 Salt Input must be 8 or more octets");
|
|
@@ -46,7 +31,7 @@ async function deriveKey(p2s, alg, p2c, key) {
|
|
|
46
31
|
iterations: p2c,
|
|
47
32
|
name: "PBKDF2",
|
|
48
33
|
salt
|
|
49
|
-
}, cryptoKey = await
|
|
34
|
+
}, cryptoKey = await rawKey(key, jweAlgorithm(alg).subtle, "deriveBits");
|
|
50
35
|
return new Uint8Array(await crypto.subtle.deriveBits(subtleAlg, cryptoKey, keylen));
|
|
51
36
|
}
|
|
52
37
|
function lengthAndInput(input) {
|
|
@@ -104,19 +89,11 @@ function validateMaxPBES2Count(value) {
|
|
|
104
89
|
}
|
|
105
90
|
async function decryptKeyManagement(entry, enc, key, encryptedKey, joseHeader, maxPBES2Count) {
|
|
106
91
|
const { alg } = entry, mode = entry.mode;
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
case "key-wrapping":
|
|
112
|
-
case "key-encryption":
|
|
113
|
-
case "key-agreement-with-key-wrapping":
|
|
114
|
-
break;
|
|
115
|
-
}
|
|
116
|
-
switch (entry.subtle.name) {
|
|
92
|
+
if (mode === "direct-encryption")
|
|
93
|
+
return assertNoEncryptedKey(encryptedKey), key;
|
|
94
|
+
const direct = mode === "direct-key-agreement";
|
|
95
|
+
switch (direct ? assertNoEncryptedKey(encryptedKey) : assertEncryptedKey(encryptedKey), entry.subtle.name) {
|
|
117
96
|
case "ECDH": {
|
|
118
|
-
const direct = mode === "direct-key-agreement";
|
|
119
|
-
direct && assertNoEncryptedKey(encryptedKey);
|
|
120
97
|
const { epk } = joseHeader;
|
|
121
98
|
if (!isObject(epk) || ["d", "k", "p", "q", "dp", "dq", "qi", "oth", "priv"].some((parameter) => Object.hasOwn(epk, parameter)))
|
|
122
99
|
throw new JWEInvalid('JOSE Header "epk" (Ephemeral Public Key) missing or invalid');
|
|
@@ -124,12 +101,15 @@ async function decryptKeyManagement(entry, enc, key, encryptedKey, joseHeader, m
|
|
|
124
101
|
const ephemeralPublicKey = await jwkToKey(entry, epk), partyUInfo = partyInfo(joseHeader, "apu"), partyVInfo = partyInfo(joseHeader, "apv");
|
|
125
102
|
checkPartyInfo(partyUInfo, partyVInfo);
|
|
126
103
|
const sharedSecret = await ecdhesDeriveKey(ephemeralPublicKey, key, direct ? enc.alg : alg, direct ? enc.cekBits : parseInt(alg.slice(-5, -2), 10), partyUInfo, partyVInfo);
|
|
127
|
-
|
|
104
|
+
if (direct)
|
|
105
|
+
return sharedSecret;
|
|
106
|
+
key = sharedSecret;
|
|
107
|
+
break;
|
|
128
108
|
}
|
|
129
109
|
case "RSA-OAEP":
|
|
130
|
-
return
|
|
110
|
+
return assertCryptoKey(key), checkRsaKey(alg, key, "decrypt"), new Uint8Array(await crypto.subtle.decrypt("RSA-OAEP", key, encryptedKey));
|
|
131
111
|
case "PBKDF2": {
|
|
132
|
-
if (
|
|
112
|
+
if (typeof joseHeader.p2c != "number")
|
|
133
113
|
throw new JWEInvalid('JOSE Header "p2c" (PBES2 Count) missing or invalid');
|
|
134
114
|
validateMaxPBES2Count(maxPBES2Count);
|
|
135
115
|
const p2cLimit = maxPBES2Count ?? 1e4;
|
|
@@ -137,39 +117,35 @@ async function decryptKeyManagement(entry, enc, key, encryptedKey, joseHeader, m
|
|
|
137
117
|
throw new JWEInvalid('JOSE Header "p2c" (PBES2 Count) out is of acceptable bounds');
|
|
138
118
|
if (typeof joseHeader.p2s != "string")
|
|
139
119
|
throw new JWEInvalid('JOSE Header "p2s" (PBES2 Salt) missing or invalid');
|
|
140
|
-
const p2s = decodeBase64url(joseHeader.p2s, "p2s", JWEInvalid)
|
|
141
|
-
|
|
120
|
+
const p2s = decodeBase64url(joseHeader.p2s, "p2s", JWEInvalid);
|
|
121
|
+
key = await deriveKey(p2s, alg, joseHeader.p2c, key);
|
|
122
|
+
break;
|
|
142
123
|
}
|
|
143
|
-
case "AES-KW":
|
|
144
|
-
return assertEncryptedKey(encryptedKey), aeskwUnwrap(alg, key, encryptedKey);
|
|
145
124
|
case "AES-GCM": {
|
|
146
|
-
if (
|
|
125
|
+
if (typeof joseHeader.iv != "string")
|
|
147
126
|
throw new JWEInvalid('JOSE Header "iv" (Initialization Vector) missing or invalid');
|
|
148
127
|
if (typeof joseHeader.tag != "string")
|
|
149
128
|
throw new JWEInvalid('JOSE Header "tag" (Authentication Tag) missing or invalid');
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
let tag;
|
|
153
|
-
if (tag = decodeBase64url(joseHeader.tag, "tag", JWEInvalid), iv.byteLength !== 12)
|
|
129
|
+
const iv = decodeBase64url(joseHeader.iv, "iv", JWEInvalid), tag = decodeBase64url(joseHeader.tag, "tag", JWEInvalid);
|
|
130
|
+
if (iv.byteLength !== 12)
|
|
154
131
|
throw new JWEInvalid("Invalid Initialization Vector length");
|
|
155
132
|
if (tag.byteLength !== 16)
|
|
156
133
|
throw new JWEInvalid("Invalid Authentication Tag length");
|
|
157
134
|
return decrypt(jweEncryption(alg.slice(0, -2)), key, encryptedKey, iv, tag, new Uint8Array());
|
|
158
135
|
}
|
|
159
136
|
}
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
const { alg } = entry,
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
}
|
|
137
|
+
return aeskwUnwrap(alg.slice(-6), key, encryptedKey);
|
|
138
|
+
}
|
|
139
|
+
async function encryptKeyManagement(entry, enc, inputKey, joseHeader, providedCek, providedParameters = {}) {
|
|
140
|
+
const { alg, mode } = entry, transport = isJWECEKTransport(entry);
|
|
141
|
+
if (providedCek !== void 0 && !transport)
|
|
142
|
+
throw new TypeError(`setContentEncryptionKey cannot be called with JWE "alg" (Algorithm) Header ${alg}`);
|
|
143
|
+
let key = await prepareKey(mode === "direct-encryption" ? enc : entry, inputKey, "encrypt");
|
|
144
|
+
if (mode === "direct-encryption")
|
|
145
|
+
return [key, void 0, void 0];
|
|
146
|
+
const cek = transport ? providedCek ?? generateCek(enc) : void 0;
|
|
147
|
+
cek && checkCekLength(cek, enc.cekBits);
|
|
148
|
+
let encryptedKey, parameters;
|
|
173
149
|
switch (entry.subtle.name) {
|
|
174
150
|
case "ECDH": {
|
|
175
151
|
assertEcdhKey(key);
|
|
@@ -186,42 +162,31 @@ async function encryptKeyManagement(entry, enc, key, joseHeader, providedCek, pr
|
|
|
186
162
|
throw new TypeError('CryptoKey for "epk" must be extractable');
|
|
187
163
|
exportableEpk = await subtle.getPublicKey(ephemeralKey, []);
|
|
188
164
|
}
|
|
189
|
-
const { x, y, crv, kty } = await subtle.exportKey("jwk", exportableEpk), direct = mode === "direct-key-agreement", sharedSecret = await ecdhesDeriveKey(key, ephemeralKey, direct ? enc.alg : alg, direct ? enc.cekBits : parseInt(alg.slice(-5, -2), 10), apu, apv);
|
|
190
|
-
if (
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
}
|
|
194
|
-
cek = providedCek ?? generateCek(enc);
|
|
195
|
-
const kwAlg = alg.slice(-6);
|
|
196
|
-
encryptedKey = await aeskwWrap(kwAlg, sharedSecret, cek);
|
|
165
|
+
const { x, y, crv, kty } = await subtle.exportKey("jwk", exportableEpk), direct = mode === "direct-key-agreement", sharedSecret = await ecdhesDeriveKey(key, ephemeralKey, direct ? enc.alg : alg, direct ? enc.cekBits : parseInt(alg.slice(-5, -2), 10), apu, apv), epk = { x, crv, kty };
|
|
166
|
+
if (kty === "EC" && (epk.y = y), parameters = { epk }, providedApu !== void 0 && (parameters.apu = b64u(providedApu)), providedApv !== void 0 && (parameters.apv = b64u(providedApv)), direct)
|
|
167
|
+
return [sharedSecret, void 0, parameters];
|
|
168
|
+
key = sharedSecret;
|
|
197
169
|
break;
|
|
198
170
|
}
|
|
199
171
|
case "RSA-OAEP": {
|
|
200
|
-
|
|
172
|
+
assertCryptoKey(key), checkRsaKey(alg, key, "encrypt"), encryptedKey = new Uint8Array(await crypto.subtle.encrypt("RSA-OAEP", key, cek));
|
|
201
173
|
break;
|
|
202
174
|
}
|
|
203
175
|
case "PBKDF2": {
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
encryptedKey = await aeskwWrap(alg.slice(-6), derived, cek), parameters = { p2c, p2s: b64u(p2s) };
|
|
207
|
-
break;
|
|
208
|
-
}
|
|
209
|
-
case "AES-KW": {
|
|
210
|
-
cek = providedCek ?? generateCek(enc), encryptedKey = await aeskwWrap(alg, key, cek);
|
|
176
|
+
const { p2c = 2048, p2s = crypto.getRandomValues(new Uint8Array(16)) } = providedParameters;
|
|
177
|
+
key = await deriveKey(p2s, alg, p2c, key), parameters = { p2c, p2s: b64u(p2s) };
|
|
211
178
|
break;
|
|
212
179
|
}
|
|
213
180
|
case "AES-GCM": {
|
|
214
|
-
cek = providedCek ?? generateCek(enc);
|
|
215
181
|
const iv = providedParameters.iv === void 0 ? crypto.getRandomValues(new Uint8Array(12)) : providedParameters.iv;
|
|
216
182
|
if (!(iv instanceof Uint8Array))
|
|
217
183
|
throw new TypeError('"iv" must be an instance of Uint8Array');
|
|
218
184
|
const wrapped = await encrypt(jweEncryption(alg.slice(0, -2)), cek, key, iv, new Uint8Array());
|
|
219
185
|
encryptedKey = wrapped.ciphertext, parameters = { iv: b64u(wrapped.iv), tag: b64u(wrapped.tag) };
|
|
220
|
-
break;
|
|
221
186
|
}
|
|
222
187
|
}
|
|
223
|
-
if (cek
|
|
224
|
-
throw new TypeError("
|
|
188
|
+
if (encryptedKey ??= await aeskwWrap(alg.slice(-6), key, cek), !(encryptedKey instanceof Uint8Array) || !encryptedKey.byteLength)
|
|
189
|
+
throw new TypeError("JWE key management algorithm did not produce an Encrypted Key");
|
|
225
190
|
return [cek, encryptedKey, parameters];
|
|
226
191
|
}
|
|
227
192
|
export {
|
|
@@ -1,11 +1,64 @@
|
|
|
1
1
|
import { JOSENotSupported, JWSInvalid } from "../util/errors.js";
|
|
2
|
-
import {
|
|
2
|
+
import { decode } from "../util/base64url.js";
|
|
3
|
+
import { encode, strictDecoder } from "./buffer_utils.js";
|
|
4
|
+
function assertUint8Array(input, label) {
|
|
5
|
+
if (!(input instanceof Uint8Array))
|
|
6
|
+
throw new TypeError(`${label} must be an instance of Uint8Array`);
|
|
7
|
+
}
|
|
8
|
+
function isObject(input) {
|
|
9
|
+
if (typeof input != "object" || input === null || Object.prototype.toString.call(input) !== "[object Object]")
|
|
10
|
+
return !1;
|
|
11
|
+
const prototype = Object.getPrototypeOf(input);
|
|
12
|
+
return prototype === null || Object.getPrototypeOf(prototype) === null;
|
|
13
|
+
}
|
|
14
|
+
function isJwkSet(input) {
|
|
15
|
+
return isObject(input) && Array.isArray(input.keys) && Array.from(input.keys).every(isObject);
|
|
16
|
+
}
|
|
17
|
+
function isDisjoint(...headers) {
|
|
18
|
+
const parameters = /* @__PURE__ */ new Set();
|
|
19
|
+
for (const header of headers)
|
|
20
|
+
if (header)
|
|
21
|
+
for (const parameter of Object.keys(header)) {
|
|
22
|
+
if (parameters.has(parameter))
|
|
23
|
+
return !1;
|
|
24
|
+
parameters.add(parameter);
|
|
25
|
+
}
|
|
26
|
+
return !0;
|
|
27
|
+
}
|
|
28
|
+
function assertNotSet(value, name) {
|
|
29
|
+
if (value !== void 0)
|
|
30
|
+
throw new TypeError(`${name} can only be called once`);
|
|
31
|
+
}
|
|
32
|
+
function decodeBase64url(value, label, ErrorClass) {
|
|
33
|
+
try {
|
|
34
|
+
return decode(value);
|
|
35
|
+
} catch {
|
|
36
|
+
throw new ErrorClass(`Failed to base64url decode the ${label}`);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function encodeBase64url(value, label, ErrorClass) {
|
|
40
|
+
try {
|
|
41
|
+
return encode(value);
|
|
42
|
+
} catch {
|
|
43
|
+
throw new ErrorClass(`The ${label} is not a valid base64url string`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
function parseJoseHeader(b64, ErrorClass, message) {
|
|
47
|
+
let parsed;
|
|
48
|
+
try {
|
|
49
|
+
parsed = JSON.parse(strictDecoder.decode(decode(b64)));
|
|
50
|
+
} catch {
|
|
51
|
+
throw new ErrorClass(message);
|
|
52
|
+
}
|
|
53
|
+
if (!isObject(parsed))
|
|
54
|
+
throw new ErrorClass(message);
|
|
55
|
+
return parsed;
|
|
56
|
+
}
|
|
3
57
|
const JWS_RECOGNIZED = { __proto__: null, b64: !0 }, JWE_RECOGNIZED = { __proto__: null };
|
|
4
58
|
function validateAlgorithms(option, algorithms) {
|
|
5
59
|
if (algorithms !== void 0 && (!Array.isArray(algorithms) || algorithms.some((s) => typeof s != "string")))
|
|
6
60
|
throw new TypeError(`"${option}" option must be an array of strings`);
|
|
7
|
-
|
|
8
|
-
return new Set(algorithms);
|
|
61
|
+
return algorithms === void 0 ? void 0 : new Set(algorithms);
|
|
9
62
|
}
|
|
10
63
|
function validateCritDuplicates(Err, protectedHeader) {
|
|
11
64
|
const { crit } = protectedHeader ?? {};
|
|
@@ -53,6 +106,14 @@ function serializeJoseHeader(Err, header) {
|
|
|
53
106
|
export {
|
|
54
107
|
JWE_RECOGNIZED,
|
|
55
108
|
JWS_RECOGNIZED,
|
|
109
|
+
assertNotSet,
|
|
110
|
+
assertUint8Array,
|
|
111
|
+
decodeBase64url,
|
|
112
|
+
encodeBase64url,
|
|
113
|
+
isDisjoint,
|
|
114
|
+
isJwkSet,
|
|
115
|
+
isObject,
|
|
116
|
+
parseJoseHeader,
|
|
56
117
|
serializeJoseHeader,
|
|
57
118
|
validateAlgorithms,
|
|
58
119
|
validateB64,
|
package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/util/base64url.js
CHANGED
|
@@ -1,28 +1,14 @@
|
|
|
1
|
-
import { encoder, decoder } from "../lib/buffer_utils.js";
|
|
2
|
-
import { encodeBase64, decodeBase64 } from "../lib/base64.js";
|
|
1
|
+
import { encoder, decoder, encodeBase64, decodeBase64 } from "../lib/buffer_utils.js";
|
|
3
2
|
const invalid = "The input to be decoded is not correctly encoded.";
|
|
4
3
|
function decode(input) {
|
|
5
|
-
if (Uint8Array.fromBase64)
|
|
6
|
-
try {
|
|
7
|
-
return Uint8Array.fromBase64(typeof input == "string" ? input : decoder.decode(input), {
|
|
8
|
-
alphabet: "base64url"
|
|
9
|
-
});
|
|
10
|
-
} catch (cause) {
|
|
11
|
-
throw new TypeError(invalid, { cause });
|
|
12
|
-
}
|
|
13
|
-
let encoded = input;
|
|
14
|
-
if (encoded instanceof Uint8Array && (encoded = decoder.decode(encoded)), encoded.includes("+") || encoded.includes("/"))
|
|
15
|
-
throw new TypeError(invalid);
|
|
16
|
-
encoded = encoded.replace(/-/g, "+").replace(/_/g, "/");
|
|
17
4
|
try {
|
|
18
|
-
return decodeBase64(
|
|
19
|
-
} catch {
|
|
20
|
-
throw new TypeError(invalid);
|
|
5
|
+
return decodeBase64(typeof input == "string" ? input : decoder.decode(input), !0);
|
|
6
|
+
} catch (cause) {
|
|
7
|
+
throw new TypeError(invalid, { cause });
|
|
21
8
|
}
|
|
22
9
|
}
|
|
23
10
|
function encode(input) {
|
|
24
|
-
|
|
25
|
-
return typeof unencoded == "string" && (unencoded = encoder.encode(unencoded)), Uint8Array.prototype.toBase64 ? unencoded.toBase64({ alphabet: "base64url", omitPadding: !0 }) : encodeBase64(unencoded).replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_");
|
|
11
|
+
return encodeBase64(typeof input == "string" ? encoder.encode(input) : input, !0);
|
|
26
12
|
}
|
|
27
13
|
export {
|
|
28
14
|
decode,
|
package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/util/decode_jwt.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { decode as b64u } from "./base64url.js";
|
|
2
2
|
import { strictDecoder } from "../lib/buffer_utils.js";
|
|
3
|
-
import { isObject } from "../lib/
|
|
3
|
+
import { isObject } from "../lib/validate.js";
|
|
4
4
|
import { JWTInvalid } from "./errors.js";
|
|
5
5
|
function decodeJwt(jwt) {
|
|
6
6
|
if (typeof jwt != "string")
|
|
@@ -48,8 +48,7 @@ import * as base64url from './util/base64url.js';
|
|
|
48
48
|
export { base64url };
|
|
49
49
|
export type { AnyJWK, CompactDecryptResult, CompactJWEHeaderParameters, CompactJWSHeaderParameters, CompactVerifyResult, CritOption, CryptoKey, DecryptOptions, EncryptOptions, FlattenedDecryptResult, FlattenedJWE, FlattenedJWS, FlattenedJWSInput, FlattenedVerifyResult, GeneralDecryptResult, GeneralJWE, GeneralJWS, GeneralJWSInput, GeneralVerifyResult, GetKeyFunction, JoseHeaderParameters, JSONWebKeySet, JWEContentEncryptionAlgorithm, JWEHeaderParameters, JWEKeyManagementAlgorithm, JWEKeyManagementHeaderParameters, JWK_AKP_Private, JWK_AKP_Public, JWK_EC_Private, JWK_EC_Public, JWK_oct, JWK_OKP_Private, JWK_OKP_Public, JWK_RSA_Private, JWK_RSA_Public, JWK, JWKKeyType, JWKParameters, JWSAlgorithm, JWSHeaderParameters, JWTClaimVerificationOptions, JWTDecryptResult, JWTHeaderParameters, JWTPayload, JWTVerifyResult, KeyInput, KeyObject, ProduceJWT, ResolvedKey, SignOptions, VerifyOptions, } from './types.d.ts';
|
|
50
50
|
/**
|
|
51
|
-
*
|
|
52
|
-
* to `"WebCryptoAPI"`
|
|
51
|
+
* Identified the loaded runtime-specific build in prior releases; now always `"WebCryptoAPI"`.
|
|
53
52
|
*
|
|
54
53
|
* @deprecated Remove any runtime branching on this value; it is always `"WebCryptoAPI"`.
|
|
55
54
|
*/
|
package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwe/compact/decrypt.d.ts
CHANGED
|
@@ -1,28 +1,24 @@
|
|
|
1
1
|
import type * as t from '../../types.d.ts';
|
|
2
|
-
/**
|
|
2
|
+
/** Resolves a key for Compact JWE decryption from unverified headers and token data. */
|
|
3
3
|
export interface CompactDecryptGetKey<KeyType extends t.CryptoKey | Uint8Array = t.CryptoKey | Uint8Array> extends t.GetKeyFunction<t.CompactJWEHeaderParameters, t.FlattenedJWE, KeyType | t.KeyObject | t.JWK> {
|
|
4
4
|
}
|
|
5
5
|
/**
|
|
6
6
|
* Decrypts a Compact JWE.
|
|
7
7
|
*
|
|
8
|
-
* @param key Private
|
|
8
|
+
* @param key Private key or shared secret. See
|
|
9
9
|
* {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}.
|
|
10
10
|
*/
|
|
11
11
|
export declare function compactDecrypt(jwe: string | Uint8Array, key: t.KeyInput, options?: t.DecryptOptions): Promise<t.CompactDecryptResult>;
|
|
12
12
|
/**
|
|
13
|
-
* Decrypts a Compact JWE
|
|
14
|
-
* {@link t.ResolvedKey.key resolved key}.
|
|
13
|
+
* Decrypts a Compact JWE with a dynamically resolved key, included in the result.
|
|
15
14
|
*
|
|
16
|
-
* @param getKey
|
|
17
|
-
* {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}.
|
|
15
|
+
* @param getKey Resolves a private key or shared secret from unverified token data.
|
|
18
16
|
*/
|
|
19
17
|
export declare function compactDecrypt<KeyType extends t.CryptoKey | Uint8Array = t.CryptoKey | Uint8Array>(jwe: string | Uint8Array, getKey: CompactDecryptGetKey<KeyType>, options?: t.DecryptOptions): Promise<t.CompactDecryptResult & t.ResolvedKey<KeyType>>;
|
|
20
18
|
/**
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* function was used.
|
|
19
|
+
* Decrypts a Compact JWE with a key or key resolver. The result includes `key` only when a resolver
|
|
20
|
+
* is used.
|
|
24
21
|
*
|
|
25
|
-
* @param key Private
|
|
26
|
-
* {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}.
|
|
22
|
+
* @param key Private key or shared secret, or a function resolving one.
|
|
27
23
|
*/
|
|
28
24
|
export declare function compactDecrypt(jwe: string | Uint8Array, key: t.KeyInput | CompactDecryptGetKey, options?: t.DecryptOptions): Promise<t.CompactDecryptResult & Partial<t.ResolvedKey>>;
|