@go-to-k/cdkd 0.290.39 → 0.290.40

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/dist/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { n as isVersionOnlyInvocation, t as getCdkdVersion } from "./version-DzcgAjCn.js";
2
+ import { n as isVersionOnlyInvocation, t as getCdkdVersion } from "./version-CEKVu0mE.js";
3
3
 
4
4
  //#region src/cli/pipe-close-handler.ts
5
5
  /**
@@ -74,7 +74,7 @@ async function main() {
74
74
  console.log(getCdkdVersion());
75
75
  return;
76
76
  }
77
- const { buildProgram } = await import("./program-BC_cHG7r.js");
77
+ const { buildProgram } = await import("./program-BmtaBtO_.js");
78
78
  const program = buildProgram();
79
79
  const args = reorderArgs(process.argv);
80
80
  await program.parseAsync(args);
@@ -1,6 +1,6 @@
1
1
  import { C as displayAwsMessage, D as truncateCodePoints, E as isPasteableIdent, S as UNRENDERABLE, T as displaySafe, d as applyDefaultNameForFallback, f as explicitNamePropertyFor, g as looksLikeCdkdGeneratedName, h as getCurrentStackName, m as generateResourceNameWithFallback, n as getLogger, p as generateResourceName, r as isStdoutReservedForPayload, s as getLiveRenderer, v as withStackName, w as displayIdent, x as STACK_REF_MAX_CODE_POINTS, y as withoutGeneratedFallbackName } from "./logger-BkcLg0jL.js";
2
2
  import { a as setAssumedRoleCredentials, i as getPreAssumeEnvCredentials, n as awsClientDefaults, o as setPreAssumeEnvCredentials, r as getAssumedRoleCredentials, t as SECOND_ROLE_PUBLISH_REFUSAL } from "./aws-client-defaults-BoIxyCir.js";
3
- import { t as getCdkdVersion } from "./version-DzcgAjCn.js";
3
+ import { t as getCdkdVersion } from "./version-CEKVu0mE.js";
4
4
  import { AsyncLocalStorage } from "node:async_hooks";
5
5
  import { createHash, randomUUID } from "node:crypto";
6
6
  import { CreateBucketCommand, DeleteObjectCommand, DeleteObjectsCommand, GetBucketLocationCommand, GetBucketReplicationCommand, GetObjectCommand, HeadBucketCommand, HeadObjectCommand, ListObjectVersionsCommand, ListObjectsV2Command, NoSuchKey, PutBucketEncryptionCommand, PutBucketPolicyCommand, PutObjectCommand, PutPublicAccessBlockCommand, S3Client, S3ServiceException } from "@aws-sdk/client-s3";
@@ -2843,7 +2843,7 @@ function collectStackMessages(assemblyDir, artifact) {
2843
2843
  merged[path] = [...merged[path] ?? [], ...entries];
2844
2844
  }
2845
2845
  } catch (error) {
2846
- throw new SynthesisError(`Failed to read stack metadata file ${metadataPath}: ${error instanceof Error ? error.message : String(error)}`, error instanceof Error ? error : void 0);
2846
+ throw new SynthesisError(`Failed to read stack metadata file ${displaySafe(metadataPath)}: ${displaySafe(error instanceof Error ? error.message : String(error))}`, error instanceof Error ? error : void 0);
2847
2847
  }
2848
2848
  }
2849
2849
  const messages = [];
@@ -2899,6 +2899,22 @@ function processStackMessages(stacks, logger, options = {}) {
2899
2899
  //#region src/synthesis/assembly-reader.ts
2900
2900
  /**
2901
2901
  * Reads and parses Cloud Assembly from cdk.out directory
2902
+ *
2903
+ * EVERY value this class renders into a message or a log line goes through
2904
+ * `displaySafe` (issue [#3277](https://github.com/go-to-k/cdkd/issues/3277)).
2905
+ * The reason is the one its absolute-`aws:asset:path` refusal states in its own
2906
+ * text: a manifest key, a template key, a `Metadata` string, a
2907
+ * `directoryName`-derived path and the `JSON.parse` failure quoting a hand-fed
2908
+ * file are all chosen by whoever wrote the assembly, and this is the FIRST
2909
+ * layer the CLI reaches, so on a hostile assembly its output is what a user is
2910
+ * asked to trust. C1 bytes and the bidi overrides survive ordinary string
2911
+ * building, and `formatError` sanitizes only an error's `cause`, never its own
2912
+ * `message` — so a crafted value otherwise appends what reads as a second,
2913
+ * cdkd-authored line. `displaySafe` is the identity on every well-formed
2914
+ * assembly: it neither truncates nor quotes, so a legitimate long asset path
2915
+ * still renders in full and byte-identically. The same rule, for the same
2916
+ * reason, guards the twin refusals in `src/cli/commands/diff-recursive.ts`
2917
+ * (go-to-k/cdkd#3243).
2902
2918
  */
