FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix(import): survive marketplace app config decrypt failure (unblocks GF/CT remap) [DX-7312] by harshitha-cstk · Pull Request #360 · contentstack/cli-plugins · GitHub

fix(import): survive marketplace app config decrypt failure (unblocks GF/CT remap) [DX-7312] - #360

Closed
harshitha-cstk wants to merge 1 commit into
developmentfrom
fix/dx-7312-marketplace-config-decrypt-resilience
Closed

fix(import): survive marketplace app config decrypt failure (unblocks GF/CT remap) [DX-7312]#360
harshitha-cstk wants to merge 1 commit into
developmentfrom
fix/dx-7312-marketplace-config-decrypt-resilience

Conversation

harshitha-cstk commented Aug 26, 2026
edited
Loading

Copy link
Copy Markdown
Contributor

Summary

Fixes the marketplace-app path that caused the GF/CT half of DX-7312: on a stack with an app whose exported configuration can't be decrypted, the whole marketplace-apps module aborted before writing its UID mapping, which then starved the global-field / content-type / entry extension remap (extension_uid ... does not exist in destination stack).

Root cause

updateAppsConfig decrypted inline as the call argument:

.setConfiguration(this.nodeCrypto.decrypt(configuration))

nodeCrypto.decrypt runs synchronously, so a bad-decrypt (ERR_OSSL_BAD_DECRYPT, e.g. the export was encrypted with a different key) throws before the promise chain's .catch — it escapes updateAppsConfig, hits installApps's throw error, and aborts the module. mapper/marketplace_apps/uid-mapping.json is then never written, so GF/CT/entry extension remapping has nothing to map against.

Fix

Decrypt inside a try/catch for both configuration and server_configuration. On failure: log a warn and skip only that app's config push. The app stays installed, its extension_uid mapping is still recorded, and the module completes and writes the UID mapping.

Testing

node bin/dev cm:stacks:import of the previously-failing export (app config triggers ERR_OSSL_BAD_DECRYPT) into a fresh stack:

  • Before: marketplace module aborted, marketplace_apps/uid-mapping.json empty, GF page_banner/table failed with extension_uid ... does not exist.
  • After: WARN: Failed to decrypt configuration for 'Image Preset Builder' ... skipping; Install Apps 4/4; UID mapping written with 8 extension mappings; Global Fields 36/36, 0 extension does not exist errors.

(Unrelated pre-existing failures in that particular export — CTs referencing a featured_articles global field that is absent from the package — are out of scope and predate this change.)

🤖 Generated with Claude Code

…borting the module

`updateAppsConfig` called `nodeCrypto.decrypt(configuration)` inline as the
argument to `.setConfiguration(...)` / `.setServerConfig(...)`. A bad-decrypt
(e.g. ERR_OSSL_BAD_DECRYPT when an app's exported `configuration` was
encrypted with a different key) therefore threw synchronously — outside the
promise chain's `.catch` — and propagated up through `installApps` (which
re-throws), aborting the entire marketplace-apps module.

Because the module aborted, `mapper/marketplace_apps/uid-mapping.json` was
never written. Global fields / content types (and entry data) then had no
marketplace extension mapping to remap against, so their imports failed with
"extension_uid ... does not exist in destination stack".

Fix: decrypt inside a try/catch for both configuration and server_configuration.
On failure, log a warning and skip only that app's config push; the app stays
installed and its extension_uid mapping is still recorded, so downstream
GF/CT/entry remapping works and the uid-mapping file is written.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
harshitha-cstk requested a review from a team as a code owner August 26, 2026 06:11

snyk-io Bot commented Aug 26, 2026
edited
Loading

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 0 244 25 ✅ Passed
🟡 Medium Severity 0 0 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

ℹ️ Vulnerabilities Without Available Fixes (Informational Only)

The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:

  • Critical without fixes: 0
  • High without fixes: 244
  • Medium without fixes: 0
  • Low without fixes: 0

✅ BUILD PASSED - All security checks passed

Copy link
Copy Markdown
Contributor Author

closing the PR as i have merged it to #359

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant


Back | FazBrowse Home | New Git URL