aws-cdk 2.1135.0 → 2.1135.1
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/THIRD_PARTY_LICENSES +1 -1
- package/build-info.json +2 -2
- package/lib/index.js +193 -64
- package/package.json +3 -3
package/THIRD_PARTY_LICENSES
CHANGED
|
@@ -11578,7 +11578,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
11578
11578
|
|
|
11579
11579
|
----------------
|
|
11580
11580
|
|
|
11581
|
-
** ip-address@10.
|
|
11581
|
+
** ip-address@10.4.0 - https://www.npmjs.com/package/ip-address/v/10.4.0 | MIT
|
|
11582
11582
|
Copyright (C) 2011 by Beau Gunderson
|
|
11583
11583
|
|
|
11584
11584
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
package/build-info.json
CHANGED
package/lib/index.js
CHANGED
|
@@ -3695,7 +3695,7 @@ var require_semver2 = __commonJS({
|
|
|
3695
3695
|
// ../@aws-cdk/cloud-assembly-schema/cli-version.json
|
|
3696
3696
|
var require_cli_version = __commonJS({
|
|
3697
3697
|
"../@aws-cdk/cloud-assembly-schema/cli-version.json"(exports2, module2) {
|
|
3698
|
-
module2.exports = { version: "2.1135.
|
|
3698
|
+
module2.exports = { version: "2.1135.1" };
|
|
3699
3699
|
}
|
|
3700
3700
|
});
|
|
3701
3701
|
|
|
@@ -108288,7 +108288,6 @@ async function deployStack(options, ioHelper) {
|
|
|
108288
108288
|
await ioHelper.defaults.info("Falling back to doing a full deployment");
|
|
108289
108289
|
options.sdk.appendCustomUserAgent("cdk-hotswap/fallback");
|
|
108290
108290
|
deploymentMethod = deploymentMethod.fallback;
|
|
108291
|
-
options = { ...options, express: true };
|
|
108292
108291
|
} else {
|
|
108293
108292
|
return {
|
|
108294
108293
|
type: "did-deploy-stack",
|
|
@@ -320483,8 +320482,10 @@ var require_common5 = __commonJS({
|
|
|
320483
320482
|
"use strict";
|
|
320484
320483
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
320485
320484
|
exports2.isInSubnet = isInSubnet;
|
|
320485
|
+
exports2.isHostInSubnet = isHostInSubnet;
|
|
320486
320486
|
exports2.isCorrect = isCorrect;
|
|
320487
320487
|
exports2.prefixLengthFromMask = prefixLengthFromMask;
|
|
320488
|
+
exports2.assertByteArray = assertByteArray;
|
|
320488
320489
|
exports2.numberToPaddedHex = numberToPaddedHex;
|
|
320489
320490
|
exports2.stringToPaddedHex = stringToPaddedHex;
|
|
320490
320491
|
exports2.testBit = testBit;
|
|
@@ -320493,14 +320494,15 @@ var require_common5 = __commonJS({
|
|
|
320493
320494
|
if (this.subnetMask < address.subnetMask) {
|
|
320494
320495
|
return false;
|
|
320495
320496
|
}
|
|
320496
|
-
|
|
320497
|
-
return true;
|
|
320498
|
-
}
|
|
320499
|
-
return false;
|
|
320497
|
+
return isHostInSubnet.call(this, address);
|
|
320500
320498
|
}
|
|
320501
320499
|
__name(isInSubnet, "isInSubnet");
|
|
320500
|
+
function isHostInSubnet(address) {
|
|
320501
|
+
return this.mask(address.subnetMask) === address.mask();
|
|
320502
|
+
}
|
|
320503
|
+
__name(isHostInSubnet, "isHostInSubnet");
|
|
320502
320504
|
function isCorrect(defaultBits) {
|
|
320503
|
-
return function() {
|
|
320505
|
+
return /* @__PURE__ */ __name(function isCorrectForm() {
|
|
320504
320506
|
if (this.addressMinusSuffix !== this.correctForm()) {
|
|
320505
320507
|
return false;
|
|
320506
320508
|
}
|
|
@@ -320508,7 +320510,7 @@ var require_common5 = __commonJS({
|
|
|
320508
320510
|
return true;
|
|
320509
320511
|
}
|
|
320510
320512
|
return this.parsedSubnet === String(this.subnetMask);
|
|
320511
|
-
};
|
|
320513
|
+
}, "isCorrectForm");
|
|
320512
320514
|
}
|
|
320513
320515
|
__name(isCorrect, "isCorrect");
|
|
320514
320516
|
function prefixLengthFromMask(value2, totalBits) {
|
|
@@ -320526,6 +320528,17 @@ var require_common5 = __commonJS({
|
|
|
320526
320528
|
return firstZero;
|
|
320527
320529
|
}
|
|
320528
320530
|
__name(prefixLengthFromMask, "prefixLengthFromMask");
|
|
320531
|
+
function assertByteArray(bytes, byteCount, family, minimum) {
|
|
320532
|
+
if (bytes.length !== byteCount) {
|
|
320533
|
+
throw new address_error_1.AddressError(`${family} addresses require exactly ${byteCount} bytes`);
|
|
320534
|
+
}
|
|
320535
|
+
for (let i6 = 0; i6 < bytes.length; i6++) {
|
|
320536
|
+
if (!Number.isInteger(bytes[i6]) || bytes[i6] < minimum || bytes[i6] > 255) {
|
|
320537
|
+
throw new address_error_1.AddressError(`All bytes must be integers between ${minimum} and 255`);
|
|
320538
|
+
}
|
|
320539
|
+
}
|
|
320540
|
+
}
|
|
320541
|
+
__name(assertByteArray, "assertByteArray");
|
|
320529
320542
|
function numberToPaddedHex(number) {
|
|
320530
320543
|
return number.toString(16).padStart(2, "0");
|
|
320531
320544
|
}
|
|
@@ -320554,7 +320567,7 @@ var require_constants9 = __commonJS({
|
|
|
320554
320567
|
exports2.RE_SUBNET_STRING = exports2.RE_ADDRESS = exports2.GROUPS = exports2.BITS = void 0;
|
|
320555
320568
|
exports2.BITS = 32;
|
|
320556
320569
|
exports2.GROUPS = 4;
|
|
320557
|
-
exports2.RE_ADDRESS = /^(25[0-5]|2[0-4][0-9]|[
|
|
320570
|
+
exports2.RE_ADDRESS = /^(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])$/g;
|
|
320558
320571
|
exports2.RE_SUBNET_STRING = /\/\d{1,2}$/;
|
|
320559
320572
|
}
|
|
320560
320573
|
});
|
|
@@ -320601,6 +320614,7 @@ var require_ipv4 = __commonJS({
|
|
|
320601
320614
|
__name(this, "Address4");
|
|
320602
320615
|
}
|
|
320603
320616
|
constructor(address) {
|
|
320617
|
+
this.addressMinusSuffix = "";
|
|
320604
320618
|
this.groups = constants3.GROUPS;
|
|
320605
320619
|
this.parsedAddress = [];
|
|
320606
320620
|
this.parsedSubnet = "";
|
|
@@ -320609,6 +320623,7 @@ var require_ipv4 = __commonJS({
|
|
|
320609
320623
|
this.v4 = true;
|
|
320610
320624
|
this.isCorrect = isCorrect4;
|
|
320611
320625
|
this.isInSubnet = common.isInSubnet;
|
|
320626
|
+
this.isHostInSubnet = common.isHostInSubnet;
|
|
320612
320627
|
this.address = address;
|
|
320613
320628
|
const subnet = constants3.RE_SUBNET_STRING.exec(address);
|
|
320614
320629
|
if (subnet) {
|
|
@@ -320634,7 +320649,7 @@ var require_ipv4 = __commonJS({
|
|
|
320634
320649
|
try {
|
|
320635
320650
|
new _Address4(address);
|
|
320636
320651
|
return true;
|
|
320637
|
-
} catch
|
|
320652
|
+
} catch {
|
|
320638
320653
|
return false;
|
|
320639
320654
|
}
|
|
320640
320655
|
}
|
|
@@ -320646,6 +320661,9 @@ var require_ipv4 = __commonJS({
|
|
|
320646
320661
|
*/
|
|
320647
320662
|
parse(address) {
|
|
320648
320663
|
const groups = address.split(".");
|
|
320664
|
+
if (groups.some((group4) => /^0\d/.test(group4))) {
|
|
320665
|
+
throw new address_error_1.AddressError("IPv4 addresses can't have leading zeroes.");
|
|
320666
|
+
}
|
|
320649
320667
|
if (!address.match(constants3.RE_ADDRESS)) {
|
|
320650
320668
|
throw new address_error_1.AddressError("Invalid IPv4 address.");
|
|
320651
320669
|
}
|
|
@@ -320881,7 +320899,7 @@ var require_ipv4 = __commonJS({
|
|
|
320881
320899
|
* @returns {Address4}
|
|
320882
320900
|
*/
|
|
320883
320901
|
static fromBigInt(bigInt) {
|
|
320884
|
-
if (bigInt <
|
|
320902
|
+
if (bigInt < BigInt(0) || bigInt > BigInt(4294967295)) {
|
|
320885
320903
|
throw new address_error_1.AddressError("IPv4 BigInt must be in the range 0 to 2**32 - 1");
|
|
320886
320904
|
}
|
|
320887
320905
|
return _Address4.fromHex(bigInt.toString(16).padStart(8, "0"));
|
|
@@ -320894,14 +320912,7 @@ var require_ipv4 = __commonJS({
|
|
|
320894
320912
|
* @returns {Address4}
|
|
320895
320913
|
*/
|
|
320896
320914
|
static fromByteArray(bytes) {
|
|
320897
|
-
|
|
320898
|
-
throw new address_error_1.AddressError("IPv4 addresses require exactly 4 bytes");
|
|
320899
|
-
}
|
|
320900
|
-
for (let i6 = 0; i6 < bytes.length; i6++) {
|
|
320901
|
-
if (!Number.isInteger(bytes[i6]) || bytes[i6] < 0 || bytes[i6] > 255) {
|
|
320902
|
-
throw new address_error_1.AddressError("All bytes must be integers between 0 and 255");
|
|
320903
|
-
}
|
|
320904
|
-
}
|
|
320915
|
+
common.assertByteArray(bytes, 4, "IPv4", 0);
|
|
320905
320916
|
return this.fromUnsignedByteArray(bytes);
|
|
320906
320917
|
}
|
|
320907
320918
|
/**
|
|
@@ -320955,49 +320966,49 @@ var require_ipv4 = __commonJS({
|
|
|
320955
320966
|
* @returns {boolean}
|
|
320956
320967
|
*/
|
|
320957
320968
|
isMulticast() {
|
|
320958
|
-
return this.
|
|
320969
|
+
return this.isHostInSubnet(MULTICAST_V4);
|
|
320959
320970
|
}
|
|
320960
320971
|
/**
|
|
320961
320972
|
* Returns true if the address is in one of the [RFC 1918](https://datatracker.ietf.org/doc/html/rfc1918) private address ranges (`10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`).
|
|
320962
320973
|
* @returns {boolean}
|
|
320963
320974
|
*/
|
|
320964
320975
|
isPrivate() {
|
|
320965
|
-
return PRIVATE_V4.some((subnet) => this.
|
|
320976
|
+
return PRIVATE_V4.some((subnet) => this.isHostInSubnet(subnet));
|
|
320966
320977
|
}
|
|
320967
320978
|
/**
|
|
320968
320979
|
* Returns true if the address is in the loopback range `127.0.0.0/8` ([RFC 1122](https://datatracker.ietf.org/doc/html/rfc1122)).
|
|
320969
320980
|
* @returns {boolean}
|
|
320970
320981
|
*/
|
|
320971
320982
|
isLoopback() {
|
|
320972
|
-
return this.
|
|
320983
|
+
return this.isHostInSubnet(LOOPBACK_V4);
|
|
320973
320984
|
}
|
|
320974
320985
|
/**
|
|
320975
320986
|
* Returns true if the address is in the link-local range `169.254.0.0/16` ([RFC 3927](https://datatracker.ietf.org/doc/html/rfc3927)).
|
|
320976
320987
|
* @returns {boolean}
|
|
320977
320988
|
*/
|
|
320978
320989
|
isLinkLocal() {
|
|
320979
|
-
return this.
|
|
320990
|
+
return this.isHostInSubnet(LINK_LOCAL_V4);
|
|
320980
320991
|
}
|
|
320981
320992
|
/**
|
|
320982
320993
|
* Returns true if the address is the unspecified address `0.0.0.0`.
|
|
320983
320994
|
* @returns {boolean}
|
|
320984
320995
|
*/
|
|
320985
320996
|
isUnspecified() {
|
|
320986
|
-
return this.
|
|
320997
|
+
return this.isHostInSubnet(UNSPECIFIED_V4);
|
|
320987
320998
|
}
|
|
320988
320999
|
/**
|
|
320989
321000
|
* Returns true if the address is the limited broadcast address `255.255.255.255` ([RFC 919](https://datatracker.ietf.org/doc/html/rfc919)).
|
|
320990
321001
|
* @returns {boolean}
|
|
320991
321002
|
*/
|
|
320992
321003
|
isBroadcast() {
|
|
320993
|
-
return this.
|
|
321004
|
+
return this.isHostInSubnet(BROADCAST_V4);
|
|
320994
321005
|
}
|
|
320995
321006
|
/**
|
|
320996
321007
|
* Returns true if the address is in the carrier-grade NAT range `100.64.0.0/10` ([RFC 6598](https://datatracker.ietf.org/doc/html/rfc6598)).
|
|
320997
321008
|
* @returns {boolean}
|
|
320998
321009
|
*/
|
|
320999
321010
|
isCGNAT() {
|
|
321000
|
-
return this.
|
|
321011
|
+
return this.isHostInSubnet(CGNAT_V4);
|
|
321001
321012
|
}
|
|
321002
321013
|
/**
|
|
321003
321014
|
* Returns a zero-padded base-2 string representation of the address
|
|
@@ -321015,7 +321026,7 @@ var require_ipv4 = __commonJS({
|
|
|
321015
321026
|
*/
|
|
321016
321027
|
groupForV6() {
|
|
321017
321028
|
const segments2 = this.parsedAddress;
|
|
321018
|
-
return this.
|
|
321029
|
+
return this.correctForm().replace(constants3.RE_ADDRESS, `<span class="hover-group group-v4 group-6">${segments2.slice(0, 2).join(".")}</span>.<span class="hover-group group-v4 group-7">${segments2.slice(2, 4).join(".")}</span>`);
|
|
321019
321030
|
}
|
|
321020
321031
|
};
|
|
321021
321032
|
exports2.Address4 = Address4;
|
|
@@ -321072,6 +321083,7 @@ var require_constants10 = __commonJS({
|
|
|
321072
321083
|
"ff05::1:3/128": "Multicast (All DHCP servers in this site)",
|
|
321073
321084
|
"::/128": "Unspecified",
|
|
321074
321085
|
"::1/128": "Loopback",
|
|
321086
|
+
"::ffff:0:0/96": "IPv4-mapped",
|
|
321075
321087
|
"ff00::/8": "Multicast",
|
|
321076
321088
|
"fe80::/10": "Link-local unicast",
|
|
321077
321089
|
"fc00::/7": "Unique local",
|
|
@@ -321084,8 +321096,8 @@ var require_constants10 = __commonJS({
|
|
|
321084
321096
|
exports2.RE_BAD_ADDRESS = /([0-9a-f]{5,}|:{3,}|[^:]:$|^:[^:]|\/$)/gi;
|
|
321085
321097
|
exports2.RE_SUBNET_STRING = /\/\d{1,3}(?=%|$)/;
|
|
321086
321098
|
exports2.RE_ZONE_STRING = /%.*$/;
|
|
321087
|
-
exports2.RE_URL =
|
|
321088
|
-
exports2.RE_URL_WITH_PORT =
|
|
321099
|
+
exports2.RE_URL = /^(?:\[([0-9a-f:.]+)\]|([0-9a-f:.]+))(?:[/?#].*)?$/i;
|
|
321100
|
+
exports2.RE_URL_WITH_PORT = /^\[([0-9a-f:.]+)\]:([0-9]{1,5})(?:[/?#].*)?$/i;
|
|
321089
321101
|
}
|
|
321090
321102
|
});
|
|
321091
321103
|
|
|
@@ -321326,6 +321338,7 @@ var require_ipv6 = __commonJS({
|
|
|
321326
321338
|
this.v4 = false;
|
|
321327
321339
|
this.zone = "";
|
|
321328
321340
|
this.isInSubnet = common.isInSubnet;
|
|
321341
|
+
this.isHostInSubnet = common.isHostInSubnet;
|
|
321329
321342
|
this.isCorrect = isCorrect6;
|
|
321330
321343
|
if (optionalGroups === void 0) {
|
|
321331
321344
|
this.groups = constants6.GROUPS;
|
|
@@ -321342,7 +321355,8 @@ var require_ipv6 = __commonJS({
|
|
|
321342
321355
|
throw new address_error_1.AddressError("Invalid subnet mask.");
|
|
321343
321356
|
}
|
|
321344
321357
|
address = address.replace(constants6.RE_SUBNET_STRING, "");
|
|
321345
|
-
}
|
|
321358
|
+
}
|
|
321359
|
+
if (/\//.test(address)) {
|
|
321346
321360
|
throw new address_error_1.AddressError("Invalid subnet mask.");
|
|
321347
321361
|
}
|
|
321348
321362
|
const zone = constants6.RE_ZONE_STRING.exec(address);
|
|
@@ -321364,7 +321378,7 @@ var require_ipv6 = __commonJS({
|
|
|
321364
321378
|
try {
|
|
321365
321379
|
new _Address6(address);
|
|
321366
321380
|
return true;
|
|
321367
|
-
} catch
|
|
321381
|
+
} catch {
|
|
321368
321382
|
return false;
|
|
321369
321383
|
}
|
|
321370
321384
|
}
|
|
@@ -321379,7 +321393,7 @@ var require_ipv6 = __commonJS({
|
|
|
321379
321393
|
* address.correctForm(); // '::e8:d4a5:1000'
|
|
321380
321394
|
*/
|
|
321381
321395
|
static fromBigInt(bigInt) {
|
|
321382
|
-
if (bigInt <
|
|
321396
|
+
if (bigInt < BigInt(0) || bigInt > (BigInt(1) << BigInt(constants6.BITS)) - BigInt(1)) {
|
|
321383
321397
|
throw new address_error_1.AddressError("IPv6 BigInt must be in the range 0 to 2**128 - 1");
|
|
321384
321398
|
}
|
|
321385
321399
|
const hex = bigInt.toString(16).padStart(32, "0");
|
|
@@ -321400,11 +321414,13 @@ var require_ipv6 = __commonJS({
|
|
|
321400
321414
|
* addressAndPort.port; // 8080
|
|
321401
321415
|
*/
|
|
321402
321416
|
static fromURL(url) {
|
|
321417
|
+
var _a2;
|
|
321403
321418
|
let host;
|
|
321404
321419
|
let port = null;
|
|
321405
321420
|
let result2;
|
|
321406
|
-
|
|
321407
|
-
|
|
321421
|
+
const stripped = url.replace(/^[a-z][a-z0-9+.-]*:\/\//i, "");
|
|
321422
|
+
if (stripped.indexOf("[") !== -1 && stripped.indexOf("]:") !== -1) {
|
|
321423
|
+
result2 = constants6.RE_URL_WITH_PORT.exec(stripped);
|
|
321408
321424
|
if (result2 === null) {
|
|
321409
321425
|
return {
|
|
321410
321426
|
error: "failed to parse address with port",
|
|
@@ -321414,9 +321430,8 @@ var require_ipv6 = __commonJS({
|
|
|
321414
321430
|
}
|
|
321415
321431
|
host = result2[1];
|
|
321416
321432
|
port = result2[2];
|
|
321417
|
-
} else
|
|
321418
|
-
|
|
321419
|
-
result2 = constants6.RE_URL.exec(url);
|
|
321433
|
+
} else {
|
|
321434
|
+
result2 = constants6.RE_URL.exec(stripped);
|
|
321420
321435
|
if (result2 === null) {
|
|
321421
321436
|
return {
|
|
321422
321437
|
error: "failed to parse address from URL",
|
|
@@ -321424,13 +321439,11 @@ var require_ipv6 = __commonJS({
|
|
|
321424
321439
|
port: null
|
|
321425
321440
|
};
|
|
321426
321441
|
}
|
|
321427
|
-
host = result2[1];
|
|
321428
|
-
} else {
|
|
321429
|
-
host = url;
|
|
321442
|
+
host = (_a2 = result2[1]) !== null && _a2 !== void 0 ? _a2 : result2[2];
|
|
321430
321443
|
}
|
|
321431
321444
|
if (port) {
|
|
321432
321445
|
port = parseInt(port, 10);
|
|
321433
|
-
if (port < 0 || port >
|
|
321446
|
+
if (port < 0 || port > 65535) {
|
|
321434
321447
|
port = null;
|
|
321435
321448
|
}
|
|
321436
321449
|
} else {
|
|
@@ -321692,7 +321705,7 @@ var require_ipv6 = __commonJS({
|
|
|
321692
321705
|
getType() {
|
|
321693
321706
|
for (let i6 = 0; i6 < TYPE_SUBNETS.length; i6++) {
|
|
321694
321707
|
const entry = TYPE_SUBNETS[i6];
|
|
321695
|
-
if (this.
|
|
321708
|
+
if (this.isHostInSubnet(entry[0])) {
|
|
321696
321709
|
return entry[1];
|
|
321697
321710
|
}
|
|
321698
321711
|
}
|
|
@@ -321825,18 +321838,20 @@ var require_ipv6 = __commonJS({
|
|
|
321825
321838
|
}
|
|
321826
321839
|
const groups = address.split(":");
|
|
321827
321840
|
const lastGroup = groups.slice(-1)[0];
|
|
321841
|
+
const v4Octets = lastGroup.split(".");
|
|
321842
|
+
if (v4Octets.length === constants4.GROUPS && v4Octets.every((octet) => /^\d{1,3}$/.test(octet))) {
|
|
321843
|
+
if (v4Octets.some((octet) => /^0\d/.test(octet))) {
|
|
321844
|
+
const highlighted = v4Octets.map(spanLeadingZeroes4).join(".");
|
|
321845
|
+
const prefix = groups.slice(0, -1).map(helpers.escapeHtml).join(":");
|
|
321846
|
+
const separator = groups.length > 1 ? ":" : "";
|
|
321847
|
+
throw new address_error_1.AddressError("IPv4 addresses can't have leading zeroes.", `${prefix}${separator}${highlighted}`);
|
|
321848
|
+
}
|
|
321849
|
+
}
|
|
321828
321850
|
const address4 = lastGroup.match(constants4.RE_ADDRESS);
|
|
321829
321851
|
if (address4) {
|
|
321830
321852
|
this.parsedAddress4 = address4[0];
|
|
321831
|
-
this.
|
|
321832
|
-
|
|
321833
|
-
if (/^0[0-9]+/.test(this.address4.parsedAddress[i6])) {
|
|
321834
|
-
const highlighted = this.address4.parsedAddress.map(spanLeadingZeroes4).join(".");
|
|
321835
|
-
const prefix = groups.slice(0, -1).map(helpers.escapeHtml).join(":");
|
|
321836
|
-
const separator = groups.length > 1 ? ":" : "";
|
|
321837
|
-
throw new address_error_1.AddressError("IPv4 addresses can't have leading zeroes.", `${prefix}${separator}${highlighted}`);
|
|
321838
|
-
}
|
|
321839
|
-
}
|
|
321853
|
+
const v4Suffix = this.subnetMask >= 96 ? `/${this.subnetMask - 96}` : "";
|
|
321854
|
+
this.address4 = new ipv4_1.Address4(`${this.parsedAddress4}${v4Suffix}`);
|
|
321840
321855
|
this.v4 = true;
|
|
321841
321856
|
groups[groups.length - 1] = this.address4.toGroup6();
|
|
321842
321857
|
address = groups.join(":");
|
|
@@ -321920,7 +321935,11 @@ var require_ipv6 = __commonJS({
|
|
|
321920
321935
|
return BigInt(`0x${this.parsedAddress.map(paddedHex).join("")}`);
|
|
321921
321936
|
}
|
|
321922
321937
|
/**
|
|
321923
|
-
* Return the last two groups of this address as an IPv4 address string
|
|
321938
|
+
* Return the last two groups of this address as an IPv4 address string.
|
|
321939
|
+
* If this address carries a CIDR prefix that covers the trailing 32 bits
|
|
321940
|
+
* (i.e. `subnetMask >= 96`), the resulting `Address4` inherits the
|
|
321941
|
+
* corresponding v4 prefix (`subnetMask - 96`); otherwise it defaults to
|
|
321942
|
+
* `/32`.
|
|
321924
321943
|
* @returns {Address4}
|
|
321925
321944
|
* @example
|
|
321926
321945
|
* var address = new Address6('2001:4860:4001::1825:bf11');
|
|
@@ -321928,7 +321947,16 @@ var require_ipv6 = __commonJS({
|
|
|
321928
321947
|
*/
|
|
321929
321948
|
to4() {
|
|
321930
321949
|
const binary = this.binaryZeroPad().split("");
|
|
321931
|
-
|
|
321950
|
+
const hex = BigInt(`0b${binary.slice(96, 128).join("")}`).toString(16).padStart(8, "0");
|
|
321951
|
+
if (this.subnetMask >= 96) {
|
|
321952
|
+
const v4Mask = this.subnetMask - 96;
|
|
321953
|
+
const groups = [];
|
|
321954
|
+
for (let i6 = 0; i6 < 8; i6 += 2) {
|
|
321955
|
+
groups.push(parseInt(hex.slice(i6, i6 + 2), 16));
|
|
321956
|
+
}
|
|
321957
|
+
return new ipv4_1.Address4(`${groups.join(".")}/${v4Mask}`);
|
|
321958
|
+
}
|
|
321959
|
+
return ipv4_1.Address4.fromHex(hex);
|
|
321932
321960
|
}
|
|
321933
321961
|
/**
|
|
321934
321962
|
* Return the v4-in-v6 form of the address
|
|
@@ -321942,7 +321970,7 @@ var require_ipv6 = __commonJS({
|
|
|
321942
321970
|
if (!/:$/.test(correct)) {
|
|
321943
321971
|
infix = ":";
|
|
321944
321972
|
}
|
|
321945
|
-
return correct + infix + address4.
|
|
321973
|
+
return correct + infix + address4.correctForm();
|
|
321946
321974
|
}
|
|
321947
321975
|
/**
|
|
321948
321976
|
* Decodes the Teredo tunneling fields embedded in this address. Returns the
|
|
@@ -322032,7 +322060,14 @@ var require_ipv6 = __commonJS({
|
|
|
322032
322060
|
bits = prefixBits.slice(0, 96) + v4Bits;
|
|
322033
322061
|
} else {
|
|
322034
322062
|
const beforeU = 64 - pl2;
|
|
322035
|
-
bits =
|
|
322063
|
+
bits = [
|
|
322064
|
+
prefixBits.slice(0, pl2),
|
|
322065
|
+
v4Bits.slice(0, beforeU),
|
|
322066
|
+
// Bits 64 to 71 are the reserved u octet and are always zero.
|
|
322067
|
+
"00000000",
|
|
322068
|
+
v4Bits.slice(beforeU),
|
|
322069
|
+
"0".repeat(128 - 72 - (32 - beforeU))
|
|
322070
|
+
].join("");
|
|
322036
322071
|
}
|
|
322037
322072
|
const hex = BigInt(`0b${bits}`).toString(16).padStart(32, "0");
|
|
322038
322073
|
const groups = [];
|
|
@@ -322055,7 +322090,7 @@ var require_ipv6 = __commonJS({
|
|
|
322055
322090
|
if (pl2 !== 32 && pl2 !== 40 && pl2 !== 48 && pl2 !== 56 && pl2 !== 64 && pl2 !== 96) {
|
|
322056
322091
|
throw new address_error_1.AddressError("NAT64 prefix length must be 32, 40, 48, 56, 64, or 96");
|
|
322057
322092
|
}
|
|
322058
|
-
if (!this.
|
|
322093
|
+
if (!this.isHostInSubnet(prefix6)) {
|
|
322059
322094
|
return null;
|
|
322060
322095
|
}
|
|
322061
322096
|
const bits = this.binaryZeroPad();
|
|
@@ -322079,9 +322114,7 @@ var require_ipv6 = __commonJS({
|
|
|
322079
322114
|
* @returns {Array}
|
|
322080
322115
|
*/
|
|
322081
322116
|
toByteArray() {
|
|
322082
|
-
const
|
|
322083
|
-
const leadingPad = "0".repeat(valueWithoutPadding.length % 2);
|
|
322084
|
-
const value2 = `${leadingPad}${valueWithoutPadding}`;
|
|
322117
|
+
const value2 = this.bigInt().toString(16).padStart(constants6.BITS / 4, "0");
|
|
322085
322118
|
const bytes = [];
|
|
322086
322119
|
for (let i6 = 0, length = value2.length; i6 < length; i6 += 2) {
|
|
322087
322120
|
bytes.push(parseInt(value2.substring(i6, i6 + 2), 16));
|
|
@@ -322100,19 +322133,28 @@ var require_ipv6 = __commonJS({
|
|
|
322100
322133
|
/**
|
|
322101
322134
|
* Convert a byte array to an Address6 object.
|
|
322102
322135
|
*
|
|
322136
|
+
* Accepts unsigned bytes (0 to 255) or signed bytes (-128 to 127, as an
|
|
322137
|
+
* `Int8Array` or a Java `byte[]` holds them), folding signed values to their
|
|
322138
|
+
* unsigned equivalent. Throws `AddressError` unless given exactly 16
|
|
322139
|
+
* integers from -128 to 255.
|
|
322140
|
+
*
|
|
322103
322141
|
* To convert from a Node.js `Buffer`, spread it: `Address6.fromByteArray([...buf])`.
|
|
322104
322142
|
* @returns {Address6}
|
|
322105
322143
|
*/
|
|
322106
322144
|
static fromByteArray(bytes) {
|
|
322145
|
+
common.assertByteArray(bytes, 16, "IPv6", -128);
|
|
322107
322146
|
return this.fromUnsignedByteArray(bytes.map(unsignByte));
|
|
322108
322147
|
}
|
|
322109
322148
|
/**
|
|
322110
322149
|
* Convert an unsigned byte array to an Address6 object.
|
|
322111
322150
|
*
|
|
322151
|
+
* Throws `AddressError` unless given exactly 16 integers from 0 to 255.
|
|
322152
|
+
*
|
|
322112
322153
|
* To convert from a Node.js `Buffer`, spread it: `Address6.fromUnsignedByteArray([...buf])`.
|
|
322113
322154
|
* @returns {Address6}
|
|
322114
322155
|
*/
|
|
322115
322156
|
static fromUnsignedByteArray(bytes) {
|
|
322157
|
+
common.assertByteArray(bytes, 16, "IPv6", 0);
|
|
322116
322158
|
const BYTE_MAX = BigInt("256");
|
|
322117
322159
|
let result2 = BigInt("0");
|
|
322118
322160
|
let multiplier = BigInt("1");
|
|
@@ -322134,6 +322176,10 @@ var require_ipv6 = __commonJS({
|
|
|
322134
322176
|
* @returns {boolean}
|
|
322135
322177
|
*/
|
|
322136
322178
|
isLinkLocal() {
|
|
322179
|
+
const embedded = this.embeddedIPv4();
|
|
322180
|
+
if (embedded) {
|
|
322181
|
+
return embedded.isLinkLocal();
|
|
322182
|
+
}
|
|
322137
322183
|
if (this.getBitsBase2(0, 64) === "1111111010000000000000000000000000000000000000000000000000000000") {
|
|
322138
322184
|
return true;
|
|
322139
322185
|
}
|
|
@@ -322144,6 +322190,10 @@ var require_ipv6 = __commonJS({
|
|
|
322144
322190
|
* @returns {boolean}
|
|
322145
322191
|
*/
|
|
322146
322192
|
isMulticast() {
|
|
322193
|
+
const embedded = this.embeddedIPv4();
|
|
322194
|
+
if (embedded) {
|
|
322195
|
+
return embedded.isMulticast();
|
|
322196
|
+
}
|
|
322147
322197
|
const type = this.getType();
|
|
322148
322198
|
return type === "Multicast" || type.startsWith("Multicast ");
|
|
322149
322199
|
}
|
|
@@ -322166,27 +322216,54 @@ var require_ipv6 = __commonJS({
|
|
|
322166
322216
|
* @returns {boolean}
|
|
322167
322217
|
*/
|
|
322168
322218
|
isMapped4() {
|
|
322169
|
-
return this.
|
|
322219
|
+
return this.isHostInSubnet(IPV4_MAPPED_SUBNET);
|
|
322220
|
+
}
|
|
322221
|
+
/**
|
|
322222
|
+
* If this address embeds a routable IPv4 address — i.e. it is IPv4-mapped
|
|
322223
|
+
* (`::ffff:0:0/96`) or sits in the NAT64 well-known prefix (`64:ff9b::/96`,
|
|
322224
|
+
* [RFC 6052](https://datatracker.ietf.org/doc/html/rfc6052)) — return that
|
|
322225
|
+
* embedded address as an {@link Address4}; otherwise return null.
|
|
322226
|
+
*
|
|
322227
|
+
* The special-property checks (`isLoopback`, `isLinkLocal`, `isMulticast`,
|
|
322228
|
+
* `isUnspecified`, `isPrivate`, `isCGNAT`, `isBroadcast`) call this first and
|
|
322229
|
+
* delegate to the embedded {@link Address4} when present, so a literal such as
|
|
322230
|
+
* `::ffff:127.0.0.1` is classified by what it actually reaches (loopback)
|
|
322231
|
+
* rather than by its IPv6 wrapper (which `getType()` reports as IPv4-mapped).
|
|
322232
|
+
* This matters wherever the checks back a trust-boundary decision (e.g. an
|
|
322233
|
+
* SSRF allow/deny filter): without normalization, `::ffff:10.0.0.1`,
|
|
322234
|
+
* `::ffff:169.254.169.254`, `64:ff9b::7f00:1`, etc. would all read as
|
|
322235
|
+
* non-internal.
|
|
322236
|
+
* @returns {Address4 | null}
|
|
322237
|
+
*/
|
|
322238
|
+
embeddedIPv4() {
|
|
322239
|
+
if (this.isMapped4() || this.isHostInSubnet(NAT64_WELL_KNOWN_SUBNET)) {
|
|
322240
|
+
return this.to4();
|
|
322241
|
+
}
|
|
322242
|
+
return null;
|
|
322170
322243
|
}
|
|
322171
322244
|
/**
|
|
322172
322245
|
* Returns true if the address is a Teredo address, false otherwise
|
|
322173
322246
|
* @returns {boolean}
|
|
322174
322247
|
*/
|
|
322175
322248
|
isTeredo() {
|
|
322176
|
-
return this.
|
|
322249
|
+
return this.isHostInSubnet(TEREDO_SUBNET);
|
|
322177
322250
|
}
|
|
322178
322251
|
/**
|
|
322179
322252
|
* Returns true if the address is a 6to4 address, false otherwise
|
|
322180
322253
|
* @returns {boolean}
|
|
322181
322254
|
*/
|
|
322182
322255
|
is6to4() {
|
|
322183
|
-
return this.
|
|
322256
|
+
return this.isHostInSubnet(SIX_TO_FOUR_SUBNET);
|
|
322184
322257
|
}
|
|
322185
322258
|
/**
|
|
322186
322259
|
* Returns true if the address is a loopback address, false otherwise
|
|
322187
322260
|
* @returns {boolean}
|
|
322188
322261
|
*/
|
|
322189
322262
|
isLoopback() {
|
|
322263
|
+
const embedded = this.embeddedIPv4();
|
|
322264
|
+
if (embedded) {
|
|
322265
|
+
return embedded.isLoopback();
|
|
322266
|
+
}
|
|
322190
322267
|
return this.getType() === "Loopback";
|
|
322191
322268
|
}
|
|
322192
322269
|
/**
|
|
@@ -322194,13 +322271,64 @@ var require_ipv6 = __commonJS({
|
|
|
322194
322271
|
* @returns {boolean}
|
|
322195
322272
|
*/
|
|
322196
322273
|
isULA() {
|
|
322197
|
-
return this.
|
|
322274
|
+
return this.isHostInSubnet(ULA_SUBNET);
|
|
322275
|
+
}
|
|
322276
|
+
/**
|
|
322277
|
+
* Returns true if the address is private, i.e. a Unique Local Address in
|
|
322278
|
+
* `fc00::/7` ([RFC 4193](https://datatracker.ietf.org/doc/html/rfc4193)) or an
|
|
322279
|
+
* IPv4-mapped / NAT64 address whose embedded IPv4 address is in one of the
|
|
322280
|
+
* [RFC 1918](https://datatracker.ietf.org/doc/html/rfc1918) private ranges
|
|
322281
|
+
* (e.g. `::ffff:10.0.0.1`). This is the IPv6 counterpart to
|
|
322282
|
+
* {@link Address4.isPrivate}; use it instead of {@link isULA} when you need to
|
|
322283
|
+
* catch mapped RFC 1918 addresses as well as native ULAs.
|
|
322284
|
+
* @returns {boolean}
|
|
322285
|
+
*/
|
|
322286
|
+
isPrivate() {
|
|
322287
|
+
const embedded = this.embeddedIPv4();
|
|
322288
|
+
if (embedded) {
|
|
322289
|
+
return embedded.isPrivate();
|
|
322290
|
+
}
|
|
322291
|
+
return this.isULA();
|
|
322292
|
+
}
|
|
322293
|
+
/**
|
|
322294
|
+
* Returns true if the address is an IPv4-mapped / NAT64 address whose embedded
|
|
322295
|
+
* IPv4 address is in the carrier-grade NAT range `100.64.0.0/10`
|
|
322296
|
+
* ([RFC 6598](https://datatracker.ietf.org/doc/html/rfc6598)), false
|
|
322297
|
+
* otherwise. There is no native IPv6 CGNAT range, so this only ever returns
|
|
322298
|
+
* true for an embedded IPv4 address (e.g. `::ffff:100.64.0.1`).
|
|
322299
|
+
* @returns {boolean}
|
|
322300
|
+
*/
|
|
322301
|
+
isCGNAT() {
|
|
322302
|
+
const embedded = this.embeddedIPv4();
|
|
322303
|
+
if (embedded) {
|
|
322304
|
+
return embedded.isCGNAT();
|
|
322305
|
+
}
|
|
322306
|
+
return false;
|
|
322307
|
+
}
|
|
322308
|
+
/**
|
|
322309
|
+
* Returns true if the address is an IPv4-mapped / NAT64 address whose embedded
|
|
322310
|
+
* IPv4 address is the limited broadcast address `255.255.255.255`
|
|
322311
|
+
* ([RFC 919](https://datatracker.ietf.org/doc/html/rfc919)), false otherwise.
|
|
322312
|
+
* There is no IPv6 broadcast, so this only ever returns true for an embedded
|
|
322313
|
+
* IPv4 address (e.g. `::ffff:255.255.255.255`).
|
|
322314
|
+
* @returns {boolean}
|
|
322315
|
+
*/
|
|
322316
|
+
isBroadcast() {
|
|
322317
|
+
const embedded = this.embeddedIPv4();
|
|
322318
|
+
if (embedded) {
|
|
322319
|
+
return embedded.isBroadcast();
|
|
322320
|
+
}
|
|
322321
|
+
return false;
|
|
322198
322322
|
}
|
|
322199
322323
|
/**
|
|
322200
322324
|
* Returns true if the address is the unspecified address `::`.
|
|
322201
322325
|
* @returns {boolean}
|
|
322202
322326
|
*/
|
|
322203
322327
|
isUnspecified() {
|
|
322328
|
+
const embedded = this.embeddedIPv4();
|
|
322329
|
+
if (embedded) {
|
|
322330
|
+
return embedded.isUnspecified();
|
|
322331
|
+
}
|
|
322204
322332
|
return this.getType() === "Unspecified";
|
|
322205
322333
|
}
|
|
322206
322334
|
/**
|
|
@@ -322208,7 +322336,7 @@ var require_ipv6 = __commonJS({
|
|
|
322208
322336
|
* @returns {boolean}
|
|
322209
322337
|
*/
|
|
322210
322338
|
isDocumentation() {
|
|
322211
|
-
return this.
|
|
322339
|
+
return this.isHostInSubnet(DOCUMENTATION_SUBNET);
|
|
322212
322340
|
}
|
|
322213
322341
|
// #endregion
|
|
322214
322342
|
// #region HTML
|
|
@@ -322353,6 +322481,7 @@ var require_ipv6 = __commonJS({
|
|
|
322353
322481
|
var ULA_SUBNET = new Address6("fc00::/7");
|
|
322354
322482
|
var DOCUMENTATION_SUBNET = new Address6("2001:db8::/32");
|
|
322355
322483
|
var IPV4_MAPPED_SUBNET = new Address6("::ffff:0:0/96");
|
|
322484
|
+
var NAT64_WELL_KNOWN_SUBNET = new Address6("64:ff9b::/96");
|
|
322356
322485
|
}
|
|
322357
322486
|
});
|
|
322358
322487
|
|
package/package.json
CHANGED
|
@@ -87,10 +87,10 @@
|
|
|
87
87
|
"typescript": "5.9",
|
|
88
88
|
"@aws-cdk/cdk-assets-lib": "^1.4.15",
|
|
89
89
|
"@aws-cdk/cloud-assembly-api": "2.3.0",
|
|
90
|
-
"@aws-cdk/cloud-assembly-schema": ">=54.
|
|
90
|
+
"@aws-cdk/cloud-assembly-schema": ">=54.17.0",
|
|
91
91
|
"@aws-cdk/cloudformation-diff": "2.187.2",
|
|
92
92
|
"@aws-cdk/cx-api": "^2",
|
|
93
|
-
"@aws-cdk/toolkit-lib": "^1.38.
|
|
93
|
+
"@aws-cdk/toolkit-lib": "^1.38.1",
|
|
94
94
|
"@aws-sdk/client-appsync": "^3",
|
|
95
95
|
"@aws-sdk/client-bedrock-agentcore-control": "^3",
|
|
96
96
|
"@aws-sdk/client-cloudcontrol": "^3",
|
|
@@ -161,7 +161,7 @@
|
|
|
161
161
|
"publishConfig": {
|
|
162
162
|
"access": "public"
|
|
163
163
|
},
|
|
164
|
-
"version": "2.1135.
|
|
164
|
+
"version": "2.1135.1",
|
|
165
165
|
"packageManager": "yarn@4.17.1",
|
|
166
166
|
"types": "lib/index.d.ts",
|
|
167
167
|
"exports": {
|