@zuplo/cli 7.12.3 → 7.12.5
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/dist/index.js +4 -0
- package/node_modules/@inquirer/checkbox/package.json +3 -3
- package/node_modules/@inquirer/confirm/package.json +3 -3
- package/node_modules/@inquirer/core/dist/lib/create-prompt.js +3 -1
- 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/dist/index.js +1 -1
- 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/README.md +2 -2
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jwe/compact/decrypt.d.ts +5 -4
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jwe/compact/encrypt.d.ts +4 -4
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jwe/flattened/decrypt.d.ts +5 -4
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jwe/flattened/encrypt.d.ts +5 -5
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jwe/general/decrypt.d.ts +5 -4
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jwe/general/encrypt.d.ts +5 -5
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jws/compact/sign.d.ts +5 -4
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jws/compact/verify.d.ts +5 -5
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jws/flattened/sign.d.ts +5 -4
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jws/flattened/verify.d.ts +6 -5
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jws/general/sign.d.ts +9 -6
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jws/general/verify.d.ts +7 -5
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jwt/decrypt.d.ts +7 -6
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jwt/encrypt.d.ts +1 -1
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jwt/sign.d.ts +1 -1
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jwt/unsecured.d.ts +1 -1
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jwt/verify.d.ts +3 -5
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/key/export.d.ts +1 -1
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/key/generate_secret.d.ts +1 -1
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/key/import.d.ts +2 -2
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/types.d.ts +165 -107
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/util/decode_jwt.d.ts +2 -2
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/util/errors.d.ts +1 -1
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwe/general/encrypt.js +3 -3
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwk/thumbprint.js +8 -8
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwks/local.js +2 -1
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwks/remote.js +4 -4
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jws/general/sign.js +3 -3
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jws/general/verify.js +3 -3
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwt/encrypt.js +2 -2
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwt/sign.js +2 -2
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwt/unsecured.js +3 -3
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/key/generate_secret.js +4 -4
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/asn1.js +2 -2
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/buffer_utils.js +4 -4
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/content_encryption.js +8 -8
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/jwe_decrypt.js +14 -14
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/jwe_encrypt.js +3 -3
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/jws_algorithms.js +2 -2
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/jws_sign.js +11 -11
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/jws_verify.js +19 -16
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/jwt_claims_set.js +44 -43
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/key.js +4 -4
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/key_management.js +17 -17
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/validate.js +10 -10
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/util/decode_jwt.js +12 -12
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/util/decode_protected_header.js +5 -5
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/package.json +1 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/README.md +2 -2
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwe/compact/decrypt.d.ts +5 -4
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwe/compact/encrypt.d.ts +4 -4
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwe/flattened/decrypt.d.ts +5 -4
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwe/flattened/encrypt.d.ts +5 -5
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwe/general/decrypt.d.ts +5 -4
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwe/general/encrypt.d.ts +5 -5
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jws/compact/sign.d.ts +5 -4
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jws/compact/verify.d.ts +5 -5
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jws/flattened/sign.d.ts +5 -4
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jws/flattened/verify.d.ts +6 -5
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jws/general/sign.d.ts +9 -6
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jws/general/verify.d.ts +7 -5
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwt/decrypt.d.ts +7 -6
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwt/encrypt.d.ts +1 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwt/sign.d.ts +1 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwt/unsecured.d.ts +1 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwt/verify.d.ts +3 -5
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/key/export.d.ts +1 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/key/generate_secret.d.ts +1 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/key/import.d.ts +2 -2
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/types.d.ts +165 -107
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/util/decode_jwt.d.ts +2 -2
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/util/errors.d.ts +1 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwe/general/encrypt.js +3 -3
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwk/thumbprint.js +8 -8
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwks/local.js +2 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwks/remote.js +4 -4
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jws/general/sign.js +3 -3
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jws/general/verify.js +3 -3
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwt/encrypt.js +2 -2
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwt/sign.js +2 -2
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwt/unsecured.js +3 -3
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/key/generate_secret.js +4 -4
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/asn1.js +2 -2
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/buffer_utils.js +4 -4
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/content_encryption.js +8 -8
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/jwe_decrypt.js +14 -14
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/jwe_encrypt.js +3 -3
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/jws_algorithms.js +2 -2
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/jws_sign.js +11 -11
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/jws_verify.js +19 -16
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/jwt_claims_set.js +44 -43
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/key.js +4 -4
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/key_management.js +17 -17
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/validate.js +10 -10
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/util/decode_jwt.js +12 -12
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/util/decode_protected_header.js +5 -5
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/package.json +1 -1
- package/node_modules/@zuplo/core/customer.cli.minified.js +269 -269
- package/node_modules/@zuplo/core/index.minified.js +275 -275
- 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-3UPXKWR6.js → chunk-RH345HSZ.js} +3 -3
- package/node_modules/@zuplo/runtime/out/esm/chunk-RH345HSZ.js.map +1 -0
- package/node_modules/@zuplo/runtime/out/esm/chunk-WIQFTAJL.js +26 -0
- package/node_modules/@zuplo/runtime/out/esm/chunk-WIQFTAJL.js.map +1 -0
- package/node_modules/@zuplo/runtime/out/esm/{chunk-JBEZQ336.js → chunk-WTWRZT3M.js} +112 -111
- package/node_modules/@zuplo/runtime/out/esm/chunk-WTWRZT3M.js.map +1 -0
- package/node_modules/@zuplo/runtime/out/esm/index.js +1 -1
- package/node_modules/@zuplo/runtime/out/esm/index.js.map +1 -1
- package/node_modules/@zuplo/runtime/out/esm/internal/index.js +1 -1
- package/node_modules/@zuplo/runtime/out/esm/mcp-gateway/index.js +1 -1
- package/node_modules/@zuplo/runtime/out/esm/mocks/index.js +1 -1
- package/node_modules/@zuplo/runtime/out/esm/sdks/aws/index.js +1 -1
- package/node_modules/@zuplo/runtime/out/types/index.d.ts +140 -16
- package/node_modules/@zuplo/runtime/out/types/internal/index.d.ts +93 -16
- package/node_modules/@zuplo/runtime/package.json +1 -1
- package/node_modules/fast-uri/.github/workflows/release.yml +35 -0
- package/node_modules/fast-uri/README.md +8 -0
- package/node_modules/fast-uri/index.js +98 -18
- package/node_modules/fast-uri/lib/utils.js +52 -0
- package/node_modules/fast-uri/package.json +1 -1
- package/node_modules/fast-uri/test/host-delimiter-security.test.js +94 -0
- package/node_modules/fast-uri/test/relative-normalization-security.test.js +156 -0
- package/node_modules/fast-uri/test/reserved-path-normalization.test.js +32 -4
- package/node_modules/fast-uri/test/scheme-validation.test.js +53 -14
- package/package.json +11 -11
- package/node_modules/@zuplo/runtime/out/esm/chunk-3UPXKWR6.js.map +0 -1
- package/node_modules/@zuplo/runtime/out/esm/chunk-GQMNFQTN.js +0 -26
- package/node_modules/@zuplo/runtime/out/esm/chunk-GQMNFQTN.js.map +0 -1
- package/node_modules/@zuplo/runtime/out/esm/chunk-JBEZQ336.js.map +0 -1
- /package/node_modules/@zuplo/runtime/out/esm/{chunk-3UPXKWR6.js.LEGAL.txt → chunk-RH345HSZ.js.LEGAL.txt} +0 -0
- /package/node_modules/@zuplo/runtime/out/esm/{chunk-JBEZQ336.js.LEGAL.txt → chunk-WTWRZT3M.js.LEGAL.txt} +0 -0
|
@@ -16,8 +16,8 @@ function secs(str) {
|
|
|
16
16
|
typeof str != "string" && invalidDuration();
|
|
17
17
|
const matched = REGEX.exec(str);
|
|
18
18
|
(!matched || matched[4] && matched[1]) && invalidDuration();
|
|
19
|
-
const value = parseFloat(matched[2]),
|
|
20
|
-
return Number.isFinite(
|
|
19
|
+
const value = parseFloat(matched[2]), durationSeconds = Math.round(value * multipliers[matched[3][0].toLowerCase()]);
|
|
20
|
+
return Number.isFinite(durationSeconds) || invalidDuration(), matched[1] === "-" || matched[4] === "ago" ? -durationSeconds : durationSeconds;
|
|
21
21
|
}
|
|
22
22
|
function validateInput(label, input) {
|
|
23
23
|
if (!Number.isFinite(input))
|
|
@@ -39,34 +39,35 @@ const normalizeTyp = (value) => {
|
|
|
39
39
|
const normalized = value.toLowerCase();
|
|
40
40
|
return value.includes("/") ? normalized : `application/${normalized}`;
|
|
41
41
|
}, checkAudiencePresence = (audPayload, audOption) => typeof audPayload == "string" ? audOption.includes(audPayload) : Array.isArray(audPayload) ? audOption.some((aud) => audPayload.includes(aud)) : !1;
|
|
42
|
-
function validateNumericDate(
|
|
43
|
-
const value =
|
|
42
|
+
function validateNumericDate(claimsSet, claim, required = !1) {
|
|
43
|
+
const value = claimsSet[claim];
|
|
44
44
|
if (!(value === void 0 && !required)) {
|
|
45
45
|
if (typeof value != "number")
|
|
46
|
-
throw new JWTClaimValidationFailed(`"${claim}" claim must be a number`,
|
|
46
|
+
throw new JWTClaimValidationFailed(`"${claim}" claim must be a number`, claimsSet, claim, "invalid");
|
|
47
47
|
return value;
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
-
function unexpectedClaim(
|
|
51
|
-
throw new JWTClaimValidationFailed(`unexpected "${claim}" claim value`,
|
|
50
|
+
function unexpectedClaim(claimsSet, claim) {
|
|
51
|
+
throw new JWTClaimValidationFailed(`unexpected "${claim}" claim value`, claimsSet, claim, checkFailed);
|
|
52
52
|
}
|
|
53
|
-
function validateClaimsSet(protectedHeader,
|
|
54
|
-
let
|
|
53
|
+
function validateClaimsSet(protectedHeader, claimsSetBytes, options = {}) {
|
|
54
|
+
let claimsSet;
|
|
55
55
|
try {
|
|
56
|
-
|
|
57
|
-
} catch {
|
|
56
|
+
claimsSet = JSON.parse(strictDecoder.decode(claimsSetBytes));
|
|
57
|
+
} catch (cause) {
|
|
58
|
+
throw new JWTInvalid("JWT Claims Set must be a top-level JSON object", { cause });
|
|
58
59
|
}
|
|
59
|
-
if (!isObject(
|
|
60
|
+
if (!isObject(claimsSet))
|
|
60
61
|
throw new JWTInvalid("JWT Claims Set must be a top-level JSON object");
|
|
61
62
|
const { typ } = options;
|
|
62
63
|
if (typ !== void 0 && (typeof protectedHeader.typ != "string" || normalizeTyp(protectedHeader.typ) !== normalizeTyp(typ)))
|
|
63
|
-
throw new JWTClaimValidationFailed('unexpected "typ" JWT header value',
|
|
64
|
+
throw new JWTClaimValidationFailed('unexpected "typ" JWT header value', claimsSet, "typ", checkFailed);
|
|
64
65
|
const { requiredClaims = [], issuer, subject, audience, maxTokenAge } = options, presenceCheck = [...requiredClaims];
|
|
65
66
|
maxTokenAge !== void 0 && presenceCheck.push("iat"), audience !== void 0 && presenceCheck.push("aud"), subject !== void 0 && presenceCheck.push("sub"), issuer !== void 0 && presenceCheck.push("iss");
|
|
66
67
|
for (const claim of new Set(presenceCheck.reverse()))
|
|
67
|
-
if (!Object.hasOwn(
|
|
68
|
-
throw new JWTClaimValidationFailed(`missing required "${claim}" claim`,
|
|
69
|
-
issuer !== void 0 && !(Array.isArray(issuer) ? issuer : [issuer]).includes(
|
|
68
|
+
if (!Object.hasOwn(claimsSet, claim))
|
|
69
|
+
throw new JWTClaimValidationFailed(`missing required "${claim}" claim`, claimsSet, claim, "missing");
|
|
70
|
+
issuer !== void 0 && !(Array.isArray(issuer) ? issuer : [issuer]).includes(claimsSet.iss) && unexpectedClaim(claimsSet, "iss"), subject !== void 0 && claimsSet.sub !== subject && unexpectedClaim(claimsSet, "sub"), audience !== void 0 && !checkAudiencePresence(claimsSet.aud, typeof audience == "string" ? [audience] : audience) && unexpectedClaim(claimsSet, "aud");
|
|
70
71
|
const { clockTolerance } = options;
|
|
71
72
|
let tolerance = 0;
|
|
72
73
|
if (typeof clockTolerance == "string")
|
|
@@ -77,70 +78,70 @@ function validateClaimsSet(protectedHeader, encodedPayload, options = {}) {
|
|
|
77
78
|
tolerance = clockTolerance;
|
|
78
79
|
}
|
|
79
80
|
validateInput("clockTolerance option", tolerance);
|
|
80
|
-
const { currentDate } = options, now = validateInput("currentDate option", epoch(currentDate === void 0 ? /* @__PURE__ */ new Date() : currentDate)), iat = validateNumericDate(
|
|
81
|
+
const { currentDate } = options, now = validateInput("currentDate option", epoch(currentDate === void 0 ? /* @__PURE__ */ new Date() : currentDate)), iat = validateNumericDate(claimsSet, "iat", maxTokenAge !== void 0), nbf = validateNumericDate(claimsSet, "nbf");
|
|
81
82
|
if (nbf !== void 0 && nbf > now + tolerance)
|
|
82
|
-
throw new JWTClaimValidationFailed('"nbf" claim timestamp check failed',
|
|
83
|
-
const exp = validateNumericDate(
|
|
83
|
+
throw new JWTClaimValidationFailed('"nbf" claim timestamp check failed', claimsSet, "nbf", checkFailed);
|
|
84
|
+
const exp = validateNumericDate(claimsSet, "exp");
|
|
84
85
|
if (exp !== void 0 && exp <= now - tolerance)
|
|
85
|
-
throw new JWTExpired('"exp" claim timestamp check failed',
|
|
86
|
+
throw new JWTExpired('"exp" claim timestamp check failed', claimsSet, "exp", checkFailed);
|
|
86
87
|
if (maxTokenAge !== void 0) {
|
|
87
88
|
const age = now - iat, max = validateInput("maxTokenAge option", typeof maxTokenAge == "number" ? maxTokenAge : secs(maxTokenAge));
|
|
88
89
|
if (age - tolerance > max)
|
|
89
|
-
throw new JWTExpired('"iat" claim timestamp check failed (too far in the past)',
|
|
90
|
+
throw new JWTExpired('"iat" claim timestamp check failed (too far in the past)', claimsSet, "iat", checkFailed);
|
|
90
91
|
if (age < -tolerance)
|
|
91
|
-
throw new JWTClaimValidationFailed('"iat" claim timestamp check failed (it should be in the past)',
|
|
92
|
+
throw new JWTClaimValidationFailed('"iat" claim timestamp check failed (it should be in the past)', claimsSet, "iat", checkFailed);
|
|
92
93
|
}
|
|
93
|
-
return
|
|
94
|
+
return claimsSet;
|
|
94
95
|
}
|
|
95
|
-
let
|
|
96
|
-
function
|
|
97
|
-
return
|
|
96
|
+
let producerClaimsSets;
|
|
97
|
+
function producerClaimsSet(producer) {
|
|
98
|
+
return producerClaimsSets.get(producer);
|
|
98
99
|
}
|
|
99
|
-
function
|
|
100
|
-
const
|
|
100
|
+
function jwtClaimsSetBytes(producer) {
|
|
101
|
+
const claimsSet = producerClaimsSet(producer);
|
|
101
102
|
for (const claim of ["iat", "nbf", "exp"]) {
|
|
102
|
-
const value =
|
|
103
|
+
const value = claimsSet[claim];
|
|
103
104
|
if (typeof value == "number" && !Number.isFinite(value))
|
|
104
105
|
throw new TypeError(`"${claim}" claim must be a finite number`);
|
|
105
106
|
}
|
|
106
|
-
return encoder.encode(JSON.stringify(
|
|
107
|
+
return encoder.encode(JSON.stringify(claimsSet));
|
|
107
108
|
}
|
|
108
109
|
function jwtClaim(producer, claim) {
|
|
109
|
-
return
|
|
110
|
+
return producerClaimsSet(producer)[claim];
|
|
110
111
|
}
|
|
111
112
|
class JWTClaimsBuilder {
|
|
112
|
-
constructor(
|
|
113
|
-
if (!isObject(
|
|
113
|
+
constructor(claimsSet = {}) {
|
|
114
|
+
if (!isObject(claimsSet))
|
|
114
115
|
throw new TypeError("JWT Claims Set MUST be an object");
|
|
115
|
-
(
|
|
116
|
+
(producerClaimsSets ||= /* @__PURE__ */ new WeakMap()).set(this, structuredClone(claimsSet));
|
|
116
117
|
}
|
|
117
118
|
setIssuer(value) {
|
|
118
|
-
return validateStringClaim("iss", value),
|
|
119
|
+
return validateStringClaim("iss", value), producerClaimsSet(this).iss = value, this;
|
|
119
120
|
}
|
|
120
121
|
setSubject(value) {
|
|
121
|
-
return validateStringClaim("sub", value),
|
|
122
|
+
return validateStringClaim("sub", value), producerClaimsSet(this).sub = value, this;
|
|
122
123
|
}
|
|
123
124
|
setAudience(value) {
|
|
124
|
-
return validateAudienceClaim(value),
|
|
125
|
+
return validateAudienceClaim(value), producerClaimsSet(this).aud = value, this;
|
|
125
126
|
}
|
|
126
127
|
setJti(value) {
|
|
127
|
-
return validateStringClaim("jti", value),
|
|
128
|
+
return validateStringClaim("jti", value), producerClaimsSet(this).jti = value, this;
|
|
128
129
|
}
|
|
129
130
|
setNotBefore(value) {
|
|
130
|
-
return
|
|
131
|
+
return producerClaimsSet(this).nbf = numericDate(value, "setNotBefore"), this;
|
|
131
132
|
}
|
|
132
133
|
setExpirationTime(value) {
|
|
133
|
-
return
|
|
134
|
+
return producerClaimsSet(this).exp = numericDate(value, "setExpirationTime"), this;
|
|
134
135
|
}
|
|
135
136
|
setIssuedAt(value) {
|
|
136
|
-
const
|
|
137
|
-
return value === void 0 ?
|
|
137
|
+
const claimsSet = producerClaimsSet(this);
|
|
138
|
+
return value === void 0 ? claimsSet.iat = epoch(/* @__PURE__ */ new Date()) : typeof value == "string" ? claimsSet.iat = validateInput("setIssuedAt", epoch(/* @__PURE__ */ new Date()) + secs(value)) : claimsSet.iat = numericDate(value, "setIssuedAt"), this;
|
|
138
139
|
}
|
|
139
140
|
}
|
|
140
141
|
export {
|
|
141
142
|
JWTClaimsBuilder,
|
|
142
143
|
jwtClaim,
|
|
143
|
-
|
|
144
|
+
jwtClaimsSetBytes,
|
|
144
145
|
secs,
|
|
145
146
|
validateClaimsSet
|
|
146
147
|
};
|
|
@@ -17,15 +17,15 @@ const tag = (key) => key[Symbol.toStringTag], jwkMatchesOp = (entry, key, usage)
|
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
19
|
async function prepareKey(entry, key, usage) {
|
|
20
|
-
const { alg, secret } = entry,
|
|
20
|
+
const { alg, secret } = entry, requiresPrivateKey = usage === "decrypt" || usage === "sign";
|
|
21
21
|
if (secret && key instanceof Uint8Array)
|
|
22
22
|
return key;
|
|
23
23
|
let normalized, keyObject;
|
|
24
24
|
if (isObject(key)) {
|
|
25
25
|
if (normalized = normalizeJwk(key), typeof normalized.kty != "string")
|
|
26
26
|
throw invalidKeyType(alg, key, secret);
|
|
27
|
-
if (!(secret ? normalized.kty === "oct" && typeof normalized.k == "string" : normalized.kty !== "oct" && (
|
|
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 ${
|
|
27
|
+
if (!(secret ? normalized.kty === "oct" && typeof normalized.k == "string" : normalized.kty !== "oct" && (requiresPrivateKey ? normalized.kty === "AKP" && typeof normalized.priv == "string" || typeof normalized.d == "string" : normalized.d === void 0 && normalized.priv === void 0)))
|
|
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 ${requiresPrivateKey ? "private" : "public"} JWK`);
|
|
29
29
|
if (jwkMatchesOp(entry, normalized, usage), normalized.kty === "oct")
|
|
30
30
|
return decode(normalized.k);
|
|
31
31
|
if (!Object.isFrozen(key)) {
|
|
@@ -35,7 +35,7 @@ async function prepareKey(entry, key, usage) {
|
|
|
35
35
|
} else {
|
|
36
36
|
if (!isKeyLike(key))
|
|
37
37
|
throw invalidKeyType(alg, key, secret);
|
|
38
|
-
const expectedType = secret ? "secret" :
|
|
38
|
+
const expectedType = secret ? "secret" : requiresPrivateKey ? "private" : "public";
|
|
39
39
|
if (key.type !== expectedType && (secret || ["secret", "public", "private"].includes(key.type)))
|
|
40
40
|
throw new TypeError(`${tag(key)} instances must be of type "${expectedType}" for the ${alg} algorithm`);
|
|
41
41
|
if (isCryptoKey(key))
|
|
@@ -26,32 +26,32 @@ async function deriveKey(p2s, alg, p2c, key) {
|
|
|
26
26
|
throw new JWEInvalid("PBES2 Salt Input must be 8 or more octets");
|
|
27
27
|
if (!Number.isSafeInteger(p2c) || Math.sign(p2c) !== 1)
|
|
28
28
|
throw new JWEInvalid("PBES2 Count Input must be a positive integer");
|
|
29
|
-
const salt = concat(encode(alg), Uint8Array.of(0), p2s),
|
|
29
|
+
const salt = concat(encode(alg), Uint8Array.of(0), p2s), keyLengthBits = parseInt(alg.slice(13, 16), 10), subtleAlg = {
|
|
30
30
|
hash: `SHA-${alg.slice(8, 11)}`,
|
|
31
31
|
iterations: p2c,
|
|
32
32
|
name: "PBKDF2",
|
|
33
33
|
salt
|
|
34
34
|
}, cryptoKey = await rawKey(key, jweAlgorithm(alg).subtle, "deriveBits");
|
|
35
|
-
return new Uint8Array(await crypto.subtle.deriveBits(subtleAlg, cryptoKey,
|
|
35
|
+
return new Uint8Array(await crypto.subtle.deriveBits(subtleAlg, cryptoKey, keyLengthBits));
|
|
36
36
|
}
|
|
37
37
|
function lengthAndInput(input) {
|
|
38
38
|
return concat(uint32be(input.length), input);
|
|
39
39
|
}
|
|
40
|
-
async function concatKdf(Z,
|
|
41
|
-
const dkLen =
|
|
40
|
+
async function concatKdf(Z, keyDataLength, OtherInfo) {
|
|
41
|
+
const dkLen = keyDataLength >> 3, hashLen = 32, reps = Math.ceil(dkLen / hashLen), dk = new Uint8Array(reps * hashLen);
|
|
42
42
|
for (let i = 1; i <= reps; i++) {
|
|
43
43
|
const hashResult = await digest("sha256", concat(uint32be(i), Z, OtherInfo));
|
|
44
44
|
dk.set(hashResult, (i - 1) * hashLen);
|
|
45
45
|
}
|
|
46
46
|
return dk.slice(0, dkLen);
|
|
47
47
|
}
|
|
48
|
-
async function ecdhesDeriveKey(publicKey, privateKey,
|
|
48
|
+
async function ecdhesDeriveKey(publicKey, privateKey, algorithmId, keyDataLength, apu = new Uint8Array(), apv = new Uint8Array()) {
|
|
49
49
|
checkEcdhCryptoKey(publicKey), checkEcdhCryptoKey(privateKey, "deriveBits");
|
|
50
|
-
const otherInfo = concat(lengthAndInput(encode(
|
|
50
|
+
const otherInfo = concat(lengthAndInput(encode(algorithmId)), lengthAndInput(apu), lengthAndInput(apv), uint32be(keyDataLength)), Z = new Uint8Array(await crypto.subtle.deriveBits({
|
|
51
51
|
name: publicKey.algorithm.name,
|
|
52
52
|
public: publicKey
|
|
53
53
|
}, privateKey, publicKey.algorithm.name === "X25519" ? 256 : Math.ceil(parseInt(publicKey.algorithm.namedCurve.slice(-3), 10) / 8) << 3));
|
|
54
|
-
return concatKdf(Z,
|
|
54
|
+
return concatKdf(Z, keyDataLength, otherInfo);
|
|
55
55
|
}
|
|
56
56
|
function assertEcdhKey(key) {
|
|
57
57
|
assertCryptoKey(key);
|
|
@@ -100,10 +100,10 @@ async function decryptKeyManagement(entry, enc, key, encryptedKey, joseHeader, m
|
|
|
100
100
|
assertEcdhKey(key);
|
|
101
101
|
const ephemeralPublicKey = await jwkToKey(entry, epk), partyUInfo = partyInfo(joseHeader, "apu"), partyVInfo = partyInfo(joseHeader, "apv");
|
|
102
102
|
checkPartyInfo(partyUInfo, partyVInfo);
|
|
103
|
-
const
|
|
103
|
+
const derivedKey = await ecdhesDeriveKey(ephemeralPublicKey, key, direct ? enc.alg : alg, direct ? enc.cekBits : parseInt(alg.slice(-5, -2), 10), partyUInfo, partyVInfo);
|
|
104
104
|
if (direct)
|
|
105
|
-
return
|
|
106
|
-
key =
|
|
105
|
+
return derivedKey;
|
|
106
|
+
key = derivedKey;
|
|
107
107
|
break;
|
|
108
108
|
}
|
|
109
109
|
case "RSA-OAEP":
|
|
@@ -153,19 +153,19 @@ async function encryptKeyManagement(entry, enc, inputKey, joseHeader, providedCe
|
|
|
153
153
|
providedApu !== void 0 && assertUint8Array(providedApu, '"apu"'), providedApv !== void 0 && assertUint8Array(providedApv, '"apv"');
|
|
154
154
|
const apu = providedApu ?? partyInfo(joseHeader, "apu"), apv = providedApv ?? partyInfo(joseHeader, "apv");
|
|
155
155
|
checkPartyInfo(apu, apv);
|
|
156
|
-
let
|
|
157
|
-
providedParameters.epk !== void 0 ?
|
|
156
|
+
let ephemeralPrivateKey;
|
|
157
|
+
providedParameters.epk !== void 0 ? ephemeralPrivateKey = await prepareKey(entry, providedParameters.epk, "decrypt") : ephemeralPrivateKey = (await crypto.subtle.generateKey(key.algorithm, !0, ["deriveBits"])).privateKey;
|
|
158
158
|
const subtle = crypto.subtle;
|
|
159
|
-
let exportableEpk =
|
|
159
|
+
let exportableEpk = ephemeralPrivateKey;
|
|
160
160
|
if (!exportableEpk.extractable) {
|
|
161
161
|
if (typeof subtle.getPublicKey != "function")
|
|
162
162
|
throw new TypeError('CryptoKey for "epk" must be extractable');
|
|
163
|
-
exportableEpk = await subtle.getPublicKey(
|
|
163
|
+
exportableEpk = await subtle.getPublicKey(ephemeralPrivateKey, []);
|
|
164
164
|
}
|
|
165
|
-
const { x, y, crv, kty } = await subtle.exportKey("jwk", exportableEpk), direct = mode === "direct-key-agreement",
|
|
165
|
+
const { x, y, crv, kty } = await subtle.exportKey("jwk", exportableEpk), direct = mode === "direct-key-agreement", derivedKey = await ecdhesDeriveKey(key, ephemeralPrivateKey, direct ? enc.alg : alg, direct ? enc.cekBits : parseInt(alg.slice(-5, -2), 10), apu, apv), epk = { x, crv, kty };
|
|
166
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 [
|
|
168
|
-
key =
|
|
167
|
+
return [derivedKey, void 0, parameters];
|
|
168
|
+
key = derivedKey;
|
|
169
169
|
break;
|
|
170
170
|
}
|
|
171
171
|
case "RSA-OAEP": {
|
package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/validate.js
CHANGED
|
@@ -32,23 +32,23 @@ function assertNotSet(value, name) {
|
|
|
32
32
|
function decodeBase64url(value, label, ErrorClass) {
|
|
33
33
|
try {
|
|
34
34
|
return decode(value);
|
|
35
|
-
} catch {
|
|
36
|
-
throw new ErrorClass(`Failed to base64url decode the ${label}
|
|
35
|
+
} catch (cause) {
|
|
36
|
+
throw new ErrorClass(`Failed to base64url decode the ${label}`, { cause });
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function encodeAsciiMember(value, label, ErrorClass) {
|
|
40
40
|
try {
|
|
41
41
|
return encode(value);
|
|
42
|
-
} catch {
|
|
43
|
-
throw new ErrorClass(`The ${label} is not a valid base64url string
|
|
42
|
+
} catch (cause) {
|
|
43
|
+
throw new ErrorClass(`The ${label} is not a valid base64url string`, { cause });
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
function parseJoseHeader(
|
|
46
|
+
function parseJoseHeader(encodedProtectedHeader, ErrorClass, message) {
|
|
47
47
|
let parsed;
|
|
48
48
|
try {
|
|
49
|
-
parsed = JSON.parse(strictDecoder.decode(decode(
|
|
50
|
-
} catch {
|
|
51
|
-
throw new ErrorClass(message);
|
|
49
|
+
parsed = JSON.parse(strictDecoder.decode(decode(encodedProtectedHeader)));
|
|
50
|
+
} catch (cause) {
|
|
51
|
+
throw new ErrorClass(message, { cause });
|
|
52
52
|
}
|
|
53
53
|
if (!isObject(parsed))
|
|
54
54
|
throw new ErrorClass(message);
|
|
@@ -109,7 +109,7 @@ export {
|
|
|
109
109
|
assertNotSet,
|
|
110
110
|
assertUint8Array,
|
|
111
111
|
decodeBase64url,
|
|
112
|
-
|
|
112
|
+
encodeAsciiMember,
|
|
113
113
|
isDisjoint,
|
|
114
114
|
isJwkSet,
|
|
115
115
|
isObject,
|
package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/util/decode_jwt.js
CHANGED
|
@@ -5,28 +5,28 @@ import { JWTInvalid } from "./errors.js";
|
|
|
5
5
|
function decodeJwt(jwt) {
|
|
6
6
|
if (typeof jwt != "string")
|
|
7
7
|
throw new JWTInvalid("JWTs must use Compact JWS serialization, JWT must be a string");
|
|
8
|
-
const { 1:
|
|
8
|
+
const { 1: encodedPayload, length } = jwt.split(".");
|
|
9
9
|
if (length === 5)
|
|
10
10
|
throw new JWTInvalid("Only JWTs using Compact JWS serialization can be decoded");
|
|
11
11
|
if (length !== 3)
|
|
12
12
|
throw new JWTInvalid("Invalid JWT");
|
|
13
|
-
if (!
|
|
13
|
+
if (!encodedPayload)
|
|
14
14
|
throw new JWTInvalid("JWTs must contain a payload");
|
|
15
|
-
let
|
|
15
|
+
let claimsSetBytes;
|
|
16
16
|
try {
|
|
17
|
-
|
|
18
|
-
} catch {
|
|
19
|
-
throw new JWTInvalid("Failed to base64url decode the payload");
|
|
17
|
+
claimsSetBytes = b64u(encodedPayload);
|
|
18
|
+
} catch (cause) {
|
|
19
|
+
throw new JWTInvalid("Failed to base64url decode the payload", { cause });
|
|
20
20
|
}
|
|
21
|
-
let
|
|
21
|
+
let claimsSet;
|
|
22
22
|
try {
|
|
23
|
-
|
|
24
|
-
} catch {
|
|
25
|
-
throw new JWTInvalid("Failed to parse the decoded payload as JSON");
|
|
23
|
+
claimsSet = JSON.parse(strictDecoder.decode(claimsSetBytes));
|
|
24
|
+
} catch (cause) {
|
|
25
|
+
throw new JWTInvalid("Failed to parse the decoded payload as JSON", { cause });
|
|
26
26
|
}
|
|
27
|
-
if (!isObject(
|
|
27
|
+
if (!isObject(claimsSet))
|
|
28
28
|
throw new JWTInvalid("Invalid JWT Claims Set");
|
|
29
|
-
return
|
|
29
|
+
return claimsSet;
|
|
30
30
|
}
|
|
31
31
|
export {
|
|
32
32
|
decodeJwt
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { parseJoseHeader } from "../lib/validate.js";
|
|
2
2
|
function decodeProtectedHeader(token) {
|
|
3
|
-
let
|
|
3
|
+
let encodedProtectedHeader;
|
|
4
4
|
if (typeof token == "string") {
|
|
5
5
|
const parts = token.split(".");
|
|
6
|
-
(parts.length === 3 || parts.length === 5) && ([
|
|
6
|
+
(parts.length === 3 || parts.length === 5) && ([encodedProtectedHeader] = parts);
|
|
7
7
|
} else if (typeof token == "object" && token)
|
|
8
8
|
if ("protected" in token)
|
|
9
|
-
|
|
9
|
+
encodedProtectedHeader = token.protected;
|
|
10
10
|
else
|
|
11
11
|
throw new TypeError("Token does not contain a Protected Header");
|
|
12
12
|
const invalid = "Invalid Token or Protected Header formatting";
|
|
13
|
-
if (typeof
|
|
13
|
+
if (typeof encodedProtectedHeader != "string" || !encodedProtectedHeader)
|
|
14
14
|
throw new TypeError(invalid);
|
|
15
|
-
return parseJoseHeader(
|
|
15
|
+
return parseJoseHeader(encodedProtectedHeader, TypeError, invalid);
|
|
16
16
|
}
|
|
17
17
|
export {
|
|
18
18
|
decodeProtectedHeader
|
|
@@ -70,7 +70,7 @@ The `jose` module supports importing, exporting, and generating keys and secrets
|
|
|
70
70
|
|
|
71
71
|
### JSON Web Signature (JWS)
|
|
72
72
|
|
|
73
|
-
The `jose` module supports
|
|
73
|
+
The `jose` module supports digital signature and MAC computation and validation over arbitrary JWS Payloads using the JWS Compact Serialization and the flattened and general JWS JSON Serialization syntaxes ([RFC 7515, Section 7](https://www.rfc-editor.org/info/rfc7515/#section-7)).
|
|
74
74
|
|
|
75
75
|
- Signing - [Compact](docs/jws/compact/sign/classes/CompactSign.md), [Flattened JSON](docs/jws/flattened/sign/classes/FlattenedSign.md), [General JSON](docs/jws/general/sign/classes/GeneralSign.md)
|
|
76
76
|
- Verification - [Compact](docs/jws/compact/verify/functions/compactVerify.md), [Flattened JSON](docs/jws/flattened/verify/functions/flattenedVerify.md), [General JSON](docs/jws/general/verify/functions/generalVerify.md)
|
|
@@ -81,7 +81,7 @@ The `jose` module supports signing and verification of JWS messages with arbitra
|
|
|
81
81
|
|
|
82
82
|
### JSON Web Encryption (JWE)
|
|
83
83
|
|
|
84
|
-
The `jose` module supports encryption and decryption of
|
|
84
|
+
The `jose` module supports encryption and authenticated decryption of arbitrary plaintext using the JWE Compact Serialization and the flattened and general JWE JSON Serialization syntaxes ([RFC 7516, Section 7](https://www.rfc-editor.org/info/rfc7516/#section-7)).
|
|
85
85
|
|
|
86
86
|
- Encryption - [Compact](docs/jwe/compact/encrypt/classes/CompactEncrypt.md), [Flattened JSON](docs/jwe/flattened/encrypt/classes/FlattenedEncrypt.md), [General JSON](docs/jwe/general/encrypt/classes/GeneralEncrypt.md)
|
|
87
87
|
- Decryption - [Compact](docs/jwe/compact/decrypt/functions/compactDecrypt.md), [Flattened JSON](docs/jwe/flattened/decrypt/functions/flattenedDecrypt.md), [General JSON](docs/jwe/general/decrypt/functions/generalDecrypt.md)
|
package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwe/compact/decrypt.d.ts
CHANGED
|
@@ -3,21 +3,22 @@ import type * as t from '../../types.d.ts';
|
|
|
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
|
+
* Authenticates and decrypts a JWE Compact Serialization.
|
|
7
7
|
*
|
|
8
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
|
-
*
|
|
13
|
+
* Authenticates and decrypts a JWE Compact Serialization with a dynamically resolved key, included
|
|
14
|
+
* in the result.
|
|
14
15
|
*
|
|
15
16
|
* @param getKey Resolves a private key or shared secret from unverified token data.
|
|
16
17
|
*/
|
|
17
18
|
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>>;
|
|
18
19
|
/**
|
|
19
|
-
*
|
|
20
|
-
* is used.
|
|
20
|
+
* Authenticates and decrypts a JWE Compact Serialization with a key or key resolver. The result
|
|
21
|
+
* includes `key` only when a resolver is used.
|
|
21
22
|
*
|
|
22
23
|
* @param key Private key or shared secret, or a function resolving one.
|
|
23
24
|
*/
|
package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwe/compact/encrypt.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type * as t from '../../types.d.ts';
|
|
2
|
-
/**
|
|
2
|
+
/** Produces JWE Compact Serialization using authenticated encryption. */
|
|
3
3
|
export declare class CompactEncrypt {
|
|
4
4
|
#private;
|
|
5
5
|
/**
|
|
6
|
-
* Creates
|
|
6
|
+
* Creates an encryptor for JWE Compact Serialization.
|
|
7
7
|
*
|
|
8
8
|
* @param plaintext Binary representation of the plaintext to encrypt.
|
|
9
9
|
*/
|
|
@@ -26,12 +26,12 @@ export declare class CompactEncrypt {
|
|
|
26
26
|
setProtectedHeader(protectedHeader: t.CompactJWEHeaderParameters): this;
|
|
27
27
|
/**
|
|
28
28
|
* Sets key management inputs such as ECDH-ES "apu"/"apv" or PBES2 "p2c". Use this method instead
|
|
29
|
-
* of header setters; the resulting parameters are added to the JOSE
|
|
29
|
+
* of header setters; the resulting parameters are added to the JOSE Header. May only be called
|
|
30
30
|
* once.
|
|
31
31
|
*/
|
|
32
32
|
setKeyManagementParameters(parameters: t.JWEKeyManagementHeaderParameters): this;
|
|
33
33
|
/**
|
|
34
|
-
* Encrypts the plaintext
|
|
34
|
+
* Encrypts the plaintext and returns the JWE Compact Serialization.
|
|
35
35
|
*
|
|
36
36
|
* @param key Public key or shared secret. See
|
|
37
37
|
* {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}.
|
|
@@ -3,21 +3,22 @@ import type * as t from '../../types.d.ts';
|
|
|
3
3
|
export interface FlattenedDecryptGetKey<KeyType extends t.CryptoKey | Uint8Array = t.CryptoKey | Uint8Array> extends t.GetKeyFunction<t.JWEHeaderParameters | undefined, t.FlattenedJWE, KeyType | t.KeyObject | t.JWK> {
|
|
4
4
|
}
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Authenticates and decrypts a flattened JWE JSON Serialization.
|
|
7
7
|
*
|
|
8
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 flattenedDecrypt(jwe: t.FlattenedJWE, key: t.KeyInput, options?: t.DecryptOptions): Promise<t.FlattenedDecryptResult>;
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* Authenticates and decrypts a flattened JWE JSON Serialization with a dynamically resolved key,
|
|
14
|
+
* included in the result.
|
|
14
15
|
*
|
|
15
16
|
* @param getKey Resolves a private key or shared secret from unverified token data.
|
|
16
17
|
*/
|
|
17
18
|
export declare function flattenedDecrypt<KeyType extends t.CryptoKey | Uint8Array = t.CryptoKey | Uint8Array>(jwe: t.FlattenedJWE, getKey: FlattenedDecryptGetKey<KeyType>, options?: t.DecryptOptions): Promise<t.FlattenedDecryptResult & t.ResolvedKey<KeyType>>;
|
|
18
19
|
/**
|
|
19
|
-
*
|
|
20
|
-
* resolver is used.
|
|
20
|
+
* Authenticates and decrypts a flattened JWE JSON Serialization with a key or key resolver. The
|
|
21
|
+
* result includes `key` only when a resolver is used.
|
|
21
22
|
*
|
|
22
23
|
* @param key Private key or shared secret, or a function resolving one.
|
|
23
24
|
*/
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import type * as t from '../../types.d.ts';
|
|
2
|
-
/**
|
|
2
|
+
/** Produces flattened JWE JSON Serialization using authenticated encryption. */
|
|
3
3
|
export declare class FlattenedEncrypt {
|
|
4
4
|
#private;
|
|
5
5
|
/**
|
|
6
|
-
* Creates
|
|
6
|
+
* Creates an encryptor for flattened JWE JSON Serialization.
|
|
7
7
|
*
|
|
8
8
|
* @param plaintext Binary representation of the plaintext to encrypt.
|
|
9
9
|
*/
|
|
10
10
|
constructor(plaintext: Uint8Array);
|
|
11
11
|
/**
|
|
12
12
|
* Sets key management inputs such as ECDH-ES "apu"/"apv" or PBES2 "p2c". Use this method instead
|
|
13
|
-
* of header setters; the resulting parameters are added to the JOSE
|
|
13
|
+
* of header setters; the resulting parameters are added to the JOSE Header. May only be called
|
|
14
14
|
* once.
|
|
15
15
|
*/
|
|
16
16
|
setKeyManagementParameters(parameters: t.JWEKeyManagementHeaderParameters): this;
|
|
@@ -20,7 +20,7 @@ export declare class FlattenedEncrypt {
|
|
|
20
20
|
setSharedUnprotectedHeader(sharedUnprotectedHeader: t.JWEHeaderParameters): this;
|
|
21
21
|
/** Sets the JWE Per-Recipient Unprotected Header. May only be called once. */
|
|
22
22
|
setUnprotectedHeader(unprotectedHeader: t.JWEHeaderParameters): this;
|
|
23
|
-
/** Sets
|
|
23
|
+
/** Sets the JWE AAD, which is integrity protected but not encrypted. */
|
|
24
24
|
setAdditionalAuthenticatedData(aad: Uint8Array): this;
|
|
25
25
|
/**
|
|
26
26
|
* Sets a content encryption key instead of generating a random one for the JWE "enc" algorithm.
|
|
@@ -37,7 +37,7 @@ export declare class FlattenedEncrypt {
|
|
|
37
37
|
*/
|
|
38
38
|
setInitializationVector(iv: Uint8Array): this;
|
|
39
39
|
/**
|
|
40
|
-
* Encrypts the plaintext
|
|
40
|
+
* Encrypts the plaintext and returns the flattened JWE JSON Serialization.
|
|
41
41
|
*
|
|
42
42
|
* @param key Public key or shared secret. See
|
|
43
43
|
* {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}.
|
package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwe/general/decrypt.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type * as t from '../../types.d.ts';
|
|
|
3
3
|
export interface GeneralDecryptGetKey<KeyType extends t.CryptoKey | Uint8Array = t.CryptoKey | Uint8Array> extends t.GetKeyFunction<t.JWEHeaderParameters | undefined, t.FlattenedJWE, KeyType | t.KeyObject | t.JWK> {
|
|
4
4
|
}
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Authenticates and decrypts a general JWE JSON Serialization.
|
|
7
7
|
*
|
|
8
8
|
* > Note: Returns plaintext and headers from the first recipient that decrypts successfully. Other
|
|
9
9
|
* > recipients may be inspected to enforce serialization rules, but their headers are not included in
|
|
@@ -14,14 +14,15 @@ export interface GeneralDecryptGetKey<KeyType extends t.CryptoKey | Uint8Array =
|
|
|
14
14
|
*/
|
|
15
15
|
export declare function generalDecrypt(jwe: t.GeneralJWE, key: t.KeyInput, options?: t.DecryptOptions): Promise<t.GeneralDecryptResult>;
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* Authenticates and decrypts a general JWE JSON Serialization with a dynamically resolved key,
|
|
18
|
+
* included in the result.
|
|
18
19
|
*
|
|
19
20
|
* @param getKey Resolves a private key or shared secret from unverified token data.
|
|
20
21
|
*/
|
|
21
22
|
export declare function generalDecrypt<KeyType extends t.CryptoKey | Uint8Array = t.CryptoKey | Uint8Array>(jwe: t.GeneralJWE, getKey: GeneralDecryptGetKey<KeyType>, options?: t.DecryptOptions): Promise<t.GeneralDecryptResult & t.ResolvedKey<KeyType>>;
|
|
22
23
|
/**
|
|
23
|
-
*
|
|
24
|
-
* is used.
|
|
24
|
+
* Authenticates and decrypts a general JWE JSON Serialization with a key or key resolver. The
|
|
25
|
+
* result includes `key` only when a resolver is used.
|
|
25
26
|
*
|
|
26
27
|
* @param key Private key or shared secret, or a function resolving one.
|
|
27
28
|
*/
|
package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwe/general/encrypt.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export interface Recipient {
|
|
|
5
5
|
setUnprotectedHeader(unprotectedHeader: t.JWEHeaderParameters): Recipient;
|
|
6
6
|
/**
|
|
7
7
|
* Sets key management inputs such as ECDH-ES "apu"/"apv" or PBES2 "p2c". Use this method instead
|
|
8
|
-
* of header setters; the resulting parameters are added to the JOSE
|
|
8
|
+
* of header setters; the resulting parameters are added to the JOSE Header. May only be called
|
|
9
9
|
* once.
|
|
10
10
|
*/
|
|
11
11
|
setKeyManagementParameters(parameters: t.JWEKeyManagementHeaderParameters): Recipient;
|
|
@@ -24,11 +24,11 @@ export interface Recipient {
|
|
|
24
24
|
/** Returns the enclosing {@link GeneralEncrypt} instance. */
|
|
25
25
|
done(): GeneralEncrypt;
|
|
26
26
|
}
|
|
27
|
-
/**
|
|
27
|
+
/** Produces general JWE JSON Serialization using authenticated encryption. */
|
|
28
28
|
export declare class GeneralEncrypt {
|
|
29
29
|
#private;
|
|
30
30
|
/**
|
|
31
|
-
* Creates
|
|
31
|
+
* Creates an encryptor for general JWE JSON Serialization.
|
|
32
32
|
*
|
|
33
33
|
* @param plaintext Binary representation of the plaintext to encrypt.
|
|
34
34
|
*/
|
|
@@ -44,8 +44,8 @@ export declare class GeneralEncrypt {
|
|
|
44
44
|
setProtectedHeader(protectedHeader: t.JWEHeaderParameters): this;
|
|
45
45
|
/** Sets the JWE Shared Unprotected Header. May only be called once. */
|
|
46
46
|
setSharedUnprotectedHeader(sharedUnprotectedHeader: t.JWEHeaderParameters): this;
|
|
47
|
-
/** Sets
|
|
47
|
+
/** Sets the JWE AAD, which is integrity protected but not encrypted. */
|
|
48
48
|
setAdditionalAuthenticatedData(aad: Uint8Array): this;
|
|
49
|
-
/** Encrypts the plaintext
|
|
49
|
+
/** Encrypts the plaintext and returns the general JWE JSON Serialization. */
|
|
50
50
|
encrypt(): Promise<t.GeneralJWE>;
|
|
51
51
|
}
|
package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jws/compact/sign.d.ts
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import type * as t from '../../types.d.ts';
|
|
2
|
-
/**
|
|
2
|
+
/** Produces JWS Compact Serialization using a digital signature or MAC. */
|
|
3
3
|
export declare class CompactSign {
|
|
4
4
|
#private;
|
|
5
5
|
/**
|
|
6
|
-
* Creates a
|
|
6
|
+
* Creates a signer for JWS Compact Serialization.
|
|
7
7
|
*
|
|
8
|
-
* @param payload
|
|
8
|
+
* @param payload JWS Payload bytes to sign or MAC.
|
|
9
9
|
*/
|
|
10
10
|
constructor(payload: Uint8Array);
|
|
11
11
|
/** Sets the JWS Protected Header. May only be called once. */
|
|
12
12
|
setProtectedHeader(protectedHeader: t.CompactJWSHeaderParameters): this;
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
14
|
+
* Computes the JWS Signature (digital signature or MAC) and returns the JWS Compact
|
|
15
|
+
* Serialization.
|
|
15
16
|
*
|
|
16
17
|
* @param key Private key or shared secret. See
|
|
17
18
|
* {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}.
|