2903
2919
  var AssemblyReader = class {
2904
2920
  logger = getLogger().child("AssemblyReader");
@@ -2910,10 +2926,10 @@ var AssemblyReader = class {
2910
2926
  try {
2911
2927
  const content = readFileSync(manifestPath, "utf-8");
2912
2928
  const manifest = JSON.parse(content);
2913
- this.logger.debug(`Loaded manifest: version=${manifest.version}`);
2929
+ this.logger.debug(`Loaded manifest: version=${displaySafe(manifest.version)}`);
2914
2930
  return manifest;
2915
2931
  } catch (error) {
2916
- throw new SynthesisError(`Failed to read cloud assembly manifest from ${manifestPath}: ${error instanceof Error ? error.message : String(error)}`, error instanceof Error ? error : void 0);
2932
+ throw new SynthesisError(`Failed to read cloud assembly manifest from ${displaySafe(manifestPath)}: ${displaySafe(error instanceof Error ? error.message : String(error))}`, error instanceof Error ? error : void 0);
2917
2933
  }
2918
2934
  }
2919
2935
  /**
@@ -2938,7 +2954,7 @@ var AssemblyReader = class {
2938
2954
  const nestedStacks = this.getAllStacks(nestedDir, nestedManifest);
2939
2955
  stacks.push(...nestedStacks);
2940
2956
  } catch (error) {
2941
- this.logger.warn(`Failed to read nested assembly '${props.directoryName}': ${error instanceof Error ? error.message : String(error)}`);
2957
+ this.logger.warn(`Failed to read nested assembly '${displaySafe(props.directoryName)}': ${displaySafe(error instanceof Error ? error.message : String(error))}`);
2942
2958
  }
2943
2959
  }
2944
2960
  }
@@ -2951,7 +2967,7 @@ var AssemblyReader = class {
2951
2967
  getStack(assemblyDir, manifest, stackName) {
2952
2968
  const stacks = this.getAllStacks(assemblyDir, manifest);
2953
2969
  const stack = stacks.find((s) => s.stackName === stackName);
2954
- if (!stack) throw new SynthesisError(`Stack '${stackName}' not found in assembly. Available: ${stacks.map((s) => s.stackName).join(", ")}`);
2970
+ if (!stack) throw new SynthesisError(`Stack '${displaySafe(stackName)}' not found in assembly. Available: ${stacks.map((s) => displaySafe(s.stackName)).join(", ")}`);
2955
2971
  return stack;
2956
2972
  }
2957
2973
  /**
@@ -2980,21 +2996,21 @@ var AssemblyReader = class {
2980
2996
  const props = artifact.properties;
2981
2997
  const stackName = props?.stackName || artifactId;
2982
2998
  const templateFile = props?.templateFile;
2983
- if (!templateFile) throw new SynthesisError(`Stack '${stackName}' has no templateFile property`);
2999
+ if (!templateFile) throw new SynthesisError(`Stack '${displaySafe(stackName)}' has no templateFile property`);
2984
3000
  const templatePath = join(assemblyDir, templateFile);
2985
3001
  let template;
2986
3002
  try {
2987
3003
  const content = readFileSync(templatePath, "utf-8");
2988
3004
  template = JSON.parse(content);
2989
3005
  } catch (error) {
2990
- throw new SynthesisError(`Failed to read template for stack '${stackName}': ${error instanceof Error ? error.message : String(error)}`, error instanceof Error ? error : void 0);
3006
+ throw new SynthesisError(`Failed to read template for stack '${displaySafe(stackName)}': ${displaySafe(error instanceof Error ? error.message : String(error))}`, error instanceof Error ? error : void 0);
2991
3007
  }
2992
- this.logger.debug(`Stack: ${stackName}, Resources: ${Object.keys(template.Resources ?? {}).length}`);
3008
+ this.logger.debug(`Stack: ${displaySafe(stackName)}, Resources: ${Object.keys(template.Resources ?? {}).length}`);
2993
3009
  let assetManifestPath;
2994
3010
  if (artifact.dependencies) {
2995
3011
  for (const depId of artifact.dependencies) if (assetManifestMap.has(depId)) {
2996
3012
  assetManifestPath = assetManifestMap.get(depId);
2997
- this.logger.debug(`Found asset manifest for ${stackName}: ${depId}`);
3013
+ this.logger.debug(`Found asset manifest for ${displaySafe(stackName)}: ${displaySafe(depId)}`);
2998
3014
  break;
2999
3015
  }
3000
3016
  }
@@ -3006,7 +3022,7 @@ var AssemblyReader = class {
3006
3022
  if (depName !== stackName) dependencyNames.push(depName);
3007
3023
  }
3008
3024
  }
3009
- if (dependencyNames.length > 0) this.logger.debug(`Stack '${stackName}' depends on: [${dependencyNames.join(", ")}]`);
3025
+ if (dependencyNames.length > 0) this.logger.debug(`Stack '${displaySafe(stackName)}' depends on: [${dependencyNames.map((n) => displaySafe(n)).join(", ")}]`);
3010
3026
  let env;
3011
3027
  if (artifact.environment) env = parseEnvironment(artifact.environment);
3012
3028
  const nestedTemplates = {};
@@ -3014,7 +3030,7 @@ var AssemblyReader = class {
3014
3030
  if (resource?.Type !== "AWS::CloudFormation::Stack") continue;
3015
3031
  const assetPath = resource.Metadata?.["aws:asset:path"];
3016
3032
  if (typeof assetPath !== "string" || assetPath.length === 0) continue;
3017
- if (isAbsolute(assetPath) || /^[a-zA-Z]:[\\/]/.test(assetPath) || assetPath.startsWith("\\\\")) throw new SynthesisError(`Stack '${stackName}' nested-stack '${logicalId}' has Metadata['aws:asset:path']='${assetPath}' which is absolute. CDK emits relative asset paths for nested templates; an absolute path indicates the synth output was hand-modified or generated by a non-CDK toolchain. Refusing to load.`);
3033
+ if (isAbsolute(assetPath) || /^[a-zA-Z]:[\\/]/.test(assetPath) || assetPath.startsWith("\\\\")) throw new SynthesisError(`Stack '${displaySafe(stackName)}' nested-stack '${displaySafe(logicalId)}' has Metadata['aws:asset:path']='${displaySafe(assetPath)}' which is absolute. CDK emits relative asset paths for nested templates; an absolute path indicates the synth output was hand-modified or generated by a non-CDK toolchain. Refusing to load.`);
3018
3034
  nestedTemplates[logicalId] = join(assemblyDir, assetPath);
3019
3035
  }
3020
3036
  return {
@@ -33547,7 +33563,7 @@ var CloudControlProvider = class {
33547
33563
  const indeterminateGuard = await this.confirmDeleteTargetIdentity(logicalId, resourceType, physicalId, context);
33548
33564
  if (context?.removeProtection === true && resourceType === "AWS::AutoScaling::AutoScalingGroup") {
33549
33565
  this.logger.debug(`Delegating protected AutoScalingGroup ${logicalId} delete to the SDK ASGProvider (Cloud Control cannot force-delete a protected ASG)`);
33550
- const { ASGProvider } = await import("./asg-provider-CH4oHOxq.js").then((n) => n.n);
33566
+ const { ASGProvider } = await import("./asg-provider-DPTeR_IT.js").then((n) => n.n);
33551
33567
  const asgProvider = new ASGProvider();
33552
33568
  return withIndeterminateGuard(await asgProvider.delete(logicalId, physicalId, resourceType, _properties, context), indeterminateGuard);
33553
33569
  }
@@ -47256,4 +47272,4 @@ var DeployEngine = class DeployEngine {
47256
47272
 
47257
47273
  //#endregion
47258
47274
  export { yellow as $, CrossAccountSecretRefusalError as $i, TemplateParser as $n, validateAssetBucketName as $r, requireConfigObject as $t, createPreDeleteFinalSnapshot as A, __exportAll as Aa, ssmResolvedValueType as Ai, malformedResourcePropertiesWarning as An, hasReasonlessBaselineRefusal as Ar, carriesDynamicReference as At, isStatefulRecreateTargetSync as B, canonicalizeRegion as Bi, refuseMalformedResourcesForDestroy as Bn, WorkGraph as Br, isSettledInstanceState as Bt, namesAnyDeclaredParameter as C, isThrottlingError as Ca, resolveCaptureObservedState as Ci, malformedExportSourceWarning as Cn, forceQuitRecoveryClause as Cr, slowCcOperationTimeoutMs as Ct, PRE_DELETE_SNAPSHOT_TYPES as D, retryClassificationText as Da, resolveUseCdkBootstrapAssets as Di, malformedOutputsWarning as Dn, DEFAULT_STATE_PREFIX as Dr, disableInstanceApiTermination as Dt, ATOMIC_FINAL_SNAPSHOT_TYPES as E, markRedactedCause as Ea, resolveStateBucketWithDefaultAndSource as Ei, malformedOutputsRefusalMessage as En, CUSTOM_RESOURCE_RESPONSE_PREFIX as Er, deleteSkipReason as Et, extractDeploymentEventError as F, uploadCfnTemplate as Fi, refuseMalformedNestedChildOutputs as Fn, orphansAfterRollback as Fr, isImpossibleEmptyStoredAttribute as Ft, toCfnInteger as G, resolveBucketRegion as Gi, repairMalformedResourcesForReadOnly as Gn, AssetModeResolver as Gr, coerceCfnBoolean as Gt, WARM_THROUGHPUT_MEMBERS as H, AssemblyReader as Hi, repairMalformedOutputsForReadOnly as Hn, createAssetRedirectResolver as Hr, normalizeAwsTagsToCfn as Ht, makeSiblingClaimReader as I, CUSTOM_RESOURCE_RESPONSE_OBJECT_DESCRIPTION as Ii, refuseMalformedOutputs as In, orphansCarriedFrom as Ir, isNamelessDynamicReferenceError as It, bold as J, resetAwsClients as Ji, findActionableSilentDrops as Jn, ensureAssetStorage as Jr, configIntegerRefusal as Jt, toFiniteNumber as K, AwsClients as Ki, safeRegion as Kn, BOOTSTRAP_MARKER_PREFIX as Kr, coerceCfnInteger as Kt, planOrphanAdoption as L, decodeListingKey as Li, refuseMalformedOutputsForDestroy as Ln, shouldRetainResource as Lr, isUnboundTemplateParameter as Lt, refusesFinalSnapshot as M, CFN_TEMPLATE_URL_LIMIT as Mi, malformedStateRefusalMessage as Mn, importableOutputKeys as Mr, cfnRefValueFromPhysicalId as Mt, unsupportedFinalSnapshotError as N, MIGRATE_TMP_PREFIX as Ni, producerRecordKey as Nn, importableOutputs as Nr, coerceParameterTypedValue as Nt, buildFinalSnapshotIdentifier as O, describeAwsFailure as Oa, stateBucketExistenceConfirmed as Oi, malformedRenderedContainersWarning as On, exportNamesCarriedFrom as Or, isTerminationProtectionPropagationError as Ot, makeCanonicalizePropertiesFn as P, findLargeInlineResources as Pi, refuseDivergentRecordRegionForDestroy as Pn, isReadableBag as Pr, getAccountInfo as Pt, red as Q, ConfigError as Qi, DagBuilder as Qn, readBootstrapMarkerBody as Qr, requireConfigArray as Qt, MULTI_REGION_RECREATE_BLOCKED_TYPES as R, expectedOwnerParam as Ri, refuseMalformedResourceEntries as Rn, AssetPublisher as Rr, parameterTypeMayLoseSecretIdentity as Rt, computeParameterTaint as S, isRetryableTransientError as Sa, resolveAutoAssetStorage as Si, malformedExportNamesWarning as Sn, buildLockContentionMessage as Sr, isWaitAbandonedError as St, resourcesNamingDeclaredParameter as T, markNonRetryable as Ta, resolveStateBucketWithDefault as Ti, malformedOrphanRecordsWarning as Tn, shellQuote as Tr, deleteIndeterminateGuards as Tt, coerceWarmThroughput as U, processStackMessages as Ui, repairMalformedResourceEntriesForReadOnly as Un, loadPublishableAssetManifest as Ur, resolveExplicitPhysicalId as Ut, renderStatefulReason as V, derivePartitionAndUrlSuffix as Vi, refuseMalformedState as Vn, buildAssetRedirectMap as Vr, WAFv2WebACLProvider as Vt, isWarmThroughputDecrease as W, clearBucketRegionCache as Wi, repairMalformedResourcePropertiesForReadOnly as Wn, rewriteTemplateAssetReferences as Wr, assertRegionMatch as Wt, gray as X, AssetError as Xi, describeTypeWithThrottleRetry as Xn, isCrossRegionRedirect as Xr, readConfigString as Xt, cyan as Y, setAwsClients as Yi, findSilentDropProperties as Yn, getBootstrapMarkerKey as Yr, configStringRefusal as Yt, green as Z, CdkdError as Zi, withRetry as Zn, parseBootstrapMarker as Zr, replayWarn as Zt, bagHoldsSecretExpression as _, formatError as _a, Synthesizer as _i, UNREADABLE_RESOURCES_MAP_ROW as _n, LockManager as _r, endCommandInterruptScope as _t, DeploymentEventsStore as a, LocalStartServiceError as aa, describeDockerFailure as ai, s3BucketDomainName as an, createSecretMasker as ar, secretBearingStateKeyWarning as at, mergeNoChangeOutputs as b, withErrorHandling as ba, getLegacyStateBucketName as bi, hasReadableResources as bn, UNREPRODUCIBLE_LOCK_CLAUSE as br, startInterruptWatch as bt, replayFailedOperations as c, NestedStackChildDirectDestroyError as ca, getDockerCmd as ci, s3BucketWebsiteUrl as cn, identityKeyFor as cr, IAMRoleProvider as ct, updatePartialMessage as d, ResourceTimeoutError as da, runDockerForeground as di, applyCallerIdentityCredentials as dn, maskSecretsInError as dr, ProviderRegistry as dt, DependencyError as ea, validateContainerRepoName as ei, requireConfigString as en, STATE_SOURCED_BASELINE_RULES as er, collectDeclaredOutputNames as et, updatePartialReason as f, ResourceUpdateNotSupportedError as fa, runDockerStreaming as fi, callerEnvCredentials as fn, maskSecretsInText as fr, wouldReturnToSdkProvider as ft, computeImplicitDeleteEdges as g, SynthesisError as ga, getDockerImageBySourceHash as gi, STATE_RESOURCES_MALFORMED as gn, scrubResourceRecord as gr, beginCommandInterruptScope as gt, IMPLICIT_DELETE_DEPENDENCIES as h, StateError as ha, AssetManifestLoader as hi, INTRINSIC_KEYS as hn, redactSecretsForState as hr, maskerOrIdentity as ht, DeploymentEventsReader as i, LocalInvokeBuildError as ia, describeDockerExecFailure as ii, s3BucketArn as in, carriesSecretMask as ir, secretBearing as it, isFinalSnapshotError as j, CFN_TEMPLATE_BODY_LIMIT as ji, malformedResourcesWarning as jn, hasUnverifiableParameterRefusal as jr, carriesFetchableDynamicReference as jt, ccRoutedFinalSnapshotError as k, safeStringify$1 as ka, warnDeprecatedNoPrefixCliFlag as ki, malformedResourceEntriesWarning as kn, hasReadableExportSet as kr, IntrinsicFunctionResolver as kt, replayRollback as l, PartialFailureError as la, partitionSensitiveEnv as li, applyRoleArnIfSet as ln, isSingleDynamicReferenceToken as lr, collectInlinePolicyNamesManagedBySiblings as lt, maskingRetryLogger as m, StackTerminationProtectionError as ma, stripControlChars as mi, DiffCalculator as mn, recoverMaskedOutput as mr, maskDeep as mt, DEFAULT_RESOURCE_WARN_AFTER_MS as n, DynamicReferenceRegionAmbiguousError as na, buildDockerImage as ni, producerRegionsFromState as nn, STATE_SOURCED_READBACK_RULES as nr, exportAliasCollisionScrubWarning as nt, planFailedOps as o, LockError as oa, dockerSpawnEnvWithSensitive as oi, s3BucketDualStackDomainName as on, dynamicReferenceTokens as or, secretSafeKeyDisplay as ot, withResourceDeadline as p, StackHasActiveImportsError as pa, escapeRegExp$1 as pi, envCredentialsAreAssumedRole as pn, recordMaskOnlyValue as pr, createMaskedRetryLogger as pt, formatResourceLine as q, getAwsClients as qi, safeStackName as qn, assertAssetBucketRegion as qr, configBooleanRefusal as qt, DeployEngine as r, IntrinsicResolutionRefusalError as ra, describeDockerCapturedOutput as ri, withSharedDrainBudget as rn, TEMPLATE_SOURCED_RULES as rr, isExportAliasCollision as rt, planRollback as s, MalformedProducerRecordRefusalError as sa, formatDockerLoginError as si, s3BucketRegionalDomainName as sn, errorCauseChain as sr, getCurrentResourceSecrets as st, DEFAULT_RESOURCE_TIMEOUT_MS as t, DeployCancelledError as ta, buildDenyExternalAccessPolicy as ti, classifyReplaySecretRegion as tn, STATE_SOURCED_CROSS_GENERATION_RULES as tr, collectPublishedOutputNames as tt, resolveReplacementOldType as u, ProvisioningError as ua, redactDockerArgvValues as ui, AWS_CREDENTIAL_ENV_KEYS as un, markSameGenerationBag as ur, clearOnUpdateRemoval as ut, isSecretBearingReferenceString as v, isCdkdError as va, synthesisStatusMessage as vi, displayLogicalId as vn, S3StateBackend as vr, interruptWatchListenerCount as vt, reachableDivergentParameters as w, isTransientServerError as wa, resolveSkipPrefix as wi, malformedLocalOutputsWarning as wn, formatLockExpiry as wr, UNSPECIFIED_SKIP_REASON as wt, bindingSkippedOutputs as x, isMarkedNonRetryable as xa, resolveApp as xi, isReadableResourceEntry as xn, buildForceUnlockCommand as xr, CloudControlProvider as xt, keptWholeReasonText as y, normalizeAwsError as ya, getDefaultStateBucketName as yi, hasReadableOutputs as yn, rebuildClientForBucketRegion as yr, isInterruptedWaitError as yt, isStatefulRecreateTargetForReplace as z, PARTITION_TABLE as zi, refuseMalformedResourcePropertiesForOrphan as zn, stringifyValue as zr, refStateLookupFromResource as zt };
47259
- //# sourceMappingURL=deploy-engine-Vze2lc-H.js.map
47275
+ //# sourceMappingURL=deploy-engine-DJxLBuTb.js.map