@ccslabs/xtend 0.1.0-rc.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/CHANGELOG.md +65 -0
- package/LICENSE +201 -0
- package/README.md +184 -0
- package/a11y/motion-contrast-policy.d.ts +32 -0
- package/a11y/motion-contrast-policy.js +261 -0
- package/a11y/runtime-a11y-contract.d.ts +44 -0
- package/a11y/runtime-a11y-contract.js +385 -0
- package/a11y/screenreader-signals.d.ts +32 -0
- package/a11y/screenreader-signals.js +372 -0
- package/api.d.ts +168 -0
- package/api.js +864 -0
- package/catalog/catalog-public-types.d.ts +66 -0
- package/catalog/component-catalog-coverage.d.ts +20 -0
- package/catalog/component-catalog-coverage.js +377 -0
- package/catalog/component-long-tail-migration.d.ts +18 -0
- package/catalog/component-long-tail-migration.js +305 -0
- package/catalog/component-regression-priority.d.ts +20 -0
- package/catalog/component-regression-priority.js +305 -0
- package/catalog/enterprise-component-flex-release-handoff.d.ts +32 -0
- package/catalog/enterprise-component-flex-release-handoff.js +437 -0
- package/catalog/enterprise-component-style-audit.d.ts +22 -0
- package/catalog/enterprise-component-style-audit.js +353 -0
- package/catalog/enterprise-form-control-theme-a11y.d.ts +19 -0
- package/catalog/enterprise-form-control-theme-a11y.js +220 -0
- package/catalog/enterprise-icon-control-audit.d.ts +21 -0
- package/catalog/enterprise-icon-control-audit.js +258 -0
- package/catalog/enterprise-layout-display-media-tokenization.d.ts +20 -0
- package/catalog/enterprise-layout-display-media-tokenization.js +237 -0
- package/catalog/enterprise-navigation-routing-state-hardening.d.ts +20 -0
- package/catalog/enterprise-navigation-routing-state-hardening.js +255 -0
- package/catalog/enterprise-overlay-mode-token-parity.d.ts +15 -0
- package/catalog/enterprise-overlay-mode-token-parity.js +178 -0
- package/catalog/enterprise-third-party-authoring-guide.d.ts +23 -0
- package/catalog/enterprise-third-party-authoring-guide.js +310 -0
- package/catalog/enterprise-visual-dom-snapshot-matrix.d.ts +31 -0
- package/catalog/enterprise-visual-dom-snapshot-matrix.js +357 -0
- package/catalog/epic10-existing-component-metadata.d.ts +25 -0
- package/catalog/epic10-existing-component-metadata.js +534 -0
- package/catalog/epic10-p0-component-wave.d.ts +28 -0
- package/catalog/epic10-p0-component-wave.js +688 -0
- package/catalog/epic10-platform-gates.d.ts +31 -0
- package/catalog/epic10-platform-gates.js +425 -0
- package/catalog/epic10-release-handoff.d.ts +30 -0
- package/catalog/epic10-release-handoff.js +195 -0
- package/catalog/epic11-enterprise-ux-handoff.d.ts +29 -0
- package/catalog/epic11-enterprise-ux-handoff.js +403 -0
- package/catalog/epic12-docs-adoption.d.ts +29 -0
- package/catalog/epic12-docs-adoption.js +183 -0
- package/catalog/epic12-rc0-gate-matrix.d.ts +36 -0
- package/catalog/epic12-rc0-gate-matrix.js +439 -0
- package/catalog/epic12-rc0-handoff.d.ts +30 -0
- package/catalog/epic12-rc0-handoff.js +385 -0
- package/catalog/epic13-conditional-network-evidence-ci.d.ts +35 -0
- package/catalog/epic13-conditional-network-evidence-ci.js +278 -0
- package/catalog/epic13-conditional-network-evidence.d.ts +34 -0
- package/catalog/epic13-conditional-network-evidence.js +280 -0
- package/catalog/epic13-docs-rmt-production-hardening.d.ts +39 -0
- package/catalog/epic13-docs-rmt-production-hardening.js +286 -0
- package/catalog/epic13-hydration-performance-closure.d.ts +33 -0
- package/catalog/epic13-hydration-performance-closure.js +234 -0
- package/catalog/epic13-known-residual-triage.d.ts +32 -0
- package/catalog/epic13-known-residual-triage.js +339 -0
- package/catalog/epic13-package-export-lock.d.ts +41 -0
- package/catalog/epic13-package-export-lock.js +604 -0
- package/catalog/epic13-prod-browser-csp-smoke.d.ts +35 -0
- package/catalog/epic13-prod-browser-csp-smoke.js +218 -0
- package/catalog/epic13-rc1-gate-matrix-ci-handoff.d.ts +36 -0
- package/catalog/epic13-rc1-gate-matrix-ci-handoff.js +418 -0
- package/catalog/epic13-rc1-migration-notes.d.ts +36 -0
- package/catalog/epic13-rc1-migration-notes.js +271 -0
- package/catalog/epic13-rc1-readiness.d.ts +33 -0
- package/catalog/epic13-rc1-readiness.js +487 -0
- package/catalog/epic13-release-owner-acceptance.d.ts +33 -0
- package/catalog/epic13-release-owner-acceptance.js +354 -0
- package/catalog/epic13-release-report-pack-dry-run-evidence.d.ts +36 -0
- package/catalog/epic13-release-report-pack-dry-run-evidence.js +253 -0
- package/catalog/epic13-rmt-production-readiness.d.ts +35 -0
- package/catalog/epic13-rmt-production-readiness.js +314 -0
- package/catalog/epic13-trusted-dom-boundary.d.ts +36 -0
- package/catalog/epic13-trusted-dom-boundary.js +230 -0
- package/catalog/epic13-visual-owner-artifact.d.ts +35 -0
- package/catalog/epic13-visual-owner-artifact.js +233 -0
- package/catalog/epic14-lsp-handoff.d.ts +28 -0
- package/catalog/epic14-lsp-handoff.js +312 -0
- package/catalog/epic14-rmt-tooling.d.ts +33 -0
- package/catalog/epic14-rmt-tooling.js +282 -0
- package/catalog/surface-manager-adapter-runtime.d.ts +37 -0
- package/catalog/surface-manager-adapter-runtime.js +203 -0
- package/catalog/surface-manager-browser-lab.d.ts +39 -0
- package/catalog/surface-manager-browser-lab.js +225 -0
- package/catalog/surface-manager-controller.d.ts +43 -0
- package/catalog/surface-manager-controller.js +290 -0
- package/catalog/surface-manager-layout-engines.d.ts +32 -0
- package/catalog/surface-manager-layout-engines.js +161 -0
- package/catalog/surface-manager-lazy-loading.d.ts +35 -0
- package/catalog/surface-manager-lazy-loading.js +173 -0
- package/catalog/surface-manager-materialization.d.ts +37 -0
- package/catalog/surface-manager-materialization.js +202 -0
- package/catalog/surface-manager-native-rmt-surfaces.d.ts +48 -0
- package/catalog/surface-manager-native-rmt-surfaces.js +325 -0
- package/catalog/surface-manager-overlay-bridge.d.ts +42 -0
- package/catalog/surface-manager-overlay-bridge.js +247 -0
- package/catalog/surface-manager-persistence.d.ts +37 -0
- package/catalog/surface-manager-persistence.js +178 -0
- package/catalog/surface-manager-quality-gates.d.ts +48 -0
- package/catalog/surface-manager-quality-gates.js +324 -0
- package/catalog/surface-manager-release-handoff.d.ts +47 -0
- package/catalog/surface-manager-release-handoff.js +274 -0
- package/catalog/surface-manager-remote-policy.d.ts +34 -0
- package/catalog/surface-manager-remote-policy.js +199 -0
- package/catalog/surface-manager-rmt-authoring.d.ts +44 -0
- package/catalog/surface-manager-rmt-authoring.js +368 -0
- package/catalog/surface-manager-route-lifecycle.d.ts +32 -0
- package/catalog/surface-manager-route-lifecycle.js +162 -0
- package/catalog/surface-manager-runtime-release-handoff.d.ts +36 -0
- package/catalog/surface-manager-runtime-release-handoff.js +245 -0
- package/catalog/surface-manager-side-panel-runtime.d.ts +46 -0
- package/catalog/surface-manager-side-panel-runtime.js +307 -0
- package/catalog/surface-manager-stack-policy.d.ts +32 -0
- package/catalog/surface-manager-stack-policy.js +169 -0
- package/catalog/surface-manager-window-runtime.d.ts +45 -0
- package/catalog/surface-manager-window-runtime.js +285 -0
- package/catalog/surface-manager-workbench-fixture.d.ts +50 -0
- package/catalog/surface-manager-workbench-fixture.js +315 -0
- package/catalog/type-exports-api.js +236 -0
- package/catalog/type-exports-builder.js +405 -0
- package/catalog/type-exports-catalog.js +394 -0
- package/catalog/type-exports-loader.js +266 -0
- package/catalog/type-exports-policy.js +461 -0
- package/catalog/type-exports-rmt.js +407 -0
- package/catalog/type-exports-vendor.js +365 -0
- package/catalog/type-exports.js +574 -0
- package/components/icon-packs/core.js +154 -0
- package/components/icon-packs/lucide.js +136 -0
- package/components/manifest.json +44 -0
- package/components/prism.d.ts +73 -0
- package/components/prism.js +300 -0
- package/components/turndown.d.ts +34 -0
- package/components/turndown.js +107 -0
- package/components/x-rmt-lifecycle-demo-build.d.ts +78 -0
- package/components/x-rmt-lifecycle-demo-build.js +1175 -0
- package/components/x-rmt-lifecycle-demo.d.ts +83 -0
- package/components/x-rmt-lifecycle-demo.js +1175 -0
- package/components/xalert.d.ts +42 -0
- package/components/xalert.js +538 -0
- package/components/xbutton.d.ts +127 -0
- package/components/xbutton.js +612 -0
- package/components/xcalendar.d.ts +39 -0
- package/components/xcalendar.js +338 -0
- package/components/xcards.d.ts +34 -0
- package/components/xcards.js +253 -0
- package/components/xcheckbox.d.ts +48 -0
- package/components/xcheckbox.js +448 -0
- package/components/xcode.d.ts +35 -0
- package/components/xcode.js +370 -0
- package/components/xdialog.d.ts +48 -0
- package/components/xdialog.js +763 -0
- package/components/xdrawer.d.ts +61 -0
- package/components/xdrawer.js +654 -0
- package/components/xfooter.d.ts +41 -0
- package/components/xfooter.js +351 -0
- package/components/xform.d.ts +43 -0
- package/components/xform.js +456 -0
- package/components/xheader.d.ts +68 -0
- package/components/xheader.js +1253 -0
- package/components/xhero.d.ts +42 -0
- package/components/xhero.js +475 -0
- package/components/xicon.d.ts +146 -0
- package/components/xicon.js +688 -0
- package/components/xinput.d.ts +37 -0
- package/components/xinput.js +444 -0
- package/components/xlightbox.d.ts +48 -0
- package/components/xlightbox.js +571 -0
- package/components/xlink.d.ts +63 -0
- package/components/xlink.js +565 -0
- package/components/xmasonry.d.ts +35 -0
- package/components/xmasonry.js +666 -0
- package/components/xmenu.d.ts +118 -0
- package/components/xmenu.js +1005 -0
- package/components/xmodal.d.ts +64 -0
- package/components/xmodal.js +831 -0
- package/components/xplayer.d.ts +57 -0
- package/components/xplayer.js +1748 -0
- package/components/xpopover.d.ts +54 -0
- package/components/xpopover.js +466 -0
- package/components/xprogress.d.ts +40 -0
- package/components/xprogress.js +345 -0
- package/components/xradio.d.ts +50 -0
- package/components/xradio.js +474 -0
- package/components/xrouter.d.ts +244 -0
- package/components/xrouter.js +1841 -0
- package/components/xsection.d.ts +34 -0
- package/components/xsection.js +253 -0
- package/components/xselect.d.ts +46 -0
- package/components/xselect.js +463 -0
- package/components/xsidepanel.d.ts +56 -0
- package/components/xsidepanel.js +728 -0
- package/components/xspinner.d.ts +38 -0
- package/components/xspinner.js +388 -0
- package/components/xstate.d.ts +137 -0
- package/components/xstate.js +493 -0
- package/components/xstatus.d.ts +41 -0
- package/components/xstatus.js +381 -0
- package/components/xsummary.d.ts +43 -0
- package/components/xsummary.js +293 -0
- package/components/xsurfacemanager-controller.d.ts +130 -0
- package/components/xsurfacemanager-controller.js +699 -0
- package/components/xsurfacemanager.d.ts +452 -0
- package/components/xsurfacemanager.js +3775 -0
- package/components/xsurfaceoverlay-bridge.d.ts +43 -0
- package/components/xsurfaceoverlay-bridge.js +238 -0
- package/components/xsurfacewindow.d.ts +50 -0
- package/components/xsurfacewindow.js +576 -0
- package/components/xtabs.d.ts +73 -0
- package/components/xtabs.js +611 -0
- package/components/xtend-public-types.d.ts +208 -0
- package/components/xtextarea.d.ts +46 -0
- package/components/xtextarea.js +451 -0
- package/components/xtheme.d.ts +253 -0
- package/components/xtheme.js +1438 -0
- package/components/xtoast.d.ts +39 -0
- package/components/xtoast.js +389 -0
- package/components/xtooltip.d.ts +53 -0
- package/components/xtooltip.js +432 -0
- package/components/xtype.d.ts +42 -0
- package/components/xtype.js +244 -0
- package/components/xutils.d.ts +164 -0
- package/components/xutils.js +496 -0
- package/components/xwriter.d.ts +67 -0
- package/components/xwriter.js +854 -0
- package/design-tokens/themes/enterprise-light.json +40 -0
- package/design-tokens/themes/xtend-signature.json +126 -0
- package/design-tokens/xtend-design-tokens.d.ts +95 -0
- package/design-tokens/xtend-design-tokens.js +395 -0
- package/design-tokens/xtheme-token-alias-layer.d.ts +84 -0
- package/design-tokens/xtheme-token-alias-layer.js +423 -0
- package/docs/.htaccess +51 -0
- package/docs/README.md +340 -0
- package/docs/XTend-ADR.md +221 -0
- package/docs/a11y-keyboard-smokes.md +62 -0
- package/docs/about.md +18 -0
- package/docs/api.md +157 -0
- package/docs/best-practices.md +76 -0
- package/docs/component-catalog-coverage.md +58 -0
- package/docs/component-lab.md +103 -0
- package/docs/component-long-tail-migration.md +41 -0
- package/docs/component-platform.md +159 -0
- package/docs/component-ux-app-authoring.md +130 -0
- package/docs/component-ux-authoring.md +96 -0
- package/docs/component-ux-gates.md +45 -0
- package/docs/components/x-rmt-lifecycle-demo-build.md +60 -0
- package/docs/components/xalert.md +81 -0
- package/docs/components/xbutton.md +103 -0
- package/docs/components/xcalendar.md +82 -0
- package/docs/components/xcards.md +128 -0
- package/docs/components/xcheckbox.md +102 -0
- package/docs/components/xcode.md +126 -0
- package/docs/components/xdialog.md +92 -0
- package/docs/components/xdrawer.md +84 -0
- package/docs/components/xfooter.md +126 -0
- package/docs/components/xform.md +128 -0
- package/docs/components/xheader.md +308 -0
- package/docs/components/xhero.md +142 -0
- package/docs/components/xicon.md +125 -0
- package/docs/components/xinput.md +129 -0
- package/docs/components/xlightbox.md +98 -0
- package/docs/components/xlink.md +109 -0
- package/docs/components/xmasonry.md +124 -0
- package/docs/components/xmenu.md +158 -0
- package/docs/components/xmodal.md +82 -0
- package/docs/components/xplayer.md +104 -0
- package/docs/components/xpopover.md +67 -0
- package/docs/components/xprogress.md +56 -0
- package/docs/components/xradio.md +103 -0
- package/docs/components/xrouter.md +260 -0
- package/docs/components/xsection.md +125 -0
- package/docs/components/xselect.md +105 -0
- package/docs/components/xsidepanel.md +30 -0
- package/docs/components/xspinner.md +102 -0
- package/docs/components/xstate.md +148 -0
- package/docs/components/xstatus.md +55 -0
- package/docs/components/xsummary.md +78 -0
- package/docs/components/xsurfacemanager.md +27 -0
- package/docs/components/xsurfacewindow.md +21 -0
- package/docs/components/xtabs.md +160 -0
- package/docs/components/xtextarea.md +98 -0
- package/docs/components/xtheme.md +167 -0
- package/docs/components/xtoast.md +62 -0
- package/docs/components/xtooltip.md +66 -0
- package/docs/components/xtype.md +82 -0
- package/docs/components/xutils.md +144 -0
- package/docs/components/xwriter.md +94 -0
- package/docs/components.md +117 -0
- package/docs/conditional-network-evidence-ci.md +38 -0
- package/docs/conditional-network-evidence.md +50 -0
- package/docs/core-migration-guide.md +110 -0
- package/docs/design-tokens.md +116 -0
- package/docs/docs-rmt-production-hardening.md +31 -0
- package/docs/enterprise-adoption.md +411 -0
- package/docs/enterprise-component-flex-release-handoff.md +129 -0
- package/docs/epic10-platform-gates.md +62 -0
- package/docs/epic10-release-handoff.md +81 -0
- package/docs/epic11-enterprise-ux-handoff.md +70 -0
- package/docs/epic12-rc0-handoff.md +61 -0
- package/docs/existing-component-metadata.md +67 -0
- package/docs/hydration-performance-closure.md +34 -0
- package/docs/hydration-policies.md +71 -0
- package/docs/index.php +1625 -0
- package/docs/known-residual-triage.md +22 -0
- package/docs/manifest-import-policy.md +79 -0
- package/docs/manifest.md +106 -0
- package/docs/menu.json +1190 -0
- package/docs/motion-contrast.md +67 -0
- package/docs/package-export-lock.md +44 -0
- package/docs/performance-measurements.md +106 -0
- package/docs/performance-regression.md +89 -0
- package/docs/performance.md +94 -0
- package/docs/previews/README.md +17 -0
- package/docs/prod-browser-csp-smokes.md +40 -0
- package/docs/public-component-types.md +79 -0
- package/docs/quick-start-guide.md +152 -0
- package/docs/rc0-adoption-guide.md +102 -0
- package/docs/rc0-gate-matrix.md +58 -0
- package/docs/rc1-gate-matrix-ci-handoff.md +56 -0
- package/docs/rc1-migration-notes.md +69 -0
- package/docs/rc1-readiness.md +46 -0
- package/docs/release-owner-acceptance.md +56 -0
- package/docs/release-report-pack-dry-run-evidence.md +39 -0
- package/docs/rmt-dsl-authoring-polish.md +122 -0
- package/docs/rmt-first-demo-app.md +77 -0
- package/docs/rmt-first-xtend-apps.md +105 -0
- package/docs/rmt-kernel-panic-recovery-incident-handoff.md +61 -0
- package/docs/rmt-kernel-security-hardening-migration.md +50 -0
- package/docs/rmt-kernel-trusted-output-authoring.md +69 -0
- package/docs/rmt-language-server.md +177 -0
- package/docs/rmt-lifecycle-demo.md +25 -0
- package/docs/rmt-linter.md +140 -0
- package/docs/rmt-production-readiness.md +63 -0
- package/docs/rmt-tooling-release-gates.md +77 -0
- package/docs/rmt-vnext-authoring.md +60 -0
- package/docs/rmt-vnext-cross-surface-events.md +68 -0
- package/docs/rmt-vnext-enterprise-mfe-handoff.md +70 -0
- package/docs/rmt-vnext-migration-notes.md +62 -0
- package/docs/rmt-vnext-release-handoff.md +69 -0
- package/docs/rmt-vnext-remote-surfaces.md +90 -0
- package/docs/rmt-vnext-surface-registry-enterprise.md +76 -0
- package/docs/screenreader-signals.md +56 -0
- package/docs/supply-chain-gates.md +100 -0
- package/docs/surface-manager-authoring-guide.md +94 -0
- package/docs/surface-manager-browser-lab.md +45 -0
- package/docs/surface-manager-component-lab.md +43 -0
- package/docs/surface-manager-controller.md +66 -0
- package/docs/surface-manager-layout-engines.md +32 -0
- package/docs/surface-manager-lazy-hydration.md +63 -0
- package/docs/surface-manager-migration-guide.md +94 -0
- package/docs/surface-manager-native-rmt-surfaces.md +38 -0
- package/docs/surface-manager-overlay-bridge.md +53 -0
- package/docs/surface-manager-persistence.md +30 -0
- package/docs/surface-manager-quality-gates.md +51 -0
- package/docs/surface-manager-release-handoff.md +68 -0
- package/docs/surface-manager-remote-policy.md +54 -0
- package/docs/surface-manager-rmt-authoring.md +86 -0
- package/docs/surface-manager-route-lifecycle.md +59 -0
- package/docs/surface-manager-runtime-release-handoff.md +69 -0
- package/docs/surface-manager-side-panel-runtime.md +36 -0
- package/docs/surface-manager-stack-policy.md +39 -0
- package/docs/surface-manager-window-runtime.md +47 -0
- package/docs/surface-manager-workbench-fixture.md +43 -0
- package/docs/third-party-design-authoring.md +406 -0
- package/docs/trusted-dom-boundary-browser-proof.md +32 -0
- package/docs/trusted-dom-sanitizing.md +110 -0
- package/docs/type-exports.md +61 -0
- package/docs/typescript-components.md +63 -0
- package/docs/utils/fabric-runtime.js +650 -0
- package/docs/utils/pageloader.js +2823 -0
- package/docs/utils/parsedown.php +298 -0
- package/docs/visual-browser-regression.md +83 -0
- package/docs/visual-owner-artifacts.md +46 -0
- package/docs/visual-snapshot-automation.md +87 -0
- package/docs/xtend-api-types.md +55 -0
- package/docs/xtend-builder-types.md +55 -0
- package/docs/xtend-catalog-types.md +44 -0
- package/docs/xtend-fabric-rmt-lane-mapping.md +143 -0
- package/docs/xtend-fabric.md +474 -0
- package/docs/xtend-loader-types.md +58 -0
- package/docs/xtend-loader.md +265 -0
- package/docs/xtend-policy-types.md +38 -0
- package/docs/xtend-rmt-types.md +39 -0
- package/docs/xtend-vendor-types.md +36 -0
- package/docs/xtendrmt-app-dsl.md +269 -0
- package/docs/xtendrmt-migration-guide.md +235 -0
- package/docs/xtendrmt-native-authoring.md +337 -0
- package/docs/xtendrmt-overview.md +89 -0
- package/docs/xtendrmt-parsedown-docs.rmt +956 -0
- package/docs/xtendrmt-parsedown-scheduling.md +301 -0
- package/docs/xtendrmt-runtime-bridge.md +155 -0
- package/fabric/hydration-policy.d.ts +27 -0
- package/fabric/hydration-policy.js +306 -0
- package/fabric/package.json +58 -0
- package/fabric/rmt-lane-mapping.d.ts +47 -0
- package/fabric/rmt-lane-mapping.js +504 -0
- package/fabric/xtend-fabric.d.ts +81 -0
- package/fabric/xtend-fabric.js +2669 -0
- package/fabric/xtend-policy-public-types.d.ts +135 -0
- package/package.json +8225 -0
- package/security/README.md +54 -0
- package/security/manifest-import-policy.d.ts +43 -0
- package/security/manifest-import-policy.js +260 -0
- package/security/supply-chain-gate-policy.d.ts +45 -0
- package/security/supply-chain-gate-policy.js +249 -0
- package/security/trusted-dom-policy.d.ts +36 -0
- package/security/trusted-dom-policy.js +316 -0
- package/tools/package.json +77 -0
- package/tools/rmt-editor/vscode/README.md +33 -0
- package/tools/rmt-editor/vscode/extension.d.ts +9 -0
- package/tools/rmt-editor/vscode/extension.js +55 -0
- package/tools/rmt-editor/vscode/language-configuration.json +28 -0
- package/tools/rmt-editor/vscode/package.json +83 -0
- package/tools/rmt-editor/vscode/snippets/rmt.code-snippets +243 -0
- package/tools/rmt-editor/vscode/syntaxes/rmt.tmLanguage.json +13 -0
- package/tools/rmt-editor/vscode/xtend-rmt-language-0.0.0-enterprise-readiness.vsix +0 -0
- package/tools/rmt-language/code-actions.d.ts +15 -0
- package/tools/rmt-language/code-actions.js +566 -0
- package/tools/rmt-language/completions.d.ts +22 -0
- package/tools/rmt-language/completions.js +475 -0
- package/tools/rmt-language/definitions.d.ts +13 -0
- package/tools/rmt-language/definitions.js +212 -0
- package/tools/rmt-language/diagnostics.d.ts +23 -0
- package/tools/rmt-language/diagnostics.js +486 -0
- package/tools/rmt-language/format-adapter.d.ts +16 -0
- package/tools/rmt-language/format-adapter.js +270 -0
- package/tools/rmt-language/hover.d.ts +12 -0
- package/tools/rmt-language/hover.js +326 -0
- package/tools/rmt-language/kernel-escalation.d.ts +122 -0
- package/tools/rmt-language/kernel-escalation.js +427 -0
- package/tools/rmt-language/kernel-panic-monitor.d.ts +176 -0
- package/tools/rmt-language/kernel-panic-monitor.js +674 -0
- package/tools/rmt-language/kernel-policy-parity.d.ts +142 -0
- package/tools/rmt-language/kernel-policy-parity.js +629 -0
- package/tools/rmt-language/kernel-recovery.d.ts +173 -0
- package/tools/rmt-language/kernel-recovery.js +666 -0
- package/tools/rmt-language/kernel-scheduler-failure.d.ts +136 -0
- package/tools/rmt-language/kernel-scheduler-failure.js +486 -0
- package/tools/rmt-language/kernel-security-regression.d.ts +154 -0
- package/tools/rmt-language/kernel-security-regression.js +465 -0
- package/tools/rmt-language/kernel-trust-authority.d.ts +120 -0
- package/tools/rmt-language/kernel-trust-authority.js +549 -0
- package/tools/rmt-language/parser.d.ts +14 -0
- package/tools/rmt-language/parser.js +111 -0
- package/tools/rmt-language/rmt-tooling-public-types.d.ts +179 -0
- package/tools/rmt-language/rules/boundary-policy.js +81 -0
- package/tools/rmt-language/rules/document-policy.js +65 -0
- package/tools/rmt-language/rules/index.js +29 -0
- package/tools/rmt-language/rules/route-policy.js +81 -0
- package/tools/rmt-language/rules/scheduler-policy.js +66 -0
- package/tools/rmt-language/rules/template-policy.js +130 -0
- package/tools/rmt-language/semantic-graph.d.ts +18 -0
- package/tools/rmt-language/semantic-graph.js +827 -0
- package/tools/rmt-language/snippets/README.md +17 -0
- package/tools/rmt-language/snippets/index.d.ts +17 -0
- package/tools/rmt-language/snippets/index.js +417 -0
- package/tools/rmt-language/snippets/rmt.code-snippets +243 -0
- package/tools/rmt-language/source-model.d.ts +14 -0
- package/tools/rmt-language/source-model.js +731 -0
- package/tools/rmt-language/symbols.d.ts +13 -0
- package/tools/rmt-language/symbols.js +183 -0
- package/tools/rmt-language/vnext-compatibility.d.ts +28 -0
- package/tools/rmt-language/vnext-compatibility.js +675 -0
- package/tools/rmt-language/vnext-compiler.d.ts +17 -0
- package/tools/rmt-language/vnext-compiler.js +716 -0
- package/tools/rmt-language/vnext-composition.d.ts +30 -0
- package/tools/rmt-language/vnext-composition.js +595 -0
- package/tools/rmt-language/vnext-conditions.d.ts +25 -0
- package/tools/rmt-language/vnext-conditions.js +474 -0
- package/tools/rmt-language/vnext-cross-surface-events.d.ts +30 -0
- package/tools/rmt-language/vnext-cross-surface-events.js +607 -0
- package/tools/rmt-language/vnext-degradation.d.ts +23 -0
- package/tools/rmt-language/vnext-degradation.js +428 -0
- package/tools/rmt-language/vnext-enterprise-fixtures.d.ts +28 -0
- package/tools/rmt-language/vnext-enterprise-fixtures.js +487 -0
- package/tools/rmt-language/vnext-enterprise-registry.d.ts +21 -0
- package/tools/rmt-language/vnext-enterprise-registry.js +495 -0
- package/tools/rmt-language/vnext-enterprise-release.d.ts +44 -0
- package/tools/rmt-language/vnext-enterprise-release.js +472 -0
- package/tools/rmt-language/vnext-event-governance.d.ts +29 -0
- package/tools/rmt-language/vnext-event-governance.js +488 -0
- package/tools/rmt-language/vnext-events.d.ts +44 -0
- package/tools/rmt-language/vnext-events.js +680 -0
- package/tools/rmt-language/vnext-import-resolver.d.ts +28 -0
- package/tools/rmt-language/vnext-import-resolver.js +642 -0
- package/tools/rmt-language/vnext-lifecycle.d.ts +22 -0
- package/tools/rmt-language/vnext-lifecycle.js +404 -0
- package/tools/rmt-language/vnext-parser.d.ts +21 -0
- package/tools/rmt-language/vnext-parser.js +1391 -0
- package/tools/rmt-language/vnext-regression.d.ts +25 -0
- package/tools/rmt-language/vnext-regression.js +394 -0
- package/tools/rmt-language/vnext-release.d.ts +29 -0
- package/tools/rmt-language/vnext-release.js +293 -0
- package/tools/rmt-language/vnext-remote-compatibility.d.ts +33 -0
- package/tools/rmt-language/vnext-remote-compatibility.js +892 -0
- package/tools/rmt-language/vnext-remote-compiler.d.ts +14 -0
- package/tools/rmt-language/vnext-remote-compiler.js +520 -0
- package/tools/rmt-language/vnext-remote-manifest.d.ts +33 -0
- package/tools/rmt-language/vnext-remote-manifest.js +538 -0
- package/tools/rmt-language/vnext-remote-security.d.ts +27 -0
- package/tools/rmt-language/vnext-remote-security.js +380 -0
- package/tools/rmt-language/vnext-remote-tooling.d.ts +25 -0
- package/tools/rmt-language/vnext-remote-tooling.js +805 -0
- package/tools/rmt-language/vnext-scheduler.d.ts +24 -0
- package/tools/rmt-language/vnext-scheduler.js +469 -0
- package/tools/rmt-language/vnext-security.d.ts +28 -0
- package/tools/rmt-language/vnext-security.js +597 -0
- package/tools/rmt-language/vnext-streaming.d.ts +28 -0
- package/tools/rmt-language/vnext-streaming.js +593 -0
- package/tools/rmt-language/vnext-surfaces.d.ts +24 -0
- package/tools/rmt-language/vnext-surfaces.js +406 -0
- package/tools/rmt-language/vnext-tooling.d.ts +25 -0
- package/tools/rmt-language/vnext-tooling.js +728 -0
- package/tools/rmt-language-server/protocol.d.ts +22 -0
- package/tools/rmt-language-server/protocol.js +352 -0
- package/tools/rmt-language-server/server.d.ts +15 -0
- package/tools/rmt-language-server/server.js +622 -0
- package/tools/rmt-linter/cli.d.ts +14 -0
- package/tools/rmt-linter/cli.js +450 -0
- package/tools/rmt-linter/reporter.d.ts +16 -0
- package/tools/rmt-linter/reporter.js +472 -0
- package/xtend-builder/README.md +83 -0
- package/xtend-builder/a11y/README.md +42 -0
- package/xtend-builder/a11y/component-a11y-profile.d.ts +14 -0
- package/xtend-builder/a11y/component-a11y-profile.js +314 -0
- package/xtend-builder/blueprints/README.md +105 -0
- package/xtend-builder/blueprints/component-blueprint.contract.d.ts +16 -0
- package/xtend-builder/blueprints/component-blueprint.contract.js +343 -0
- package/xtend-builder/builder-public-types.d.ts +234 -0
- package/xtend-builder/extensions/README.md +26 -0
- package/xtend-builder/extensions/component-extension-points.d.ts +11 -0
- package/xtend-builder/extensions/component-extension-points.js +277 -0
- package/xtend-builder/generators/README.md +149 -0
- package/xtend-builder/generators/component-files.d.ts +5 -0
- package/xtend-builder/generators/component-files.js +769 -0
- package/xtend-builder/generators/component-plan.d.ts +4 -0
- package/xtend-builder/generators/component-plan.js +104 -0
- package/xtend-builder/generators/registry.d.ts +6 -0
- package/xtend-builder/generators/registry.js +118 -0
- package/xtend-builder/generators/rmt-build.js +738 -0
- package/xtend-builder/generators/rmt-lifecycle-demo.js +922 -0
- package/xtend-builder/lib/cli.d.ts +9 -0
- package/xtend-builder/lib/cli.js +543 -0
- package/xtend-builder/lib/layout.d.ts +6 -0
- package/xtend-builder/lib/layout.js +153 -0
- package/xtend-builder/lib/package-resolver.js +25 -0
- package/xtend-builder/package.json +90 -0
- package/xtend-builder/performance/README.md +31 -0
- package/xtend-builder/performance/component-performance-profile.d.ts +11 -0
- package/xtend-builder/performance/component-performance-profile.js +347 -0
- package/xtend-builder/performance/component-ux-performance-contract.d.ts +27 -0
- package/xtend-builder/performance/component-ux-performance-contract.js +424 -0
- package/xtend-builder/preview/README.md +61 -0
- package/xtend-builder/preview/component-lab-ux-inspector.d.ts +20 -0
- package/xtend-builder/preview/component-lab-ux-inspector.js +448 -0
- package/xtend-builder/preview/component-lab.d.ts +14 -0
- package/xtend-builder/preview/component-lab.js +278 -0
- package/xtend-builder/preview/component-preview.d.ts +5 -0
- package/xtend-builder/preview/component-preview.js +160 -0
- package/xtend-builder/scaffold.config.d.ts +4 -0
- package/xtend-builder/scaffold.config.js +2056 -0
- package/xtend-builder/scaffold.d.ts +3 -0
- package/xtend-builder/scaffold.js +11 -0
- package/xtend-builder/templates/README.md +33 -0
- package/xtend-builder/templates/component/a11y.template.ts +11 -0
- package/xtend-builder/templates/component/component-suite.template.d.ts +2 -0
- package/xtend-builder/templates/component/component-suite.template.js +108 -0
- package/xtend-builder/templates/component/contract.template.ts +10 -0
- package/xtend-builder/templates/component/demo-plan.template.md +73 -0
- package/xtend-builder/templates/component/docs.template.md +301 -0
- package/xtend-builder/templates/component/fixture-data.template.ts +28 -0
- package/xtend-builder/templates/component/fixture.template.html +37 -0
- package/xtend-builder/templates/component/manifest-plan.template.json +22 -0
- package/xtend-builder/templates/component/performance.template.ts +13 -0
- package/xtend-builder/templates/component/rmt.template.ts +12 -0
- package/xtend-builder/templates/component/source.template.d.ts +2 -0
- package/xtend-builder/templates/component/source.template.js +137 -0
- package/xtend-builder/templates/component/source.template.ts +110 -0
- package/xtend-builder/templates/component/types.template.d.ts +423 -0
- package/xtend-builder/templates/loader.d.ts +4 -0
- package/xtend-builder/templates/loader.js +51 -0
- package/xtend-builder/templates/registry.d.ts +6 -0
- package/xtend-builder/templates/registry.js +119 -0
- package/xtend-builder/typing/README.md +130 -0
- package/xtend-builder/typing/component-contract-v2.d.ts +15 -0
- package/xtend-builder/typing/component-contract-v2.js +248 -0
- package/xtend-builder/typing/component-network-contract.d.ts +22 -0
- package/xtend-builder/typing/component-network-contract.js +478 -0
- package/xtend-builder/typing/component-shell-contract.d.ts +21 -0
- package/xtend-builder/typing/component-shell-contract.js +312 -0
- package/xtend-builder/typing/component-styling-contract.d.ts +22 -0
- package/xtend-builder/typing/component-styling-contract.js +301 -0
- package/xtend-builder/typing/component-types.d.ts +10 -0
- package/xtend-builder/typing/component-types.js +551 -0
- package/xtend-builder/typing/enterprise-component-flex-hardening-contract.d.ts +20 -0
- package/xtend-builder/typing/enterprise-component-flex-hardening-contract.js +332 -0
- package/xtend-builder/typing/feedback-status-ux-contract.d.ts +25 -0
- package/xtend-builder/typing/feedback-status-ux-contract.js +347 -0
- package/xtend-builder/typing/form-controls-ux-contract.d.ts +25 -0
- package/xtend-builder/typing/form-controls-ux-contract.js +357 -0
- package/xtend-builder/typing/layout-display-media-ux-contract.d.ts +25 -0
- package/xtend-builder/typing/layout-display-media-ux-contract.js +420 -0
- package/xtend-builder/typing/navigation-routing-ux-contract.d.ts +17 -0
- package/xtend-builder/typing/navigation-routing-ux-contract.js +297 -0
- package/xtend-builder/typing/overlay-interaction-ux-contract.d.ts +25 -0
- package/xtend-builder/typing/overlay-interaction-ux-contract.js +383 -0
- package/xtend-builder/typing/rmt-dsl-authoring-polish.d.ts +27 -0
- package/xtend-builder/typing/rmt-dsl-authoring-polish.js +419 -0
- package/xtend-builder/typing/rmt-shell-authoring-contract.d.ts +26 -0
- package/xtend-builder/typing/rmt-shell-authoring-contract.js +315 -0
- package/xtend-builder/utils/README.md +8 -0
- package/xtend-builder/utils/naming.d.ts +7 -0
- package/xtend-builder/utils/naming.js +36 -0
- package/xtend-builder/utils/validation.d.ts +5 -0
- package/xtend-builder/utils/validation.js +95 -0
- package/xtend-builder/wiring/README.md +46 -0
- package/xtend-builder/wiring/features.d.ts +5 -0
- package/xtend-builder/wiring/features.js +165 -0
- package/xtend-builder/wiring/hydration.d.ts +4 -0
- package/xtend-builder/wiring/hydration.js +44 -0
- package/xtend-builder/wiring/manifest.d.ts +5 -0
- package/xtend-builder/wiring/manifest.js +48 -0
- package/xtend-builder/workflows/README.md +47 -0
- package/xtend-builder/workflows/developer-workflow.d.ts +6 -0
- package/xtend-builder/workflows/developer-workflow.js +125 -0
- package/xtend-builder/writing/manifest-patcher.d.ts +49 -0
- package/xtend-builder/writing/manifest-patcher.js +391 -0
- package/xtend-builder/writing/write-plan.d.ts +148 -0
- package/xtend-builder/writing/write-plan.js +646 -0
- package/xtend-dev.d.ts +23 -0
- package/xtend-dev.js +4 -0
- package/xtend-loader.d.ts +201 -0
- package/xtend-loader.js +1704 -0
- package/xtend.css +402 -0
- package/xtendrmt/package.json +64 -0
- package/xtendrmt/rmt-core.d.ts +4452 -0
- package/xtendrmt/rmt-core.esm.js +25793 -0
- package/xtendrmt/rmt-first-demo-app.js +265 -0
- package/xtendrmt/rmt-first-demo-app.rmt +737 -0
- package/xtendrmt/rmt-lifecycle-demo.app.js +493 -0
- package/xtendrmt/rmt-lifecycle-demo.core.json +810 -0
- package/xtendrmt/rmt-lifecycle-demo.rmt +35 -0
- package/xtendrmt/rmt-lifecycle-demo.rmt-build.app.js +153 -0
- package/xtendrmt/rmt-lifecycle-demo.rmt-build.core.json +810 -0
- package/xtendrmt/rmt-lifecycle-demo.rmt-build.scaffold.json +202 -0
- package/xtendrmt/rmt-lifecycle-demo.scaffold.json +187 -0
- package/xtendrmt/rmt-manifest.json +548 -0
- package/xtendrmt/rmt-runtime.browser.js +26183 -0
- package/xtendrmt/rmt-runtime.esm.js +26214 -0
- package/xtendrmt/rmt-vnext-enterprise-mfe-demo.core.json +849 -0
- package/xtendrmt/rmt-vnext-enterprise-mfe-demo.rmt +50 -0
- package/xtendrmt/rmt-vnext-reference-demo.core.json +1069 -0
- package/xtendrmt/rmt-vnext-reference-demo.rmt +50 -0
- package/xtendrmt/rmt.schema.json +3145 -0
- package/xtendrmt/surface-workbench.js +316 -0
- package/xtendrmt/surface-workbench.rmt +762 -0
- package/xtendrmt/xtendrmt-bestcase-demo.core.json +1187 -0
- package/xtendrmt/xtendrmt-bestcase-demo.js +1728 -0
- package/xtendrmt/xtendrmt-bestcase-demo.rmt +57 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# XTend Security Contracts
|
|
2
|
+
|
|
3
|
+
Status: introduced with ER-WP-29 and extended with ER-WP-30 and ER-WP-28
|
|
4
|
+
|
|
5
|
+
## Purpose
|
|
6
|
+
|
|
7
|
+
`security/` holds repo-local, machine-readable security contracts. These modules are policy surfaces, not runtime sanitizers.
|
|
8
|
+
|
|
9
|
+
## Manifest Import Policy
|
|
10
|
+
|
|
11
|
+
`manifest-import-policy.js` exposes:
|
|
12
|
+
|
|
13
|
+
- `xtend.security.loader-policy.v1`
|
|
14
|
+
- `xtend.security.manifest-policy.v1`
|
|
15
|
+
- `xtend.security.import-policy.v1`
|
|
16
|
+
- `xtend.security.manifest-import-gate.v1`
|
|
17
|
+
|
|
18
|
+
The policy classifies Manifest URLs, Manifest Records and dynamic module URLs as local allowed imports or refused security boundaries. It is mirrored by `xtend-loader.js` for runtime Refusals and by `tests/security/manifest_import_policy_suite.js` for local gates.
|
|
19
|
+
|
|
20
|
+
## Trusted DOM
|
|
21
|
+
|
|
22
|
+
`trusted-dom-policy.js` exposes:
|
|
23
|
+
|
|
24
|
+
- `xtend.security.trusted-dom-policy.v1`
|
|
25
|
+
- `xtend.security.sanitizing-boundary.v1`
|
|
26
|
+
- `xtend.security.markup-classification.v1`
|
|
27
|
+
- `xtend.security.trusted-dom-sink.v1`
|
|
28
|
+
|
|
29
|
+
The policy classifies text, attributes, structured templates, RMT `html_fragment` and Parsedown HTML, then maps them to allowed, restricted or forbidden DOM sinks.
|
|
30
|
+
|
|
31
|
+
## Supply Chain
|
|
32
|
+
|
|
33
|
+
`supply-chain-gate-policy.js` exposes:
|
|
34
|
+
|
|
35
|
+
- `xtend.security.supply-chain-gate-plan.v1`
|
|
36
|
+
- `xtend.security.dependency-audit-gate.v1`
|
|
37
|
+
- `xtend.security.license-policy.v1`
|
|
38
|
+
- `xtend.security.vulnerability-policy.v1`
|
|
39
|
+
- `xtend.security.release-supply-chain-gate.v1`
|
|
40
|
+
|
|
41
|
+
The policy defines the offline local gate, planned CI audit commands, license rules, vulnerability thresholds and publish boundary for later release automation.
|
|
42
|
+
|
|
43
|
+
## Gates
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
node --check security/trusted-dom-policy.js
|
|
47
|
+
node --check security/supply-chain-gate-policy.js
|
|
48
|
+
node --check security/manifest-import-policy.js
|
|
49
|
+
node scripts/verify_manifest_import_policy.js --json
|
|
50
|
+
node scripts/verify_supply_chain_policy.js --json
|
|
51
|
+
node scripts/run_xtend_tests.js manifest-import-policy --json
|
|
52
|
+
node scripts/run_xtend_tests.js supply-chain --json
|
|
53
|
+
node scripts/run_xtend_tests.js references --json
|
|
54
|
+
```
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export * from '../fabric/xtend-policy-public-types';
|
|
2
|
+
import type {
|
|
3
|
+
XtendPolicyConstant,
|
|
4
|
+
XtendPolicyOptions,
|
|
5
|
+
XtendSecurityClassification
|
|
6
|
+
} from '../fabric/xtend-policy-public-types';
|
|
7
|
+
|
|
8
|
+
export interface XtendManifestImportPolicy {
|
|
9
|
+
schema: string;
|
|
10
|
+
loaderPolicy: string;
|
|
11
|
+
manifestPolicy: string;
|
|
12
|
+
importPolicy: string;
|
|
13
|
+
mode: string;
|
|
14
|
+
allowedProtocols: string[];
|
|
15
|
+
refusedProtocols: string[];
|
|
16
|
+
localHosts: string[];
|
|
17
|
+
manifestExtensions: string[];
|
|
18
|
+
moduleExtensions: string[];
|
|
19
|
+
reservedBootstrapKeys: string[];
|
|
20
|
+
diagnostics: string[];
|
|
21
|
+
rules: Record<string, string>;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface XtendNormalizedManifest extends XtendSecurityClassification {
|
|
25
|
+
entries: Record<string, string>;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export declare const ALLOWED_IMPORT_PROTOCOLS: XtendPolicyConstant<string[]>;
|
|
29
|
+
export declare const ALLOWED_MANIFEST_EXTENSIONS: XtendPolicyConstant<string[]>;
|
|
30
|
+
export declare const ALLOWED_MODULE_EXTENSIONS: XtendPolicyConstant<string[]>;
|
|
31
|
+
export declare const CUSTOM_ELEMENT_NAME_PATTERN: XtendPolicyConstant<RegExp>;
|
|
32
|
+
export declare const IMPORT_POLICY_CONTRACT: XtendPolicyConstant<string>;
|
|
33
|
+
export declare const LOADER_POLICY_CONTRACT: XtendPolicyConstant<string>;
|
|
34
|
+
export declare const LOCAL_HOSTS: XtendPolicyConstant<string[]>;
|
|
35
|
+
export declare const MANIFEST_IMPORT_GATE_CONTRACT: XtendPolicyConstant<string>;
|
|
36
|
+
export declare const MANIFEST_POLICY_CONTRACT: XtendPolicyConstant<string>;
|
|
37
|
+
export declare const REFUSED_PROTOCOLS: XtendPolicyConstant<string[]>;
|
|
38
|
+
export declare const RESERVED_BOOTSTRAP_KEYS: XtendPolicyConstant<string[]>;
|
|
39
|
+
export declare function classifyManifestRecord(key: string, record: unknown, options?: XtendPolicyOptions): XtendSecurityClassification;
|
|
40
|
+
export declare function classifyPolicyUrl(value: string, options?: XtendPolicyOptions): XtendSecurityClassification;
|
|
41
|
+
export declare function createManifestImportPolicy(options?: XtendPolicyOptions): XtendManifestImportPolicy;
|
|
42
|
+
export declare function isAllowedManifestKey(key: string): boolean;
|
|
43
|
+
export declare function normalizeManifest(rawManifest?: Record<string, unknown>, options?: XtendPolicyOptions): XtendNormalizedManifest;
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
const LOADER_POLICY_CONTRACT = 'xtend.security.loader-policy.v1';
|
|
2
|
+
const MANIFEST_POLICY_CONTRACT = 'xtend.security.manifest-policy.v1';
|
|
3
|
+
const IMPORT_POLICY_CONTRACT = 'xtend.security.import-policy.v1';
|
|
4
|
+
const MANIFEST_IMPORT_GATE_CONTRACT = 'xtend.security.manifest-import-gate.v1';
|
|
5
|
+
|
|
6
|
+
const LOCAL_HOSTS = ['localhost', '127.0.0.1', '0.0.0.0', '::1'];
|
|
7
|
+
const ALLOWED_IMPORT_PROTOCOLS = ['http:', 'https:', 'file:'];
|
|
8
|
+
const REFUSED_PROTOCOLS = ['javascript:', 'data:', 'vbscript:', 'blob:'];
|
|
9
|
+
const ALLOWED_MANIFEST_EXTENSIONS = ['.json'];
|
|
10
|
+
const ALLOWED_MODULE_EXTENSIONS = ['.js', '.mjs'];
|
|
11
|
+
const RESERVED_BOOTSTRAP_KEYS = ['xstate'];
|
|
12
|
+
const CUSTOM_ELEMENT_NAME_PATTERN = /^[a-z][a-z0-9]*-[a-z0-9-]*[a-z0-9]$/;
|
|
13
|
+
|
|
14
|
+
function clone(value) {
|
|
15
|
+
return JSON.parse(JSON.stringify(value));
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function normalizeHostname(hostname = '') {
|
|
19
|
+
return String(hostname).replace(/^\[|\]$/g, '').toLowerCase();
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function isLocalHost(hostname) {
|
|
23
|
+
return LOCAL_HOSTS.includes(normalizeHostname(hostname));
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function createUrl(value, baseUrl) {
|
|
27
|
+
try {
|
|
28
|
+
return new URL(String(value), baseUrl);
|
|
29
|
+
} catch (_) {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function hasPathTraversal(url) {
|
|
35
|
+
try {
|
|
36
|
+
return decodeURIComponent(url.pathname).split('/').includes('..');
|
|
37
|
+
} catch (_) {
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function hasTraversalLikeInput(value) {
|
|
43
|
+
try {
|
|
44
|
+
const pathPart = decodeURIComponent(String(value)).split(/[?#]/)[0];
|
|
45
|
+
return pathPart === '..' ||
|
|
46
|
+
pathPart.startsWith('../') ||
|
|
47
|
+
pathPart.includes('/../') ||
|
|
48
|
+
pathPart.endsWith('/..');
|
|
49
|
+
} catch (_) {
|
|
50
|
+
return true;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function hasAllowedExtension(url, kind) {
|
|
55
|
+
const pathname = url.pathname.toLowerCase();
|
|
56
|
+
const extensions = kind === 'manifest'
|
|
57
|
+
? ALLOWED_MANIFEST_EXTENSIONS
|
|
58
|
+
: ALLOWED_MODULE_EXTENSIONS;
|
|
59
|
+
return extensions.some((extension) => pathname.endsWith(extension));
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function classifyPolicyUrl(value, options = {}) {
|
|
63
|
+
const kind = options.kind || 'module';
|
|
64
|
+
const baseUrl = options.baseUrl || options.currentUrl || 'http://127.0.0.1/';
|
|
65
|
+
const currentUrl = createUrl(options.currentUrl || baseUrl, baseUrl);
|
|
66
|
+
const targetUrl = createUrl(value, baseUrl);
|
|
67
|
+
const diagnostics = [];
|
|
68
|
+
const source = options.source || kind;
|
|
69
|
+
|
|
70
|
+
if (!targetUrl || !currentUrl) {
|
|
71
|
+
diagnostics.push('xtend.security.import.refused.invalid_url');
|
|
72
|
+
} else if (hasTraversalLikeInput(value)) {
|
|
73
|
+
diagnostics.push('xtend.security.import.refused.path_traversal');
|
|
74
|
+
} else if (REFUSED_PROTOCOLS.includes(targetUrl.protocol)) {
|
|
75
|
+
diagnostics.push('xtend.security.import.refused.protocol');
|
|
76
|
+
} else if (!ALLOWED_IMPORT_PROTOCOLS.includes(targetUrl.protocol)) {
|
|
77
|
+
diagnostics.push('xtend.security.import.refused.protocol');
|
|
78
|
+
} else if (hasPathTraversal(targetUrl)) {
|
|
79
|
+
diagnostics.push('xtend.security.import.refused.path_traversal');
|
|
80
|
+
} else if (!hasAllowedExtension(targetUrl, kind)) {
|
|
81
|
+
diagnostics.push(kind === 'manifest'
|
|
82
|
+
? 'xtend.security.manifest.invalid.extension'
|
|
83
|
+
: 'xtend.security.import.refused.extension');
|
|
84
|
+
} else {
|
|
85
|
+
const sameOrigin = targetUrl.origin === currentUrl.origin;
|
|
86
|
+
const localLoopback = isLocalHost(targetUrl.hostname) && (
|
|
87
|
+
isLocalHost(currentUrl.hostname) ||
|
|
88
|
+
currentUrl.protocol === 'file:'
|
|
89
|
+
);
|
|
90
|
+
const localFile = targetUrl.protocol === 'file:' && currentUrl.protocol === 'file:';
|
|
91
|
+
|
|
92
|
+
if (!sameOrigin && !localLoopback && !localFile) {
|
|
93
|
+
diagnostics.push(kind === 'manifest'
|
|
94
|
+
? 'xtend.security.loader.refused.external_manifest'
|
|
95
|
+
: 'xtend.security.import.refused.external_module');
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
return {
|
|
100
|
+
schema: IMPORT_POLICY_CONTRACT,
|
|
101
|
+
ok: diagnostics.length === 0,
|
|
102
|
+
kind,
|
|
103
|
+
source,
|
|
104
|
+
input: String(value),
|
|
105
|
+
url: targetUrl ? targetUrl.href : null,
|
|
106
|
+
local: targetUrl && currentUrl
|
|
107
|
+
? targetUrl.origin === currentUrl.origin || isLocalHost(targetUrl.hostname) || targetUrl.protocol === 'file:'
|
|
108
|
+
: false,
|
|
109
|
+
diagnostics
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
function isAllowedManifestKey(key) {
|
|
114
|
+
if (RESERVED_BOOTSTRAP_KEYS.includes(key)) {
|
|
115
|
+
return true;
|
|
116
|
+
}
|
|
117
|
+
return CUSTOM_ELEMENT_NAME_PATTERN.test(key);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function getManifestRecordUrl(record) {
|
|
121
|
+
if (typeof record === 'string') {
|
|
122
|
+
return record;
|
|
123
|
+
}
|
|
124
|
+
if (record && typeof record === 'object') {
|
|
125
|
+
if (typeof record.url === 'string') return record.url;
|
|
126
|
+
if (typeof record.path === 'string') return record.path;
|
|
127
|
+
}
|
|
128
|
+
return null;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
function dependenciesAreComponentIds(record) {
|
|
132
|
+
if (!record || typeof record !== 'object' || !Array.isArray(record.dependencies)) {
|
|
133
|
+
return true;
|
|
134
|
+
}
|
|
135
|
+
return record.dependencies.every((dependency) => (
|
|
136
|
+
typeof dependency === 'string' &&
|
|
137
|
+
isAllowedManifestKey(dependency) &&
|
|
138
|
+
!dependency.includes('/') &&
|
|
139
|
+
!dependency.includes(':')
|
|
140
|
+
));
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
function classifyManifestRecord(key, record, options = {}) {
|
|
144
|
+
const diagnostics = [];
|
|
145
|
+
const normalizedKey = typeof key === 'string' ? key.trim() : '';
|
|
146
|
+
const recordUrl = getManifestRecordUrl(record);
|
|
147
|
+
|
|
148
|
+
if (!normalizedKey || normalizedKey !== normalizedKey.toLowerCase() || !isAllowedManifestKey(normalizedKey)) {
|
|
149
|
+
diagnostics.push('xtend.security.manifest.invalid.tag');
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
if (!recordUrl) {
|
|
153
|
+
diagnostics.push('xtend.security.manifest.invalid.url');
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
if (!dependenciesAreComponentIds(record)) {
|
|
157
|
+
diagnostics.push('xtend.security.manifest.invalid.dependencies');
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
const urlPolicy = recordUrl
|
|
161
|
+
? classifyPolicyUrl(recordUrl, {
|
|
162
|
+
...options,
|
|
163
|
+
kind: 'module',
|
|
164
|
+
source: normalizedKey || 'manifest-record'
|
|
165
|
+
})
|
|
166
|
+
: null;
|
|
167
|
+
|
|
168
|
+
if (urlPolicy && !urlPolicy.ok) {
|
|
169
|
+
diagnostics.push(...urlPolicy.diagnostics);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
return {
|
|
173
|
+
schema: MANIFEST_POLICY_CONTRACT,
|
|
174
|
+
ok: diagnostics.length === 0,
|
|
175
|
+
key: normalizedKey,
|
|
176
|
+
url: urlPolicy ? urlPolicy.url : null,
|
|
177
|
+
source: 'manifest-record',
|
|
178
|
+
diagnostics
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
function normalizeManifest(rawManifest, options = {}) {
|
|
183
|
+
const diagnostics = [];
|
|
184
|
+
const entries = {};
|
|
185
|
+
|
|
186
|
+
if (!rawManifest || typeof rawManifest !== 'object' || Array.isArray(rawManifest)) {
|
|
187
|
+
return {
|
|
188
|
+
schema: MANIFEST_POLICY_CONTRACT,
|
|
189
|
+
ok: false,
|
|
190
|
+
entries,
|
|
191
|
+
diagnostics: ['xtend.security.manifest.invalid.shape']
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
Object.entries(rawManifest).forEach(([key, record]) => {
|
|
196
|
+
const classification = classifyManifestRecord(key, record, options);
|
|
197
|
+
if (classification.ok) {
|
|
198
|
+
entries[classification.key] = classification.url;
|
|
199
|
+
} else {
|
|
200
|
+
diagnostics.push({
|
|
201
|
+
key,
|
|
202
|
+
codes: classification.diagnostics
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
return {
|
|
208
|
+
schema: MANIFEST_POLICY_CONTRACT,
|
|
209
|
+
ok: diagnostics.length === 0,
|
|
210
|
+
entries,
|
|
211
|
+
diagnostics
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
function createManifestImportPolicy(options = {}) {
|
|
216
|
+
return {
|
|
217
|
+
schema: MANIFEST_IMPORT_GATE_CONTRACT,
|
|
218
|
+
loaderPolicy: LOADER_POLICY_CONTRACT,
|
|
219
|
+
manifestPolicy: MANIFEST_POLICY_CONTRACT,
|
|
220
|
+
importPolicy: IMPORT_POLICY_CONTRACT,
|
|
221
|
+
mode: options.mode || 'local-self-and-loopback-only',
|
|
222
|
+
allowedProtocols: clone(ALLOWED_IMPORT_PROTOCOLS),
|
|
223
|
+
refusedProtocols: clone(REFUSED_PROTOCOLS),
|
|
224
|
+
localHosts: clone(LOCAL_HOSTS),
|
|
225
|
+
manifestExtensions: clone(ALLOWED_MANIFEST_EXTENSIONS),
|
|
226
|
+
moduleExtensions: clone(ALLOWED_MODULE_EXTENSIONS),
|
|
227
|
+
reservedBootstrapKeys: clone(RESERVED_BOOTSTRAP_KEYS),
|
|
228
|
+
diagnostics: [
|
|
229
|
+
'xtend.security.loader.refused',
|
|
230
|
+
'xtend.security.manifest.invalid',
|
|
231
|
+
'xtend.security.import.refused'
|
|
232
|
+
],
|
|
233
|
+
rules: {
|
|
234
|
+
manifestUrl: 'Must be same-origin, file-local or loopback-local JSON.',
|
|
235
|
+
moduleUrl: 'Must be same-origin, file-local or loopback-local JavaScript module.',
|
|
236
|
+
preload: 'Component IDs only; no free URLs.',
|
|
237
|
+
dependencies: 'Component IDs only; no URL-like dependency values.',
|
|
238
|
+
cdn: 'External CDN URLs are refused by default.'
|
|
239
|
+
}
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
module.exports = {
|
|
244
|
+
ALLOWED_IMPORT_PROTOCOLS,
|
|
245
|
+
ALLOWED_MANIFEST_EXTENSIONS,
|
|
246
|
+
ALLOWED_MODULE_EXTENSIONS,
|
|
247
|
+
CUSTOM_ELEMENT_NAME_PATTERN,
|
|
248
|
+
IMPORT_POLICY_CONTRACT,
|
|
249
|
+
LOADER_POLICY_CONTRACT,
|
|
250
|
+
LOCAL_HOSTS,
|
|
251
|
+
MANIFEST_IMPORT_GATE_CONTRACT,
|
|
252
|
+
MANIFEST_POLICY_CONTRACT,
|
|
253
|
+
REFUSED_PROTOCOLS,
|
|
254
|
+
RESERVED_BOOTSTRAP_KEYS,
|
|
255
|
+
classifyManifestRecord,
|
|
256
|
+
classifyPolicyUrl,
|
|
257
|
+
createManifestImportPolicy,
|
|
258
|
+
isAllowedManifestKey,
|
|
259
|
+
normalizeManifest
|
|
260
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export * from '../fabric/xtend-policy-public-types';
|
|
2
|
+
import type {
|
|
3
|
+
XtendPolicyConstant,
|
|
4
|
+
XtendPolicyReport
|
|
5
|
+
} from '../fabric/xtend-policy-public-types';
|
|
6
|
+
|
|
7
|
+
export interface XtendSupplyChainGatePlan {
|
|
8
|
+
schema: string;
|
|
9
|
+
releaseGate: string;
|
|
10
|
+
localGate: string;
|
|
11
|
+
localCommands: string[];
|
|
12
|
+
ciNetworkGates: string[];
|
|
13
|
+
gates: Record<string, unknown>;
|
|
14
|
+
dependencySections: string[];
|
|
15
|
+
lockfileCandidates: string[];
|
|
16
|
+
scopedReleasePackages: Array<{ name: string; path: string; manifest: string; scope: string }>;
|
|
17
|
+
license: Record<string, unknown>;
|
|
18
|
+
vulnerabilities: Record<string, unknown>;
|
|
19
|
+
publishBoundary: Record<string, unknown>;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface XtendPackageSupplyChainReport extends XtendPolicyReport {
|
|
23
|
+
dependencyCount: number;
|
|
24
|
+
dependencies: Array<{ section: string; name: string; version: string }>;
|
|
25
|
+
lockfiles: string[];
|
|
26
|
+
hasLockfile: boolean;
|
|
27
|
+
privatePackage: boolean;
|
|
28
|
+
publicRcPackage: boolean;
|
|
29
|
+
packageLicense: string | null;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export declare const DEPENDENCY_AUDIT_GATE_CONTRACT: XtendPolicyConstant<string>;
|
|
33
|
+
export declare const DEPENDENCY_SECTIONS: XtendPolicyConstant<string[]>;
|
|
34
|
+
export declare const LICENSE_POLICY: XtendPolicyConstant<Record<string, unknown>>;
|
|
35
|
+
export declare const LICENSE_POLICY_CONTRACT: XtendPolicyConstant<string>;
|
|
36
|
+
export declare const LOCKFILE_CANDIDATES: XtendPolicyConstant<string[]>;
|
|
37
|
+
export declare const SCOPED_RELEASE_PACKAGES: XtendPolicyConstant<Array<{ name: string; path: string; manifest: string; scope: string }>>;
|
|
38
|
+
export declare const RELEASE_SUPPLY_CHAIN_GATE_CONTRACT: XtendPolicyConstant<string>;
|
|
39
|
+
export declare const SUPPLY_CHAIN_GATE_PLAN_CONTRACT: XtendPolicyConstant<string>;
|
|
40
|
+
export declare const SUPPLY_CHAIN_GATES: XtendPolicyConstant<Record<string, unknown>>;
|
|
41
|
+
export declare const VULNERABILITY_POLICY: XtendPolicyConstant<Record<string, unknown>>;
|
|
42
|
+
export declare const VULNERABILITY_POLICY_CONTRACT: XtendPolicyConstant<string>;
|
|
43
|
+
export declare function classifyPackageSupplyChain(packageManifest?: Record<string, unknown>, lockfiles?: string[]): XtendPackageSupplyChainReport;
|
|
44
|
+
export declare function createSupplyChainGatePlan(): XtendSupplyChainGatePlan;
|
|
45
|
+
export declare function listDependencies(packageManifest?: Record<string, unknown>): Array<{ section: string; name: string; version: string }>;
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
const SUPPLY_CHAIN_GATE_PLAN_CONTRACT = 'xtend.security.supply-chain-gate-plan.v1';
|
|
2
|
+
const DEPENDENCY_AUDIT_GATE_CONTRACT = 'xtend.security.dependency-audit-gate.v1';
|
|
3
|
+
const LICENSE_POLICY_CONTRACT = 'xtend.security.license-policy.v1';
|
|
4
|
+
const VULNERABILITY_POLICY_CONTRACT = 'xtend.security.vulnerability-policy.v1';
|
|
5
|
+
const RELEASE_SUPPLY_CHAIN_GATE_CONTRACT = 'xtend.security.release-supply-chain-gate.v1';
|
|
6
|
+
|
|
7
|
+
const DEPENDENCY_SECTIONS = [
|
|
8
|
+
'dependencies',
|
|
9
|
+
'devDependencies',
|
|
10
|
+
'optionalDependencies',
|
|
11
|
+
'peerDependencies'
|
|
12
|
+
];
|
|
13
|
+
|
|
14
|
+
const LOCKFILE_CANDIDATES = [
|
|
15
|
+
'package-lock.json',
|
|
16
|
+
'npm-shrinkwrap.json',
|
|
17
|
+
'pnpm-lock.yaml',
|
|
18
|
+
'yarn.lock'
|
|
19
|
+
];
|
|
20
|
+
|
|
21
|
+
const SCOPED_RELEASE_PACKAGES = Object.freeze([
|
|
22
|
+
{
|
|
23
|
+
name: '@ccslabs/xtend',
|
|
24
|
+
path: '.',
|
|
25
|
+
manifest: 'package.json',
|
|
26
|
+
scope: 'complete-stack'
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: '@ccslabs/xtend-rmt',
|
|
30
|
+
path: 'xtendrmt',
|
|
31
|
+
manifest: 'xtendrmt/package.json',
|
|
32
|
+
scope: 'rmt-runtime'
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: '@ccslabs/xtend-fabric',
|
|
36
|
+
path: 'fabric',
|
|
37
|
+
manifest: 'fabric/package.json',
|
|
38
|
+
scope: 'fabric-runtime'
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: '@ccslabs/xtend-cli',
|
|
42
|
+
path: 'xtend-builder',
|
|
43
|
+
manifest: 'xtend-builder/package.json',
|
|
44
|
+
scope: 'builder-cli'
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: '@ccslabs/xtend-compiler',
|
|
48
|
+
path: 'tools',
|
|
49
|
+
manifest: 'tools/package.json',
|
|
50
|
+
scope: 'rmt-compiler-tooling'
|
|
51
|
+
}
|
|
52
|
+
]);
|
|
53
|
+
|
|
54
|
+
const LICENSE_POLICY = {
|
|
55
|
+
currentPackageLicense: 'Apache-2.0',
|
|
56
|
+
projectLicenseDecision: 'accepted-apache-2.0',
|
|
57
|
+
privatePackageAllowedLicenses: ['Apache-2.0'],
|
|
58
|
+
publicReleaseRequiresLicenseDecision: false,
|
|
59
|
+
publicReleaseLicenseDecision: 'accepted-apache-2.0',
|
|
60
|
+
allowedDependencyLicenses: [
|
|
61
|
+
'Apache-2.0',
|
|
62
|
+
'BSD-2-Clause',
|
|
63
|
+
'BSD-3-Clause',
|
|
64
|
+
'ISC',
|
|
65
|
+
'MIT',
|
|
66
|
+
'MPL-2.0',
|
|
67
|
+
'Unicode-DFS-2016'
|
|
68
|
+
],
|
|
69
|
+
reviewRequiredLicenses: [
|
|
70
|
+
'BlueOak-1.0.0',
|
|
71
|
+
'CC-BY-4.0',
|
|
72
|
+
'CC0-1.0',
|
|
73
|
+
'LGPL-2.1-only',
|
|
74
|
+
'LGPL-2.1-or-later',
|
|
75
|
+
'LGPL-3.0-only',
|
|
76
|
+
'LGPL-3.0-or-later'
|
|
77
|
+
],
|
|
78
|
+
forbiddenDependencyLicenses: [
|
|
79
|
+
'AGPL-1.0-only',
|
|
80
|
+
'AGPL-1.0-or-later',
|
|
81
|
+
'AGPL-3.0-only',
|
|
82
|
+
'AGPL-3.0-or-later',
|
|
83
|
+
'GPL-2.0-only',
|
|
84
|
+
'GPL-2.0-or-later',
|
|
85
|
+
'GPL-3.0-only',
|
|
86
|
+
'GPL-3.0-or-later',
|
|
87
|
+
'UNLICENSED'
|
|
88
|
+
]
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
const VULNERABILITY_POLICY = {
|
|
92
|
+
productionAuditLevel: 'moderate',
|
|
93
|
+
developmentAuditLevel: 'high',
|
|
94
|
+
publishBlockingSeverities: ['critical', 'high'],
|
|
95
|
+
zeroCriticalForAnyRelease: true,
|
|
96
|
+
noKnownExploitForReleaseCandidate: true,
|
|
97
|
+
networkAuditStage: 'ci-release-gate',
|
|
98
|
+
localGateMode: 'offline-policy-and-inventory'
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
const SUPPLY_CHAIN_GATES = [
|
|
102
|
+
{
|
|
103
|
+
id: 'dependency-inventory',
|
|
104
|
+
contract: DEPENDENCY_AUDIT_GATE_CONTRACT,
|
|
105
|
+
stage: 'local',
|
|
106
|
+
command: 'node scripts/verify_supply_chain_policy.js --json',
|
|
107
|
+
mode: 'offline-static',
|
|
108
|
+
blocksPublish: true
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
id: 'license-policy',
|
|
112
|
+
contract: LICENSE_POLICY_CONTRACT,
|
|
113
|
+
stage: 'local',
|
|
114
|
+
command: 'node scripts/verify_supply_chain_policy.js --json',
|
|
115
|
+
mode: 'offline-static',
|
|
116
|
+
blocksPublish: true
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
id: 'vulnerability-policy',
|
|
120
|
+
contract: VULNERABILITY_POLICY_CONTRACT,
|
|
121
|
+
stage: 'ci',
|
|
122
|
+
command: 'npm audit --audit-level=moderate',
|
|
123
|
+
mode: 'network-audit',
|
|
124
|
+
blocksPublish: true
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
id: 'release-report',
|
|
128
|
+
contract: RELEASE_SUPPLY_CHAIN_GATE_CONTRACT,
|
|
129
|
+
stage: 'local',
|
|
130
|
+
command: 'npm run release:report',
|
|
131
|
+
mode: 'offline-test-report',
|
|
132
|
+
blocksPublish: true
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
id: 'pack-provenance-dry-run',
|
|
136
|
+
contract: RELEASE_SUPPLY_CHAIN_GATE_CONTRACT,
|
|
137
|
+
stage: 'local',
|
|
138
|
+
command: 'npm run pack:dry-run',
|
|
139
|
+
mode: 'offline-package-surface',
|
|
140
|
+
blocksPublish: true
|
|
141
|
+
}
|
|
142
|
+
];
|
|
143
|
+
|
|
144
|
+
function clone(value) {
|
|
145
|
+
return JSON.parse(JSON.stringify(value));
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
function listDependencies(packageManifest = {}) {
|
|
149
|
+
return DEPENDENCY_SECTIONS.flatMap((section) => {
|
|
150
|
+
const entries = packageManifest[section] && typeof packageManifest[section] === 'object'
|
|
151
|
+
? Object.entries(packageManifest[section])
|
|
152
|
+
: [];
|
|
153
|
+
|
|
154
|
+
return entries.map(([name, version]) => ({
|
|
155
|
+
name,
|
|
156
|
+
version,
|
|
157
|
+
section
|
|
158
|
+
}));
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
function createSupplyChainGatePlan(options = {}) {
|
|
163
|
+
return {
|
|
164
|
+
schema: SUPPLY_CHAIN_GATE_PLAN_CONTRACT,
|
|
165
|
+
dependencyAuditGate: DEPENDENCY_AUDIT_GATE_CONTRACT,
|
|
166
|
+
licensePolicy: LICENSE_POLICY_CONTRACT,
|
|
167
|
+
vulnerabilityPolicy: VULNERABILITY_POLICY_CONTRACT,
|
|
168
|
+
releaseGate: RELEASE_SUPPLY_CHAIN_GATE_CONTRACT,
|
|
169
|
+
mode: options.mode || 'plan-and-offline-local-gate',
|
|
170
|
+
localGate: 'node scripts/verify_supply_chain_policy.js --json',
|
|
171
|
+
packageScript: 'npm run test:supply-chain',
|
|
172
|
+
releaseScripts: [
|
|
173
|
+
'npm test',
|
|
174
|
+
'npm run test:supply-chain',
|
|
175
|
+
'npm run release:report',
|
|
176
|
+
'npm run pack:dry-run'
|
|
177
|
+
],
|
|
178
|
+
ciNetworkGates: [
|
|
179
|
+
'npm audit --audit-level=moderate',
|
|
180
|
+
'npm sbom --sbom-format=cyclonedx --json'
|
|
181
|
+
],
|
|
182
|
+
gates: clone(SUPPLY_CHAIN_GATES),
|
|
183
|
+
dependencySections: clone(DEPENDENCY_SECTIONS),
|
|
184
|
+
lockfileCandidates: clone(LOCKFILE_CANDIDATES),
|
|
185
|
+
scopedReleasePackages: clone(SCOPED_RELEASE_PACKAGES),
|
|
186
|
+
license: clone(LICENSE_POLICY),
|
|
187
|
+
vulnerabilities: clone(VULNERABILITY_POLICY),
|
|
188
|
+
publishBoundary: {
|
|
189
|
+
privateUntil: ['ER-WP-30', 'ER-WP-36', 'ER-WP-38'],
|
|
190
|
+
currentPublishState: 'owner-approved-public-rc-boundary',
|
|
191
|
+
provenanceRequired: true,
|
|
192
|
+
publicReleaseRequiresLicenseDecision: false,
|
|
193
|
+
licenseDecision: 'accepted-apache-2.0'
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
function classifyPackageSupplyChain(packageManifest = {}, lockfiles = []) {
|
|
199
|
+
const dependencies = listDependencies(packageManifest);
|
|
200
|
+
const hasDependencies = dependencies.length > 0;
|
|
201
|
+
const hasLockfile = Array.isArray(lockfiles) && lockfiles.length > 0;
|
|
202
|
+
const diagnostics = [];
|
|
203
|
+
|
|
204
|
+
if (hasDependencies && !hasLockfile) {
|
|
205
|
+
diagnostics.push('xtend.security.supply_chain.lockfile.missing');
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
if (packageManifest.private !== false) {
|
|
209
|
+
diagnostics.push('xtend.security.supply_chain.private_boundary.missing');
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
if (packageManifest.license === 'UNLICENSED' && packageManifest.private !== true) {
|
|
213
|
+
diagnostics.push('xtend.security.supply_chain.public_license.missing');
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
if (!packageManifest.publishConfig || packageManifest.publishConfig.provenance !== true) {
|
|
217
|
+
diagnostics.push('xtend.security.supply_chain.provenance.missing');
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
return {
|
|
221
|
+
schema: DEPENDENCY_AUDIT_GATE_CONTRACT,
|
|
222
|
+
ok: diagnostics.length === 0,
|
|
223
|
+
dependencyCount: dependencies.length,
|
|
224
|
+
dependencies,
|
|
225
|
+
lockfiles,
|
|
226
|
+
hasLockfile,
|
|
227
|
+
privatePackage: packageManifest.private === true,
|
|
228
|
+
publicRcPackage: packageManifest.private === false,
|
|
229
|
+
packageLicense: packageManifest.license || null,
|
|
230
|
+
diagnostics
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
module.exports = {
|
|
235
|
+
DEPENDENCY_AUDIT_GATE_CONTRACT,
|
|
236
|
+
DEPENDENCY_SECTIONS,
|
|
237
|
+
LICENSE_POLICY,
|
|
238
|
+
LICENSE_POLICY_CONTRACT,
|
|
239
|
+
LOCKFILE_CANDIDATES,
|
|
240
|
+
SCOPED_RELEASE_PACKAGES,
|
|
241
|
+
RELEASE_SUPPLY_CHAIN_GATE_CONTRACT,
|
|
242
|
+
SUPPLY_CHAIN_GATE_PLAN_CONTRACT,
|
|
243
|
+
SUPPLY_CHAIN_GATES,
|
|
244
|
+
VULNERABILITY_POLICY,
|
|
245
|
+
VULNERABILITY_POLICY_CONTRACT,
|
|
246
|
+
classifyPackageSupplyChain,
|
|
247
|
+
createSupplyChainGatePlan,
|
|
248
|
+
listDependencies
|
|
249
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export * from '../fabric/xtend-policy-public-types';
|
|
2
|
+
import type {
|
|
3
|
+
XtendPolicyConstant,
|
|
4
|
+
XtendPolicyOptions,
|
|
5
|
+
XtendSecurityClassification
|
|
6
|
+
} from '../fabric/xtend-policy-public-types';
|
|
7
|
+
|
|
8
|
+
export interface XtendTrustedDomPolicy {
|
|
9
|
+
schema: string;
|
|
10
|
+
trustedDomPolicy: string;
|
|
11
|
+
sanitizerPolicy: string;
|
|
12
|
+
parsedownDocsPolicy: string;
|
|
13
|
+
rmtTemplatePolicy: string;
|
|
14
|
+
sinks: Record<string, unknown>;
|
|
15
|
+
markupClasses: Record<string, unknown>;
|
|
16
|
+
urlAttributes: Record<string, unknown>;
|
|
17
|
+
[key: string]: unknown;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export declare const DOM_SINKS: XtendPolicyConstant<Record<string, unknown>>;
|
|
21
|
+
export declare const MARKUP_CLASSES: XtendPolicyConstant<Record<string, unknown>>;
|
|
22
|
+
export declare const MARKUP_CLASSIFICATION_CONTRACT: XtendPolicyConstant<string>;
|
|
23
|
+
export declare const PARSEDOWN_DOCS_POLICY: XtendPolicyConstant<string>;
|
|
24
|
+
export declare const RMT_TEMPLATE_POLICY: XtendPolicyConstant<string>;
|
|
25
|
+
export declare const SANITIZING_BOUNDARY_CONTRACT: XtendPolicyConstant<string>;
|
|
26
|
+
export declare const TRUSTED_DOM_SANITIZER_CONTRACT: XtendPolicyConstant<string>;
|
|
27
|
+
export declare const TRUSTED_DOM_SANITIZER_POLICY: XtendPolicyConstant<string>;
|
|
28
|
+
export declare const TRUSTED_DOM_POLICY_CONTRACT: XtendPolicyConstant<string>;
|
|
29
|
+
export declare const TRUSTED_DOM_SINK_CONTRACT: XtendPolicyConstant<string>;
|
|
30
|
+
export declare const URL_ATTRIBUTE_POLICY: XtendPolicyConstant<string>;
|
|
31
|
+
export declare function classifyTrustedDomUse(input?: XtendPolicyOptions): XtendSecurityClassification;
|
|
32
|
+
export declare function getMarkupClass(markupClass: string): Record<string, unknown> | null;
|
|
33
|
+
export declare function getSinkPolicy(sink: string): Record<string, unknown> | null;
|
|
34
|
+
export declare function getTrustedDomPolicy(options?: XtendPolicyOptions): XtendTrustedDomPolicy;
|
|
35
|
+
export declare function isAllowedTrustedDomUrl(value: string, options?: XtendPolicyOptions): boolean;
|
|
36
|
+
export declare function sanitizeTrustedDomHtml(value: string, options?: XtendPolicyOptions): string;
|