@aws-cdk/integ-runner 2.204.1 → 2.204.2

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.
@@ -11123,7 +11123,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
11123
11123
 
11124
11124
  ----------------
11125
11125
 
11126
- ** ip-address@10.2.0 - https://www.npmjs.com/package/ip-address/v/10.2.0 | MIT
11126
+ ** ip-address@10.4.0 - https://www.npmjs.com/package/ip-address/v/10.4.0 | MIT
11127
11127
  Copyright (C) 2011 by Beau Gunderson
11128
11128
 
11129
11129
  Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -4766,7 +4766,7 @@ var require_semver2 = __commonJS({
4766
4766
  // ../cloud-assembly-schema/cli-version.json
4767
4767
  var require_cli_version = __commonJS({
4768
4768
  "../cloud-assembly-schema/cli-version.json"(exports2, module2) {
4769
- module2.exports = { version: "2.1135.0" };
4769
+ module2.exports = { version: "2.1135.1" };
4770
4770
  }
4771
4771
  });
4772
4772
 
@@ -293503,7 +293503,6 @@ async function deployStack(options, ioHelper) {
293503
293503
  await ioHelper.defaults.info("Falling back to doing a full deployment");
293504
293504
  options.sdk.appendCustomUserAgent("cdk-hotswap/fallback");
293505
293505
  deploymentMethod = deploymentMethod.fallback;
293506
- options = { ...options, express: true };
293507
293506
  } else {
293508
293507
  return {
293509
293508
  type: "did-deploy-stack",
@@ -304515,8 +304514,10 @@ var require_common5 = __commonJS({
304515
304514
  "use strict";
304516
304515
  Object.defineProperty(exports2, "__esModule", { value: true });
304517
304516
  exports2.isInSubnet = isInSubnet;
304517
+ exports2.isHostInSubnet = isHostInSubnet;
304518
304518
  exports2.isCorrect = isCorrect;
304519
304519
  exports2.prefixLengthFromMask = prefixLengthFromMask;
304520
+ exports2.assertByteArray = assertByteArray;
304520
304521
  exports2.numberToPaddedHex = numberToPaddedHex;
304521
304522
  exports2.stringToPaddedHex = stringToPaddedHex;
304522
304523
  exports2.testBit = testBit;
@@ -304525,14 +304526,15 @@ var require_common5 = __commonJS({
304525
304526
  if (this.subnetMask < address.subnetMask) {
304526
304527
  return false;
304527
304528
  }
304528
- if (this.mask(address.subnetMask) === address.mask()) {
304529
- return true;
304530
- }
304531
- return false;
304529
+ return isHostInSubnet.call(this, address);
304532
304530
  }
304533
304531
  __name(isInSubnet, "isInSubnet");
304532
+ function isHostInSubnet(address) {
304533
+ return this.mask(address.subnetMask) === address.mask();
304534
+ }
304535
+ __name(isHostInSubnet, "isHostInSubnet");
304534
304536
  function isCorrect(defaultBits) {
304535
- return function() {
304537
+ return /* @__PURE__ */ __name(function isCorrectForm() {
304536
304538
  if (this.addressMinusSuffix !== this.correctForm()) {
304537
304539
  return false;
304538
304540
  }
@@ -304540,7 +304542,7 @@ var require_common5 = __commonJS({
304540
304542
  return true;
304541
304543
  }
304542
304544
  return this.parsedSubnet === String(this.subnetMask);
304543
- };
304545
+ }, "isCorrectForm");
304544
304546
  }
304545
304547
  __name(isCorrect, "isCorrect");
304546
304548
  function prefixLengthFromMask(value, totalBits) {
@@ -304558,6 +304560,17 @@ var require_common5 = __commonJS({
304558
304560
  return firstZero;
304559
304561
  }
304560
304562
  __name(prefixLengthFromMask, "prefixLengthFromMask");
304563
+ function assertByteArray(bytes, byteCount, family, minimum) {
304564
+ if (bytes.length !== byteCount) {
304565
+ throw new address_error_1.AddressError(`${family} addresses require exactly ${byteCount} bytes`);
304566
+ }
304567
+ for (let i6 = 0; i6 < bytes.length; i6++) {
304568
+ if (!Number.isInteger(bytes[i6]) || bytes[i6] < minimum || bytes[i6] > 255) {
304569
+ throw new address_error_1.AddressError(`All bytes must be integers between ${minimum} and 255`);
304570
+ }
304571
+ }
304572
+ }
304573
+ __name(assertByteArray, "assertByteArray");
304561
304574
  function numberToPaddedHex(number) {
304562
304575
  return number.toString(16).padStart(2, "0");
304563
304576
  }
@@ -304586,7 +304599,7 @@ var require_constants8 = __commonJS({
304586
304599
  exports2.RE_SUBNET_STRING = exports2.RE_ADDRESS = exports2.GROUPS = exports2.BITS = void 0;
304587
304600
  exports2.BITS = 32;
304588
304601
  exports2.GROUPS = 4;
304589
- exports2.RE_ADDRESS = /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/g;
304602
+ 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;
304590
304603
  exports2.RE_SUBNET_STRING = /\/\d{1,2}$/;
304591
304604
  }
304592
304605
  });
@@ -304633,6 +304646,7 @@ var require_ipv4 = __commonJS({
304633
304646
  __name(this, "Address4");
304634
304647
  }
304635
304648
  constructor(address) {
304649
+ this.addressMinusSuffix = "";
304636
304650
  this.groups = constants2.GROUPS;
304637
304651
  this.parsedAddress = [];
304638
304652
  this.parsedSubnet = "";
@@ -304641,6 +304655,7 @@ var require_ipv4 = __commonJS({
304641
304655
  this.v4 = true;
304642
304656
  this.isCorrect = isCorrect4;
304643
304657
  this.isInSubnet = common.isInSubnet;
304658
+ this.isHostInSubnet = common.isHostInSubnet;
304644
304659
  this.address = address;
304645
304660
  const subnet = constants2.RE_SUBNET_STRING.exec(address);
304646
304661
  if (subnet) {
@@ -304666,7 +304681,7 @@ var require_ipv4 = __commonJS({
304666
304681
  try {
304667
304682
  new _Address4(address);
304668
304683
  return true;
304669
- } catch (e6) {
304684
+ } catch {
304670
304685
  return false;
304671
304686
  }
304672
304687
  }
@@ -304678,6 +304693,9 @@ var require_ipv4 = __commonJS({
304678
304693
  */
304679
304694
  parse(address) {
304680
304695
  const groups = address.split(".");
304696
+ if (groups.some((group4) => /^0\d/.test(group4))) {
304697
+ throw new address_error_1.AddressError("IPv4 addresses can't have leading zeroes.");
304698
+ }
304681
304699
  if (!address.match(constants2.RE_ADDRESS)) {
304682
304700
  throw new address_error_1.AddressError("Invalid IPv4 address.");
304683
304701
  }
@@ -304913,7 +304931,7 @@ var require_ipv4 = __commonJS({
304913
304931
  * @returns {Address4}
304914
304932
  */
304915
304933
  static fromBigInt(bigInt) {
304916
- if (bigInt < 0n || bigInt > 0xffffffffn) {
304934
+ if (bigInt < BigInt(0) || bigInt > BigInt(4294967295)) {
304917
304935
  throw new address_error_1.AddressError("IPv4 BigInt must be in the range 0 to 2**32 - 1");
304918
304936
  }
304919
304937
  return _Address4.fromHex(bigInt.toString(16).padStart(8, "0"));
@@ -304926,14 +304944,7 @@ var require_ipv4 = __commonJS({
304926
304944
  * @returns {Address4}
304927
304945
  */
304928
304946
  static fromByteArray(bytes) {
304929
- if (bytes.length !== 4) {
304930
- throw new address_error_1.AddressError("IPv4 addresses require exactly 4 bytes");
304931
- }
304932
- for (let i6 = 0; i6 < bytes.length; i6++) {
304933
- if (!Number.isInteger(bytes[i6]) || bytes[i6] < 0 || bytes[i6] > 255) {
304934
- throw new address_error_1.AddressError("All bytes must be integers between 0 and 255");
304935
- }
304936
- }
304947
+ common.assertByteArray(bytes, 4, "IPv4", 0);
304937
304948
  return this.fromUnsignedByteArray(bytes);
304938
304949
  }
304939
304950
  /**
@@ -304987,49 +304998,49 @@ var require_ipv4 = __commonJS({
304987
304998
  * @returns {boolean}
304988
304999
  */
304989
305000
  isMulticast() {
304990
- return this.isInSubnet(MULTICAST_V4);
305001
+ return this.isHostInSubnet(MULTICAST_V4);
304991
305002
  }
304992
305003
  /**
304993
305004
  * 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`).
304994
305005
  * @returns {boolean}
304995
305006
  */
304996
305007
  isPrivate() {
304997
- return PRIVATE_V4.some((subnet) => this.isInSubnet(subnet));
305008
+ return PRIVATE_V4.some((subnet) => this.isHostInSubnet(subnet));
304998
305009
  }
304999
305010
  /**
305000
305011
  * Returns true if the address is in the loopback range `127.0.0.0/8` ([RFC 1122](https://datatracker.ietf.org/doc/html/rfc1122)).
305001
305012
  * @returns {boolean}
305002
305013
  */
305003
305014
  isLoopback() {
305004
- return this.isInSubnet(LOOPBACK_V4);
305015
+ return this.isHostInSubnet(LOOPBACK_V4);
305005
305016
  }
305006
305017
  /**
305007
305018
  * 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)).
305008
305019
  * @returns {boolean}
305009
305020
  */
305010
305021
  isLinkLocal() {
305011
- return this.isInSubnet(LINK_LOCAL_V4);
305022
+ return this.isHostInSubnet(LINK_LOCAL_V4);
305012
305023
  }
305013
305024
  /**
305014
305025
  * Returns true if the address is the unspecified address `0.0.0.0`.
305015
305026
  * @returns {boolean}
305016
305027
  */
305017
305028
  isUnspecified() {
305018
- return this.isInSubnet(UNSPECIFIED_V4);
305029
+ return this.isHostInSubnet(UNSPECIFIED_V4);
305019
305030
  }
305020
305031
  /**
305021
305032
  * Returns true if the address is the limited broadcast address `255.255.255.255` ([RFC 919](https://datatracker.ietf.org/doc/html/rfc919)).
305022
305033
  * @returns {boolean}
305023
305034
  */
305024
305035
  isBroadcast() {
305025
- return this.isInSubnet(BROADCAST_V4);
305036
+ return this.isHostInSubnet(BROADCAST_V4);
305026
305037
  }
305027
305038
  /**
305028
305039
  * 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)).
305029
305040
  * @returns {boolean}
305030
305041
  */
305031
305042
  isCGNAT() {
305032
- return this.isInSubnet(CGNAT_V4);
305043
+ return this.isHostInSubnet(CGNAT_V4);
305033
305044
  }
305034
305045
  /**
305035
305046
  * Returns a zero-padded base-2 string representation of the address
@@ -305047,7 +305058,7 @@ var require_ipv4 = __commonJS({
305047
305058
  */
305048
305059
  groupForV6() {
305049
305060
  const segments = this.parsedAddress;
305050
- return this.address.replace(constants2.RE_ADDRESS, `<span class="hover-group group-v4 group-6">${segments.slice(0, 2).join(".")}</span>.<span class="hover-group group-v4 group-7">${segments.slice(2, 4).join(".")}</span>`);
305061
+ return this.correctForm().replace(constants2.RE_ADDRESS, `<span class="hover-group group-v4 group-6">${segments.slice(0, 2).join(".")}</span>.<span class="hover-group group-v4 group-7">${segments.slice(2, 4).join(".")}</span>`);
305051
305062
  }
305052
305063
  };
305053
305064
  exports2.Address4 = Address4;
@@ -305104,6 +305115,7 @@ var require_constants9 = __commonJS({
305104
305115
  "ff05::1:3/128": "Multicast (All DHCP servers in this site)",
305105
305116
  "::/128": "Unspecified",
305106
305117
  "::1/128": "Loopback",
305118
+ "::ffff:0:0/96": "IPv4-mapped",
305107
305119
  "ff00::/8": "Multicast",
305108
305120
  "fe80::/10": "Link-local unicast",
305109
305121
  "fc00::/7": "Unique local",
@@ -305116,8 +305128,8 @@ var require_constants9 = __commonJS({
305116
305128
  exports2.RE_BAD_ADDRESS = /([0-9a-f]{5,}|:{3,}|[^:]:$|^:[^:]|\/$)/gi;
305117
305129
  exports2.RE_SUBNET_STRING = /\/\d{1,3}(?=%|$)/;
305118
305130
  exports2.RE_ZONE_STRING = /%.*$/;
305119
- exports2.RE_URL = /^\[{0,1}([0-9a-f:]+)\]{0,1}/;
305120
- exports2.RE_URL_WITH_PORT = /\[([0-9a-f:]+)\]:([0-9]{1,5})/;
305131
+ exports2.RE_URL = /^(?:\[([0-9a-f:.]+)\]|([0-9a-f:.]+))(?:[/?#].*)?$/i;
305132
+ exports2.RE_URL_WITH_PORT = /^\[([0-9a-f:.]+)\]:([0-9]{1,5})(?:[/?#].*)?$/i;
305121
305133
  }
305122
305134
  });
305123
305135
 
@@ -305358,6 +305370,7 @@ var require_ipv6 = __commonJS({
305358
305370
  this.v4 = false;
305359
305371
  this.zone = "";
305360
305372
  this.isInSubnet = common.isInSubnet;
305373
+ this.isHostInSubnet = common.isHostInSubnet;
305361
305374
  this.isCorrect = isCorrect6;
305362
305375
  if (optionalGroups === void 0) {
305363
305376
  this.groups = constants6.GROUPS;
@@ -305374,7 +305387,8 @@ var require_ipv6 = __commonJS({
305374
305387
  throw new address_error_1.AddressError("Invalid subnet mask.");
305375
305388
  }
305376
305389
  address = address.replace(constants6.RE_SUBNET_STRING, "");
305377
- } else if (/\//.test(address)) {
305390
+ }
305391
+ if (/\//.test(address)) {
305378
305392
  throw new address_error_1.AddressError("Invalid subnet mask.");
305379
305393
  }
305380
305394
  const zone = constants6.RE_ZONE_STRING.exec(address);
@@ -305396,7 +305410,7 @@ var require_ipv6 = __commonJS({
305396
305410
  try {
305397
305411
  new _Address6(address);
305398
305412
  return true;
305399
- } catch (e6) {
305413
+ } catch {
305400
305414
  return false;
305401
305415
  }
305402
305416
  }
@@ -305411,7 +305425,7 @@ var require_ipv6 = __commonJS({
305411
305425
  * address.correctForm(); // '::e8:d4a5:1000'
305412
305426
  */
305413
305427
  static fromBigInt(bigInt) {
305414
- if (bigInt < 0n || bigInt > (1n << BigInt(constants6.BITS)) - 1n) {
305428
+ if (bigInt < BigInt(0) || bigInt > (BigInt(1) << BigInt(constants6.BITS)) - BigInt(1)) {
305415
305429
  throw new address_error_1.AddressError("IPv6 BigInt must be in the range 0 to 2**128 - 1");
305416
305430
  }
305417
305431
  const hex = bigInt.toString(16).padStart(32, "0");
@@ -305432,11 +305446,13 @@ var require_ipv6 = __commonJS({
305432
305446
  * addressAndPort.port; // 8080
305433
305447
  */
305434
305448
  static fromURL(url) {
305449
+ var _a2;
305435
305450
  let host;
305436
305451
  let port = null;
305437
305452
  let result2;
305438
- if (url.indexOf("[") !== -1 && url.indexOf("]:") !== -1) {
305439
- result2 = constants6.RE_URL_WITH_PORT.exec(url);
305453
+ const stripped = url.replace(/^[a-z][a-z0-9+.-]*:\/\//i, "");
305454
+ if (stripped.indexOf("[") !== -1 && stripped.indexOf("]:") !== -1) {
305455
+ result2 = constants6.RE_URL_WITH_PORT.exec(stripped);
305440
305456
  if (result2 === null) {
305441
305457
  return {
305442
305458
  error: "failed to parse address with port",
@@ -305446,9 +305462,8 @@ var require_ipv6 = __commonJS({
305446
305462
  }
305447
305463
  host = result2[1];
305448
305464
  port = result2[2];
305449
- } else if (url.indexOf("/") !== -1) {
305450
- url = url.replace(/^[a-z0-9]+:\/\//, "");
305451
- result2 = constants6.RE_URL.exec(url);
305465
+ } else {
305466
+ result2 = constants6.RE_URL.exec(stripped);
305452
305467
  if (result2 === null) {
305453
305468
  return {
305454
305469
  error: "failed to parse address from URL",
@@ -305456,13 +305471,11 @@ var require_ipv6 = __commonJS({
305456
305471
  port: null
305457
305472
  };
305458
305473
  }
305459
- host = result2[1];
305460
- } else {
305461
- host = url;
305474
+ host = (_a2 = result2[1]) !== null && _a2 !== void 0 ? _a2 : result2[2];
305462
305475
  }
305463
305476
  if (port) {
305464
305477
  port = parseInt(port, 10);
305465
- if (port < 0 || port > 65536) {
305478
+ if (port < 0 || port > 65535) {
305466
305479
  port = null;
305467
305480
  }
305468
305481
  } else {
@@ -305724,7 +305737,7 @@ var require_ipv6 = __commonJS({
305724
305737
  getType() {
305725
305738
  for (let i6 = 0; i6 < TYPE_SUBNETS.length; i6++) {
305726
305739
  const entry = TYPE_SUBNETS[i6];
305727
- if (this.isInSubnet(entry[0])) {
305740
+ if (this.isHostInSubnet(entry[0])) {
305728
305741
  return entry[1];
305729
305742
  }
305730
305743
  }
@@ -305857,18 +305870,20 @@ var require_ipv6 = __commonJS({
305857
305870
  }
305858
305871
  const groups = address.split(":");
305859
305872
  const lastGroup = groups.slice(-1)[0];
305873
+ const v4Octets = lastGroup.split(".");
305874
+ if (v4Octets.length === constants4.GROUPS && v4Octets.every((octet) => /^\d{1,3}$/.test(octet))) {
305875
+ if (v4Octets.some((octet) => /^0\d/.test(octet))) {
305876
+ const highlighted = v4Octets.map(spanLeadingZeroes4).join(".");
305877
+ const prefix = groups.slice(0, -1).map(helpers.escapeHtml).join(":");
305878
+ const separator = groups.length > 1 ? ":" : "";
305879
+ throw new address_error_1.AddressError("IPv4 addresses can't have leading zeroes.", `${prefix}${separator}${highlighted}`);
305880
+ }
305881
+ }
305860
305882
  const address4 = lastGroup.match(constants4.RE_ADDRESS);
305861
305883
  if (address4) {
305862
305884
  this.parsedAddress4 = address4[0];
305863
- this.address4 = new ipv4_1.Address4(this.parsedAddress4);
305864
- for (let i6 = 0; i6 < this.address4.groups; i6++) {
305865
- if (/^0[0-9]+/.test(this.address4.parsedAddress[i6])) {
305866
- const highlighted = this.address4.parsedAddress.map(spanLeadingZeroes4).join(".");
305867
- const prefix = groups.slice(0, -1).map(helpers.escapeHtml).join(":");
305868
- const separator = groups.length > 1 ? ":" : "";
305869
- throw new address_error_1.AddressError("IPv4 addresses can't have leading zeroes.", `${prefix}${separator}${highlighted}`);
305870
- }
305871
- }
305885
+ const v4Suffix = this.subnetMask >= 96 ? `/${this.subnetMask - 96}` : "";
305886
+ this.address4 = new ipv4_1.Address4(`${this.parsedAddress4}${v4Suffix}`);
305872
305887
  this.v4 = true;
305873
305888
  groups[groups.length - 1] = this.address4.toGroup6();
305874
305889
  address = groups.join(":");
@@ -305952,7 +305967,11 @@ var require_ipv6 = __commonJS({
305952
305967
  return BigInt(`0x${this.parsedAddress.map(paddedHex).join("")}`);
305953
305968
  }
305954
305969
  /**
305955
- * Return the last two groups of this address as an IPv4 address string
305970
+ * Return the last two groups of this address as an IPv4 address string.
305971
+ * If this address carries a CIDR prefix that covers the trailing 32 bits
305972
+ * (i.e. `subnetMask >= 96`), the resulting `Address4` inherits the
305973
+ * corresponding v4 prefix (`subnetMask - 96`); otherwise it defaults to
305974
+ * `/32`.
305956
305975
  * @returns {Address4}
305957
305976
  * @example
305958
305977
  * var address = new Address6('2001:4860:4001::1825:bf11');
@@ -305960,7 +305979,16 @@ var require_ipv6 = __commonJS({
305960
305979
  */
305961
305980
  to4() {
305962
305981
  const binary = this.binaryZeroPad().split("");
305963
- return ipv4_1.Address4.fromHex(BigInt(`0b${binary.slice(96, 128).join("")}`).toString(16).padStart(8, "0"));
305982
+ const hex = BigInt(`0b${binary.slice(96, 128).join("")}`).toString(16).padStart(8, "0");
305983
+ if (this.subnetMask >= 96) {
305984
+ const v4Mask = this.subnetMask - 96;
305985
+ const groups = [];
305986
+ for (let i6 = 0; i6 < 8; i6 += 2) {
305987
+ groups.push(parseInt(hex.slice(i6, i6 + 2), 16));
305988
+ }
305989
+ return new ipv4_1.Address4(`${groups.join(".")}/${v4Mask}`);
305990
+ }
305991
+ return ipv4_1.Address4.fromHex(hex);
305964
305992
  }
305965
305993
  /**
305966
305994
  * Return the v4-in-v6 form of the address
@@ -305974,7 +306002,7 @@ var require_ipv6 = __commonJS({
305974
306002
  if (!/:$/.test(correct)) {
305975
306003
  infix = ":";
305976
306004
  }
305977
- return correct + infix + address4.address;
306005
+ return correct + infix + address4.correctForm();
305978
306006
  }
305979
306007
  /**
305980
306008
  * Decodes the Teredo tunneling fields embedded in this address. Returns the
@@ -306064,7 +306092,14 @@ var require_ipv6 = __commonJS({
306064
306092
  bits = prefixBits.slice(0, 96) + v4Bits;
306065
306093
  } else {
306066
306094
  const beforeU = 64 - pl2;
306067
- bits = prefixBits.slice(0, pl2) + v4Bits.slice(0, beforeU) + "00000000" + v4Bits.slice(beforeU) + "0".repeat(128 - 72 - (32 - beforeU));
306095
+ bits = [
306096
+ prefixBits.slice(0, pl2),
306097
+ v4Bits.slice(0, beforeU),
306098
+ // Bits 64 to 71 are the reserved u octet and are always zero.
306099
+ "00000000",
306100
+ v4Bits.slice(beforeU),
306101
+ "0".repeat(128 - 72 - (32 - beforeU))
306102
+ ].join("");
306068
306103
  }
306069
306104
  const hex = BigInt(`0b${bits}`).toString(16).padStart(32, "0");
306070
306105
  const groups = [];
@@ -306087,7 +306122,7 @@ var require_ipv6 = __commonJS({
306087
306122
  if (pl2 !== 32 && pl2 !== 40 && pl2 !== 48 && pl2 !== 56 && pl2 !== 64 && pl2 !== 96) {
306088
306123
  throw new address_error_1.AddressError("NAT64 prefix length must be 32, 40, 48, 56, 64, or 96");
306089
306124
  }
306090
- if (!this.isInSubnet(prefix6)) {
306125
+ if (!this.isHostInSubnet(prefix6)) {
306091
306126
  return null;
306092
306127
  }
306093
306128
  const bits = this.binaryZeroPad();
@@ -306111,9 +306146,7 @@ var require_ipv6 = __commonJS({
306111
306146
  * @returns {Array}
306112
306147
  */
306113
306148
  toByteArray() {
306114
- const valueWithoutPadding = this.bigInt().toString(16);
306115
- const leadingPad = "0".repeat(valueWithoutPadding.length % 2);
306116
- const value = `${leadingPad}${valueWithoutPadding}`;
306149
+ const value = this.bigInt().toString(16).padStart(constants6.BITS / 4, "0");
306117
306150
  const bytes = [];
306118
306151
  for (let i6 = 0, length = value.length; i6 < length; i6 += 2) {
306119
306152
  bytes.push(parseInt(value.substring(i6, i6 + 2), 16));
@@ -306132,19 +306165,28 @@ var require_ipv6 = __commonJS({
306132
306165
  /**
306133
306166
  * Convert a byte array to an Address6 object.
306134
306167
  *
306168
+ * Accepts unsigned bytes (0 to 255) or signed bytes (-128 to 127, as an
306169
+ * `Int8Array` or a Java `byte[]` holds them), folding signed values to their
306170
+ * unsigned equivalent. Throws `AddressError` unless given exactly 16
306171
+ * integers from -128 to 255.
306172
+ *
306135
306173
  * To convert from a Node.js `Buffer`, spread it: `Address6.fromByteArray([...buf])`.
306136
306174
  * @returns {Address6}
306137
306175
  */
306138
306176
  static fromByteArray(bytes) {
306177
+ common.assertByteArray(bytes, 16, "IPv6", -128);
306139
306178
  return this.fromUnsignedByteArray(bytes.map(unsignByte));
306140
306179
  }
306141
306180
  /**
306142
306181
  * Convert an unsigned byte array to an Address6 object.
306143
306182
  *
306183
+ * Throws `AddressError` unless given exactly 16 integers from 0 to 255.
306184
+ *
306144
306185
  * To convert from a Node.js `Buffer`, spread it: `Address6.fromUnsignedByteArray([...buf])`.
306145
306186
  * @returns {Address6}
306146
306187
  */
306147
306188
  static fromUnsignedByteArray(bytes) {
306189
+ common.assertByteArray(bytes, 16, "IPv6", 0);
306148
306190
  const BYTE_MAX = BigInt("256");
306149
306191
  let result2 = BigInt("0");
306150
306192
  let multiplier = BigInt("1");
@@ -306166,6 +306208,10 @@ var require_ipv6 = __commonJS({
306166
306208
  * @returns {boolean}
306167
306209
  */
306168
306210
  isLinkLocal() {
306211
+ const embedded = this.embeddedIPv4();
306212
+ if (embedded) {
306213
+ return embedded.isLinkLocal();
306214
+ }
306169
306215
  if (this.getBitsBase2(0, 64) === "1111111010000000000000000000000000000000000000000000000000000000") {
306170
306216
  return true;
306171
306217
  }
@@ -306176,6 +306222,10 @@ var require_ipv6 = __commonJS({
306176
306222
  * @returns {boolean}
306177
306223
  */
306178
306224
  isMulticast() {
306225
+ const embedded = this.embeddedIPv4();
306226
+ if (embedded) {
306227
+ return embedded.isMulticast();
306228
+ }
306179
306229
  const type = this.getType();
306180
306230
  return type === "Multicast" || type.startsWith("Multicast ");
306181
306231
  }
@@ -306198,27 +306248,54 @@ var require_ipv6 = __commonJS({
306198
306248
  * @returns {boolean}
306199
306249
  */
306200
306250
  isMapped4() {
306201
- return this.isInSubnet(IPV4_MAPPED_SUBNET);
306251
+ return this.isHostInSubnet(IPV4_MAPPED_SUBNET);
306252
+ }
306253
+ /**
306254
+ * If this address embeds a routable IPv4 address — i.e. it is IPv4-mapped
306255
+ * (`::ffff:0:0/96`) or sits in the NAT64 well-known prefix (`64:ff9b::/96`,
306256
+ * [RFC 6052](https://datatracker.ietf.org/doc/html/rfc6052)) — return that
306257
+ * embedded address as an {@link Address4}; otherwise return null.
306258
+ *
306259
+ * The special-property checks (`isLoopback`, `isLinkLocal`, `isMulticast`,
306260
+ * `isUnspecified`, `isPrivate`, `isCGNAT`, `isBroadcast`) call this first and
306261
+ * delegate to the embedded {@link Address4} when present, so a literal such as
306262
+ * `::ffff:127.0.0.1` is classified by what it actually reaches (loopback)
306263
+ * rather than by its IPv6 wrapper (which `getType()` reports as IPv4-mapped).
306264
+ * This matters wherever the checks back a trust-boundary decision (e.g. an
306265
+ * SSRF allow/deny filter): without normalization, `::ffff:10.0.0.1`,
306266
+ * `::ffff:169.254.169.254`, `64:ff9b::7f00:1`, etc. would all read as
306267
+ * non-internal.
306268
+ * @returns {Address4 | null}
306269
+ */
306270
+ embeddedIPv4() {
306271
+ if (this.isMapped4() || this.isHostInSubnet(NAT64_WELL_KNOWN_SUBNET)) {
306272
+ return this.to4();
306273
+ }
306274
+ return null;
306202
306275
  }
306203
306276
  /**
306204
306277
  * Returns true if the address is a Teredo address, false otherwise
306205
306278
  * @returns {boolean}
306206
306279
  */
306207
306280
  isTeredo() {
306208
- return this.isInSubnet(TEREDO_SUBNET);
306281
+ return this.isHostInSubnet(TEREDO_SUBNET);
306209
306282
  }
306210
306283
  /**
306211
306284
  * Returns true if the address is a 6to4 address, false otherwise
306212
306285
  * @returns {boolean}
306213
306286
  */
306214
306287
  is6to4() {
306215
- return this.isInSubnet(SIX_TO_FOUR_SUBNET);
306288
+ return this.isHostInSubnet(SIX_TO_FOUR_SUBNET);
306216
306289
  }
306217
306290
  /**
306218
306291
  * Returns true if the address is a loopback address, false otherwise
306219
306292
  * @returns {boolean}
306220
306293
  */
306221
306294
  isLoopback() {
306295
+ const embedded = this.embeddedIPv4();
306296
+ if (embedded) {
306297
+ return embedded.isLoopback();
306298
+ }
306222
306299
  return this.getType() === "Loopback";
306223
306300
  }
306224
306301
  /**
@@ -306226,13 +306303,64 @@ var require_ipv6 = __commonJS({
306226
306303
  * @returns {boolean}
306227
306304
  */
306228
306305
  isULA() {
306229
- return this.isInSubnet(ULA_SUBNET);
306306
+ return this.isHostInSubnet(ULA_SUBNET);
306307
+ }
306308
+ /**
306309
+ * Returns true if the address is private, i.e. a Unique Local Address in
306310
+ * `fc00::/7` ([RFC 4193](https://datatracker.ietf.org/doc/html/rfc4193)) or an
306311
+ * IPv4-mapped / NAT64 address whose embedded IPv4 address is in one of the
306312
+ * [RFC 1918](https://datatracker.ietf.org/doc/html/rfc1918) private ranges
306313
+ * (e.g. `::ffff:10.0.0.1`). This is the IPv6 counterpart to
306314
+ * {@link Address4.isPrivate}; use it instead of {@link isULA} when you need to
306315
+ * catch mapped RFC 1918 addresses as well as native ULAs.
306316
+ * @returns {boolean}
306317
+ */
306318
+ isPrivate() {
306319
+ const embedded = this.embeddedIPv4();
306320
+ if (embedded) {
306321
+ return embedded.isPrivate();
306322
+ }
306323
+ return this.isULA();
306324
+ }
306325
+ /**
306326
+ * Returns true if the address is an IPv4-mapped / NAT64 address whose embedded
306327
+ * IPv4 address is in the carrier-grade NAT range `100.64.0.0/10`
306328
+ * ([RFC 6598](https://datatracker.ietf.org/doc/html/rfc6598)), false
306329
+ * otherwise. There is no native IPv6 CGNAT range, so this only ever returns
306330
+ * true for an embedded IPv4 address (e.g. `::ffff:100.64.0.1`).
306331
+ * @returns {boolean}
306332
+ */
306333
+ isCGNAT() {
306334
+ const embedded = this.embeddedIPv4();
306335
+ if (embedded) {
306336
+ return embedded.isCGNAT();
306337
+ }
306338
+ return false;
306339
+ }
306340
+ /**
306341
+ * Returns true if the address is an IPv4-mapped / NAT64 address whose embedded
306342
+ * IPv4 address is the limited broadcast address `255.255.255.255`
306343
+ * ([RFC 919](https://datatracker.ietf.org/doc/html/rfc919)), false otherwise.
306344
+ * There is no IPv6 broadcast, so this only ever returns true for an embedded
306345
+ * IPv4 address (e.g. `::ffff:255.255.255.255`).
306346
+ * @returns {boolean}
306347
+ */
306348
+ isBroadcast() {
306349
+ const embedded = this.embeddedIPv4();
306350
+ if (embedded) {
306351
+ return embedded.isBroadcast();
306352
+ }
306353
+ return false;
306230
306354
  }
306231
306355
  /**
306232
306356
  * Returns true if the address is the unspecified address `::`.
306233
306357
  * @returns {boolean}
306234
306358
  */
306235
306359
  isUnspecified() {
306360
+ const embedded = this.embeddedIPv4();
306361
+ if (embedded) {
306362
+ return embedded.isUnspecified();
306363
+ }
306236
306364
  return this.getType() === "Unspecified";
306237
306365
  }
306238
306366
  /**
@@ -306240,7 +306368,7 @@ var require_ipv6 = __commonJS({
306240
306368
  * @returns {boolean}
306241
306369
  */
306242
306370
  isDocumentation() {
306243
- return this.isInSubnet(DOCUMENTATION_SUBNET);
306371
+ return this.isHostInSubnet(DOCUMENTATION_SUBNET);
306244
306372
  }
306245
306373
  // #endregion
306246
306374
  // #region HTML
@@ -306385,6 +306513,7 @@ var require_ipv6 = __commonJS({
306385
306513
  var ULA_SUBNET = new Address6("fc00::/7");
306386
306514
  var DOCUMENTATION_SUBNET = new Address6("2001:db8::/32");
306387
306515
  var IPV4_MAPPED_SUBNET = new Address6("::ffff:0:0/96");
306516
+ var NAT64_WELL_KNOWN_SUBNET = new Address6("64:ff9b::/96");
306388
306517
  }
306389
306518
  });
306390
306519
 
package/package.json CHANGED
@@ -68,9 +68,9 @@
68
68
  "@aws-cdk/aws-service-spec": "^0.1.199",
69
69
  "@aws-cdk/cdk-assets-lib": "1.4.15",
70
70
  "@aws-cdk/cloud-assembly-api": "2.3.0",
71
- "@aws-cdk/cloud-assembly-schema": ">=54.16.0",
71
+ "@aws-cdk/cloud-assembly-schema": ">=54.17.0",
72
72
  "@aws-cdk/cloudformation-diff": "2.187.2",
73
- "@aws-cdk/toolkit-lib": "1.38.0",
73
+ "@aws-cdk/toolkit-lib": "1.38.1",
74
74
  "@aws-sdk/client-cloudformation": "^3",
75
75
  "chalk": "^4",
76
76
  "chokidar": "^4",
@@ -102,7 +102,7 @@
102
102
  "publishConfig": {
103
103
  "access": "public"
104
104
  },
105
- "version": "2.204.1",
105
+ "version": "2.204.2",
106
106
  "packageManager": "yarn@4.17.1",
107
107
  "types": "lib/index.d.ts",
108
108
  "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"yarn projen\"."