@aifabrix/builder 2.46.0 → 2.47.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/.npmrc.token +1 -0
- package/.temp/jest-protection-convert/run-IFN2nv/.protection/hubspot-companies.json +1 -0
- package/.temp/jest-protection-convert/run-IvmKLO/.protection/hubspot-companies.yaml +17 -0
- package/.temp/jest-protection-convert/run-SdvblF/.protection/hubspot-companies.json +1 -0
- package/.temp/jest-protection-convert/run-b51TsW/.protection/hubspot-companies.json +1 -0
- package/.temp/jest-protection-convert/run-fiLmb1/.protection/hubspot-companies.json +1 -0
- package/.temp/jest-protection-convert/run-qYGHMU/.protection/hubspot-companies.yaml +17 -0
- package/.temp/jest-protection-fixtures/hubspot-Mq5re8/hubspot-companies.yaml +17 -0
- package/.temp/jest-protection-fixtures/hubspot-f3u4YL/hubspot-companies.yaml +17 -0
- package/.temp/jest-protection-fixtures/hubspot-iQtd1O/hubspot-companies.yaml +17 -0
- package/.temp/jest-protection-fixtures/hubspot-mdmz5M/hubspot-companies.yaml +17 -0
- package/.temp/jest-protection-fixtures/hubspot-qbKYxQ/hubspot-companies.yaml +17 -0
- package/.temp/jest-protection-fixtures/hubspot-yzlJy6/hubspot-companies.yaml +17 -0
- package/.temp/validation/summary.txt +5 -0
- package/jest.isolated-projects.js +18 -2
- package/jest.projects.js +24 -0
- package/lib/api/dataplane-health.api.js +19 -7
- package/lib/api/lifecycle.api.js +22 -1
- package/lib/api/resource-types.api.js +107 -0
- package/lib/api/runtime-configuration.api.js +72 -0
- package/lib/api/types/resource-types.types.js +45 -0
- package/lib/api/user-groups.api.js +9 -9
- package/lib/api/users.api.js +8 -8
- package/lib/api/wizard.api.js +10 -2
- package/lib/app/down.js +58 -26
- package/lib/app/index.js +2 -2
- package/lib/app/run-resolve-image.js +2 -1
- package/lib/app/run-stop-containers.js +113 -0
- package/lib/app/run.js +1 -31
- package/lib/app/show-display.js +35 -0
- package/lib/app/show.js +32 -1
- package/lib/build/index.js +17 -5
- package/lib/build/miso-controller-npm-sdk-guard.js +25 -0
- package/lib/channels/add-channel.js +348 -0
- package/lib/channels/channel-artifact-generator.js +141 -0
- package/lib/channels/channel-audit.js +101 -0
- package/lib/channels/channel-auth-context.js +37 -0
- package/lib/channels/channel-credential.js +200 -0
- package/lib/channels/channel-display-name.js +64 -0
- package/lib/channels/channel-external-system.js +106 -0
- package/lib/channels/channel-integration-generator.js +274 -0
- package/lib/channels/channel-probe.js +89 -0
- package/lib/channels/channel-runtime-resolver.js +152 -0
- package/lib/channels/channel-status-display.js +141 -0
- package/lib/channels/channel-targets.js +115 -0
- package/lib/cli/index.js +18 -4
- package/lib/cli/infra-guided-auth.js +36 -12
- package/lib/cli/setup-app.js +54 -3
- package/lib/cli/setup-infra-up-dataplane-action.js +2 -2
- package/lib/cli/setup-infra-up-platform-action.js +2 -1
- package/lib/cli/setup-npm.js +59 -0
- package/lib/cli/setup-platform.js +1 -1
- package/lib/cli/setup-secrets.js +1 -1
- package/lib/cli/setup-utility-help-after.js +4 -1
- package/lib/cli/setup-utility-resolve.js +8 -5
- package/lib/commands/app-logs.js +54 -26
- package/lib/commands/app.js +41 -0
- package/lib/commands/auth-status-dataplane-version.js +97 -61
- package/lib/commands/auth-status.js +2 -7
- package/lib/commands/channel.js +58 -0
- package/lib/commands/datasource.js +1 -1
- package/lib/commands/identity-apply-sync.js +49 -8
- package/lib/commands/identity-group-cli.js +66 -26
- package/lib/commands/identity-membership-role-cache.js +58 -37
- package/lib/commands/identity-shared.js +22 -1
- package/lib/commands/identity-user-cli.js +80 -34
- package/lib/commands/login-device.js +11 -3
- package/lib/commands/login.js +8 -3
- package/lib/commands/npm-config.js +103 -0
- package/lib/commands/repair-auth-apply.js +30 -4
- package/lib/commands/repair-auth-config.js +8 -13
- package/lib/commands/repair-datasource-com-v2.js +15 -0
- package/lib/commands/repair-datasource-service-contract.js +206 -0
- package/lib/commands/repair-datasource.js +53 -18
- package/lib/commands/repair-env-template.js +12 -12
- package/lib/commands/repair-openapi-sync.js +26 -4
- package/lib/commands/repair-steps.js +28 -13
- package/lib/commands/repair-system-alignment.js +7 -4
- package/lib/commands/resource-type.js +371 -0
- package/lib/commands/setup-modes.js +1 -1
- package/lib/commands/setup-prompts-platform-mode.js +24 -21
- package/lib/commands/test-trust-external.js +39 -90
- package/lib/commands/up-common.js +33 -1
- package/lib/commands/up-dataplane.js +8 -4
- package/lib/commands/upload.js +24 -3
- package/lib/commands/verify-trust-command-action.js +4 -1
- package/lib/commands/verify-trust-external.js +12 -20
- package/lib/core/config-setup-platform-mode.js +3 -3
- package/lib/core/setup-platform-mode.js +41 -6
- package/lib/datasource/capability/capability-diff-slice.js +2 -2
- package/lib/datasource/capability/capability-manifest.js +254 -0
- package/lib/datasource/capability/capability-resolve.js +3 -4
- package/lib/datasource/capability/copy-operations.js +5 -3
- package/lib/datasource/capability/remove-operations.js +2 -1
- package/lib/datasource/capability/run-capability-copy.js +32 -4
- package/lib/datasource/capability/run-capability-diff.js +3 -3
- package/lib/datasource/capability/run-capability-dimension.js +2 -4
- package/lib/datasource/capability/run-capability-edit.js +4 -7
- package/lib/datasource/capability/run-capability-relate.js +2 -4
- package/lib/datasource/capability/run-capability-remove.js +2 -4
- package/lib/datasource/capability/validate-capability-slice.js +2 -1
- package/lib/datasource/datasource-identifier.js +2 -1
- package/lib/datasource/datasource-validate-display.js +1 -1
- package/lib/datasource/field-reference-validator.js +24 -3
- package/lib/datasource/orphan-profiles-validator.js +98 -0
- package/lib/datasource/validate.js +41 -23
- package/lib/external-system/download-helpers.js +87 -0
- package/lib/external-system/download.js +61 -122
- package/lib/external-system/generator.js +1 -59
- package/lib/external-system/test.js +10 -15
- package/lib/generator/builders.js +11 -1
- package/lib/generator/external-controller-manifest.js +5 -2
- package/lib/generator/split.js +3 -1
- package/lib/generator/wizard.js +1 -28
- package/lib/identity/fk-reference.js +65 -0
- package/lib/identity/identity-apply-core.js +13 -58
- package/lib/identity/identity-apply-phases.js +5 -1
- package/lib/identity/identity-display.js +243 -0
- package/lib/identity/identity-response-helpers.js +52 -0
- package/lib/identity/identity-sync-errors.js +62 -0
- package/lib/identity/resolve-user-id.js +129 -0
- package/lib/identity/username-default.js +31 -0
- package/lib/lifecycle/certification-progress.js +2 -2
- package/lib/lifecycle/report-display-trust.js +70 -0
- package/lib/lifecycle/report-display.js +14 -13
- package/lib/resolvers/datasource-resolver.js +2 -3
- package/lib/resolvers/resource-type-file.js +159 -0
- package/lib/schema/application-schema.json +16 -0
- package/lib/schema/deployment-rules.yaml +2 -1
- package/lib/schema/external-datasource.schema.json +372 -58
- package/lib/schema/external-system.schema.json +331 -2
- package/lib/schema/type/document-storage.json +9 -5
- package/lib/utils/api.js +2 -1
- package/lib/utils/app-run-containers.js +25 -2
- package/lib/utils/authentication-shape.js +224 -0
- package/lib/utils/build-copy.js +36 -5
- package/lib/utils/build-resolve-image.js +66 -12
- package/lib/utils/celery-companion-apps.js +53 -0
- package/lib/utils/cli-utils.js +4 -0
- package/lib/utils/compose-celery-worker.js +23 -0
- package/lib/utils/compose-generate-docker-compose.js +9 -1
- package/lib/utils/configuration-env-resolver.js +36 -0
- package/lib/utils/controller-url.js +4 -1
- package/lib/utils/credential-secrets-env-kv.js +216 -0
- package/lib/utils/credential-secrets-env.js +52 -262
- package/lib/utils/dataplane-resolver.js +4 -115
- package/lib/utils/declarative-url-ports.js +24 -1
- package/lib/utils/dev-platform-tls.js +148 -0
- package/lib/utils/docker-build.js +1 -4
- package/lib/utils/external-env-template.js +10 -3
- package/lib/utils/external-system-validators.js +8 -2
- package/lib/utils/health-check-request.js +114 -0
- package/lib/utils/health-check-url.js +3 -1
- package/lib/utils/health-check.js +1 -113
- package/lib/utils/help-builder.js +3 -0
- package/lib/utils/keycloak-realm-ready.js +5 -1
- package/lib/utils/localhost-public-host.js +31 -0
- package/lib/utils/npm-user-config.js +145 -0
- package/lib/utils/paths.js +25 -0
- package/lib/utils/platform-controller-url.js +58 -4
- package/lib/utils/platform-kv-ref.js +57 -0
- package/lib/utils/runtime-configuration-download.js +189 -0
- package/lib/utils/runtime-configuration-values.js +119 -0
- package/lib/utils/schema-loader.js +19 -4
- package/lib/utils/url-declarative-public-base.js +33 -25
- package/lib/utils/worker-sidecars.js +142 -0
- package/lib/validation/external-manifest-validator.js +2 -0
- package/lib/validation/runtime-configuration-rules.js +98 -0
- package/lib/validation/validate-display-dimensions.js +154 -0
- package/lib/validation/validate-display-sections.js +276 -0
- package/lib/validation/validate-display-steps.js +67 -0
- package/lib/validation/validate-display.js +24 -402
- package/package.json +1 -1
- package/templates/applications/dataplane/application.yaml +5 -0
- package/templates/applications/dataplane/env.template +26 -13
- package/templates/applications/dataplane/rbac.yaml +108 -1
- package/templates/applications/miso-controller/application.yaml +2 -2
- package/templates/applications/miso-controller/env.template +37 -122
- package/templates/applications/miso-controller/rbac.yaml +28 -13
- package/templates/channels/chatgpt/install.template.md.hbs +49 -0
- package/templates/channels/chatgpt/manifest.template.json.hbs +9 -0
- package/templates/channels/microsoft-copilot/install.template.md.hbs +49 -0
- package/templates/channels/microsoft-copilot/manifest.template.json.hbs +8 -0
- package/templates/channels/slack/install.template.md.hbs +49 -0
- package/templates/channels/slack/manifest.template.json.hbs +66 -0
- package/templates/channels/teams-bot/install.template.md.hbs +49 -0
- package/templates/channels/teams-bot/manifest.template.json.hbs +13 -0
- package/templates/channels/web-embed/install.template.md.hbs +49 -0
- package/templates/channels/web-embed/manifest.template.json.hbs +8 -0
- package/templates/python/docker-compose.hbs +56 -0
- package/templates/typescript/docker-compose.hbs +52 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Setup prompts for platform topology mode (single vs full).
|
|
2
|
+
* Setup prompts for platform topology mode (single vs single-traefik; full via CLI only).
|
|
3
3
|
*
|
|
4
4
|
* @fileoverview Setup platform mode prompt + CLI option normalization
|
|
5
5
|
* @author AI Fabrix Team
|
|
@@ -9,31 +9,43 @@
|
|
|
9
9
|
'use strict';
|
|
10
10
|
|
|
11
11
|
const inquirer = require('inquirer');
|
|
12
|
-
const {
|
|
12
|
+
const {
|
|
13
|
+
normalizeSetupPlatformMode,
|
|
14
|
+
SETUP_PLATFORM_MODE,
|
|
15
|
+
SETUP_PLATFORM_MODE_CLI_VALUES,
|
|
16
|
+
getSetupPlatformModePromptChoices
|
|
17
|
+
} = require('../core/setup-platform-mode');
|
|
13
18
|
|
|
14
19
|
/**
|
|
15
20
|
* Resolve platform mode from CLI options, if provided.
|
|
16
21
|
* @param {Object} [options]
|
|
17
|
-
* @returns {'single'|'full'|null}
|
|
22
|
+
* @returns {'single'|'single-traefik'|'full'|null}
|
|
18
23
|
*/
|
|
19
24
|
function resolvePlatformModeFromOptions(options = {}) {
|
|
20
25
|
const raw = options.platform;
|
|
21
26
|
if (raw === undefined || raw === null || String(raw).trim() === '') {
|
|
22
27
|
return null;
|
|
23
28
|
}
|
|
24
|
-
const normalized = normalizeSetupPlatformMode(raw);
|
|
25
|
-
// Guard: only accept exact canonical values from CLI; reject unexpected to avoid silent typos.
|
|
26
29
|
const rawNorm = String(raw).trim().toLowerCase();
|
|
27
|
-
|
|
28
|
-
|
|
30
|
+
const isCanonical = SETUP_PLATFORM_MODE_CLI_VALUES.includes(rawNorm);
|
|
31
|
+
const isAlias =
|
|
32
|
+
rawNorm === 'ingress' ||
|
|
33
|
+
rawNorm === 'single-ingress' ||
|
|
34
|
+
rawNorm === 'traefik' ||
|
|
35
|
+
rawNorm === 'all' ||
|
|
36
|
+
rawNorm === 'full-platform' ||
|
|
37
|
+
rawNorm === 'platform-full';
|
|
38
|
+
if (!isCanonical && !isAlias) {
|
|
39
|
+
const allowed = SETUP_PLATFORM_MODE_CLI_VALUES.join(', ');
|
|
40
|
+
throw new Error(`--platform must be one of: ${allowed} (example: aifabrix setup --platform single-traefik)`);
|
|
29
41
|
}
|
|
30
|
-
return
|
|
42
|
+
return normalizeSetupPlatformMode(raw);
|
|
31
43
|
}
|
|
32
44
|
|
|
33
45
|
/**
|
|
34
46
|
* @async
|
|
35
47
|
* @param {Object} [options]
|
|
36
|
-
* @returns {Promise<'single'|'full'>}
|
|
48
|
+
* @returns {Promise<'single'|'single-traefik'|'full'>}
|
|
37
49
|
*/
|
|
38
50
|
async function promptSetupPlatformMode(options = {}) {
|
|
39
51
|
const fromCli = resolvePlatformModeFromOptions(options);
|
|
@@ -44,16 +56,7 @@ async function promptSetupPlatformMode(options = {}) {
|
|
|
44
56
|
type: 'list',
|
|
45
57
|
name: 'mode',
|
|
46
58
|
message: 'Platform mode:',
|
|
47
|
-
choices:
|
|
48
|
-
{
|
|
49
|
-
name: 'Single environment — direct ports (no Traefik front door)',
|
|
50
|
-
value: SETUP_PLATFORM_MODE.SINGLE
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
name: 'Full platform — Traefik front door + miso/dev/tst/pro (shared infra)',
|
|
54
|
-
value: SETUP_PLATFORM_MODE.FULL
|
|
55
|
-
}
|
|
56
|
-
],
|
|
59
|
+
choices: getSetupPlatformModePromptChoices(),
|
|
57
60
|
default: SETUP_PLATFORM_MODE.SINGLE
|
|
58
61
|
}
|
|
59
62
|
]);
|
|
@@ -62,6 +65,6 @@ async function promptSetupPlatformMode(options = {}) {
|
|
|
62
65
|
|
|
63
66
|
module.exports = {
|
|
64
67
|
resolvePlatformModeFromOptions,
|
|
65
|
-
promptSetupPlatformMode
|
|
68
|
+
promptSetupPlatformMode,
|
|
69
|
+
getSetupPlatformModePromptChoices
|
|
66
70
|
};
|
|
67
|
-
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @fileoverview verify-trust <systemKey> —
|
|
2
|
+
* @fileoverview verify-trust <systemKey> — dual-confidence AI Trust via dataplane (433.0).
|
|
3
3
|
* @author AI Fabrix Team
|
|
4
|
-
* @version
|
|
4
|
+
* @version 2.0.0
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
'use strict';
|
|
@@ -10,83 +10,20 @@ const chalk = require('chalk');
|
|
|
10
10
|
const logger = require('../utils/logger');
|
|
11
11
|
const { getConfig } = require('../core/config');
|
|
12
12
|
const { setupIntegrationTestAuth } = require('../external-system/test-auth');
|
|
13
|
-
const {
|
|
13
|
+
const { runSystemVerifyTrust } = require('../api/lifecycle.api');
|
|
14
14
|
const {
|
|
15
15
|
resolveExternalIntegrationContext,
|
|
16
16
|
syncLocalIfRequested
|
|
17
17
|
} = require('./test-e2e-external');
|
|
18
18
|
|
|
19
|
-
function pushTrustResult(results, key, trustRun, apiError) {
|
|
20
|
-
const failed =
|
|
21
|
-
apiError ||
|
|
22
|
-
!trustRun ||
|
|
23
|
-
trustRun.trustDecision === 'notTrusted' ||
|
|
24
|
-
trustRun.validationStatus === 'failed';
|
|
25
|
-
results.push({
|
|
26
|
-
key,
|
|
27
|
-
success: !failed,
|
|
28
|
-
error: failed
|
|
29
|
-
? apiError
|
|
30
|
-
? apiError.message || String(apiError)
|
|
31
|
-
: trustRun.summary || 'Trust validation failed'
|
|
32
|
-
: undefined,
|
|
33
|
-
trustRun
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
|
|
37
19
|
/**
|
|
38
20
|
* @async
|
|
39
|
-
* @param {Object|null} uploadCtx
|
|
40
21
|
* @param {string} externalSystem
|
|
41
22
|
* @param {Object} options
|
|
42
|
-
* @returns {Promise<{
|
|
43
|
-
*/
|
|
44
|
-
async function resolveTrustAuthContext(uploadCtx, externalSystem, options) {
|
|
45
|
-
if (uploadCtx) {
|
|
46
|
-
return { authConfig: uploadCtx.authConfig, dataplaneUrl: uploadCtx.dataplaneUrl };
|
|
47
|
-
}
|
|
48
|
-
const configObj = await getConfig();
|
|
49
|
-
return setupIntegrationTestAuth(
|
|
50
|
-
externalSystem,
|
|
51
|
-
{
|
|
52
|
-
environment: options.env,
|
|
53
|
-
authConfig: options.authConfig,
|
|
54
|
-
dataplaneUrl: options.dataplaneUrl,
|
|
55
|
-
silentResolve: options.silentResolve === true
|
|
56
|
-
},
|
|
57
|
-
configObj
|
|
58
|
-
);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* @async
|
|
63
|
-
* @param {string[]} keys
|
|
64
|
-
* @param {Object} runOpts
|
|
65
|
-
* @param {Array<Object>} results
|
|
66
|
-
*/
|
|
67
|
-
async function runTrustForDatasourceKeys(keys, runOpts, results) {
|
|
68
|
-
for (const key of keys) {
|
|
69
|
-
try {
|
|
70
|
-
const { trustRun, apiError } = await runDatasourceAgentTrust(key, runOpts);
|
|
71
|
-
pushTrustResult(results, key, trustRun, apiError);
|
|
72
|
-
} catch (err) {
|
|
73
|
-
results.push({ key, success: false, error: err.message, trustRun: null });
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* @async
|
|
80
|
-
* @param {string} externalSystem
|
|
81
|
-
* @param {Object} options
|
|
82
|
-
* @returns {Promise<{ success: boolean, results: Array<Object>, systemKey: string }>}
|
|
23
|
+
* @returns {Promise<{ success: boolean, results: Array<Object>, systemKey: string, trustReport?: Object }>}
|
|
83
24
|
*/
|
|
84
25
|
async function runTestTrustForExternalSystem(externalSystem, options = {}) {
|
|
85
|
-
const { systemKey
|
|
86
|
-
if (keys.length === 0) {
|
|
87
|
-
logger.log(chalk.yellow(`No datasources found for ${externalSystem}.`));
|
|
88
|
-
return { success: true, results: [], systemKey };
|
|
89
|
-
}
|
|
26
|
+
const { systemKey } = resolveExternalIntegrationContext(externalSystem);
|
|
90
27
|
|
|
91
28
|
const uploadCtx = await syncLocalIfRequested(systemKey, options);
|
|
92
29
|
if (uploadCtx?.authConfig && uploadCtx?.dataplaneUrl) {
|
|
@@ -95,30 +32,42 @@ async function runTestTrustForExternalSystem(externalSystem, options = {}) {
|
|
|
95
32
|
options.silentResolve = true;
|
|
96
33
|
}
|
|
97
34
|
if (options.revalidate === true) {
|
|
98
|
-
logger.log(chalk.cyan('Forcing revalidation (cache bypass)
|
|
35
|
+
logger.log(chalk.cyan('Forcing revalidation (cache bypass)…'));
|
|
99
36
|
}
|
|
100
37
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
38
|
+
let authConfig = options.authConfig;
|
|
39
|
+
let dataplaneUrl = options.dataplaneUrl;
|
|
40
|
+
if (!authConfig || !dataplaneUrl) {
|
|
41
|
+
const configObj = await getConfig();
|
|
42
|
+
const auth = await setupIntegrationTestAuth(
|
|
43
|
+
externalSystem,
|
|
44
|
+
{
|
|
45
|
+
environment: options.env,
|
|
46
|
+
authConfig: options.authConfig,
|
|
47
|
+
dataplaneUrl: options.dataplaneUrl,
|
|
48
|
+
silentResolve: options.silentResolve === true
|
|
49
|
+
},
|
|
50
|
+
configObj
|
|
51
|
+
);
|
|
52
|
+
authConfig = auth.authConfig;
|
|
53
|
+
dataplaneUrl = auth.dataplaneUrl;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const trustReport = await runSystemVerifyTrust(dataplaneUrl, authConfig, systemKey, {
|
|
57
|
+
forceRevalidate: options.revalidate === true
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
const results = (trustReport.datasourceRows || []).map(row => ({
|
|
61
|
+
key: row.datasourceKey,
|
|
62
|
+
success: trustReport.verdict === 'VERIFIED' || trustReport.verdict !== 'FAILED',
|
|
63
|
+
trustRun: {
|
|
64
|
+
trustDecision: row.trustDecision,
|
|
65
|
+
validationStatus: row.validationStatus
|
|
66
|
+
}
|
|
67
|
+
}));
|
|
68
|
+
|
|
69
|
+
const success = trustReport.verdict === 'VERIFIED';
|
|
70
|
+
return { success, results, systemKey, trustReport };
|
|
122
71
|
}
|
|
123
72
|
|
|
124
73
|
module.exports = {
|
|
@@ -328,6 +328,35 @@ async function ensureAppFromTemplate(appName, opts = {}) {
|
|
|
328
328
|
return primaryCopied;
|
|
329
329
|
}
|
|
330
330
|
|
|
331
|
+
/** Dataplane app key materialized for dataplane install (worker/beat are compose sidecars). */
|
|
332
|
+
const DATAPLANE_BUILDER_APP_KEYS = Object.freeze(['dataplane']);
|
|
333
|
+
|
|
334
|
+
/** Builder dirs removed on up-platform / setup force (includes Celery companions). */
|
|
335
|
+
const PLATFORM_BUILDER_CLEAN_APP_KEYS = Object.freeze([
|
|
336
|
+
'keycloak',
|
|
337
|
+
'miso-controller',
|
|
338
|
+
...DATAPLANE_BUILDER_APP_KEYS
|
|
339
|
+
]);
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* Ensure dataplane application manifest exists under the builder root.
|
|
343
|
+
* Worker/beat sidecars are resolved from parent application.yaml at run/compose time.
|
|
344
|
+
*
|
|
345
|
+
* @param {object} [opts]
|
|
346
|
+
* @param {boolean} [opts.silent]
|
|
347
|
+
* @returns {Promise<boolean>} True if any app template was copied
|
|
348
|
+
*/
|
|
349
|
+
async function ensureDataplaneAppsFromTemplate(opts = {}) {
|
|
350
|
+
let anyCopied = false;
|
|
351
|
+
for (const appName of DATAPLANE_BUILDER_APP_KEYS) {
|
|
352
|
+
const copied = await ensureAppFromTemplate(appName, opts);
|
|
353
|
+
if (copied) {
|
|
354
|
+
anyCopied = true;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
return anyCopied;
|
|
358
|
+
}
|
|
359
|
+
|
|
331
360
|
/**
|
|
332
361
|
* Merge builder/packages `application.yaml` into `~/.aifabrix/urls.local.yaml`.
|
|
333
362
|
* Same scan as the end of {@link prepareUrlsLocalRegistryForUpPlatform}; call after platform app
|
|
@@ -354,14 +383,17 @@ async function prepareUrlsLocalRegistryForUpPlatform(opts = {}) {
|
|
|
354
383
|
const templateOpts = { silent: Boolean(opts.silent) };
|
|
355
384
|
await ensureAppFromTemplate('keycloak', templateOpts);
|
|
356
385
|
await ensureAppFromTemplate('miso-controller', templateOpts);
|
|
357
|
-
await
|
|
386
|
+
await ensureDataplaneAppsFromTemplate(templateOpts);
|
|
358
387
|
refreshUrlsLocalRegistryForCurrentProject();
|
|
359
388
|
}
|
|
360
389
|
|
|
361
390
|
module.exports = {
|
|
362
391
|
applyUpPlatformForceConfig,
|
|
363
392
|
cleanBuilderAppDirs,
|
|
393
|
+
DATAPLANE_BUILDER_APP_KEYS,
|
|
394
|
+
PLATFORM_BUILDER_CLEAN_APP_KEYS,
|
|
364
395
|
ensureAppFromTemplate,
|
|
396
|
+
ensureDataplaneAppsFromTemplate,
|
|
365
397
|
patchEnvOutputPathForDeployOnly,
|
|
366
398
|
validateEnvOutputPathFolderOrNull,
|
|
367
399
|
getEnvOutputPathFolder,
|
|
@@ -29,7 +29,12 @@ const { checkHealthEndpoint } = require('../utils/health-check');
|
|
|
29
29
|
const { validateControllerUrl } = require('../utils/auth-config-validator');
|
|
30
30
|
const app = require('../app');
|
|
31
31
|
const { assertDevInfraUp } = require('./dev-infra-gate');
|
|
32
|
-
const {
|
|
32
|
+
const { dataplaneDockerHostPort } = require('../utils/declarative-url-ports');
|
|
33
|
+
const {
|
|
34
|
+
ensureDataplaneAppsFromTemplate,
|
|
35
|
+
validateEnvOutputPathFolderOrNull,
|
|
36
|
+
refreshUrlsLocalRegistryForCurrentProject
|
|
37
|
+
} = require('./up-common');
|
|
33
38
|
|
|
34
39
|
const CONTROLLER_HEALTH_PATH = '/health';
|
|
35
40
|
|
|
@@ -198,8 +203,7 @@ function computeDataplanePortOverride(runEnvKey, developerIdNum) {
|
|
|
198
203
|
if (runEnvKey !== 'dev' && runEnvKey !== 'tst') {
|
|
199
204
|
return undefined;
|
|
200
205
|
}
|
|
201
|
-
|
|
202
|
-
return runEnvKey === 'dev' ? baseHostPort + 10 : baseHostPort + 20;
|
|
206
|
+
return dataplaneDockerHostPort(3001, developerIdNum, runEnvKey);
|
|
203
207
|
}
|
|
204
208
|
|
|
205
209
|
function assertDevEnvironmentForDataplane(cfg) {
|
|
@@ -243,7 +247,7 @@ async function handleUpDataplane(options = {}) {
|
|
|
243
247
|
: await resolveEnvironment();
|
|
244
248
|
const { controllerUrl, authConfig } = await resolveUpDataplaneAuthContext(options, environmentKey);
|
|
245
249
|
|
|
246
|
-
await
|
|
250
|
+
await ensureDataplaneAppsFromTemplate();
|
|
247
251
|
// If envOutputPath target folder does not exist, set envOutputPath to null
|
|
248
252
|
validateEnvOutputPathFolderOrNull('dataplane');
|
|
249
253
|
|
package/lib/commands/upload.js
CHANGED
|
@@ -32,6 +32,7 @@ const {
|
|
|
32
32
|
resolveConfigurationValues,
|
|
33
33
|
collectResolvedVariableConfigurationNames
|
|
34
34
|
} = require('../utils/configuration-env-resolver');
|
|
35
|
+
const { pushRuntimeConfigurationValues } = require('../utils/runtime-configuration-values');
|
|
35
36
|
const { validateExternalSystemComplete } = require('../validation/validate');
|
|
36
37
|
const { displayValidationResults } = require('../validation/validate-display');
|
|
37
38
|
const { generateControllerManifest } = require('../generator/external-controller-manifest');
|
|
@@ -219,6 +220,24 @@ async function pushAndLogCredentialSecrets(dataplaneUrl, authConfig, systemKey,
|
|
|
219
220
|
if (pushResult.warning) {
|
|
220
221
|
logger.log(chalk.yellow(`Warning: ${pushResult.warning}`));
|
|
221
222
|
}
|
|
223
|
+
try {
|
|
224
|
+
const configPush = await pushRuntimeConfigurationValues(
|
|
225
|
+
dataplaneUrl,
|
|
226
|
+
authConfig,
|
|
227
|
+
systemKey,
|
|
228
|
+
payload
|
|
229
|
+
);
|
|
230
|
+
if (configPush.pushed > 0) {
|
|
231
|
+
const nameList = configPush.names.length ? ` (${configPush.names.join(', ')})` : '';
|
|
232
|
+
logger.log(
|
|
233
|
+
formatSuccessLine(
|
|
234
|
+
`Stored ${configPush.pushed} runtime configuration value(s) in dataplane${nameList}.`
|
|
235
|
+
)
|
|
236
|
+
);
|
|
237
|
+
}
|
|
238
|
+
} catch (err) {
|
|
239
|
+
logger.log(chalk.yellow(`Warning: runtime configuration store skipped: ${err.message}`));
|
|
240
|
+
}
|
|
222
241
|
}
|
|
223
242
|
|
|
224
243
|
/**
|
|
@@ -314,7 +333,7 @@ async function buildValidatedUploadManifestPayload(systemKey, opts = {}) {
|
|
|
314
333
|
* @param {Object} manifest
|
|
315
334
|
* @returns {Promise<void>}
|
|
316
335
|
*/
|
|
317
|
-
async function logAndSyncLocalOpenApiForUpload(systemKey, manifest) {
|
|
336
|
+
async function logAndSyncLocalOpenApiForUpload(systemKey, manifest, uploadContext = {}) {
|
|
318
337
|
const appPath = getIntegrationPath(systemKey);
|
|
319
338
|
const ei = manifest && manifest.externalIntegration;
|
|
320
339
|
const datasourceFiles = ei && Array.isArray(ei.dataSources) ? ei.dataSources : [];
|
|
@@ -323,7 +342,9 @@ async function logAndSyncLocalOpenApiForUpload(systemKey, manifest) {
|
|
|
323
342
|
dryRun: false,
|
|
324
343
|
appPath,
|
|
325
344
|
systemKey,
|
|
326
|
-
datasourceFiles
|
|
345
|
+
datasourceFiles,
|
|
346
|
+
dataplaneUrl: uploadContext.dataplaneUrl,
|
|
347
|
+
authConfig: uploadContext.authConfig
|
|
327
348
|
});
|
|
328
349
|
for (const line of openapiSyncLines) {
|
|
329
350
|
logger.log(line.startsWith('Skipped') ? formatWarningLine(line) : formatSuccessLine(line));
|
|
@@ -372,7 +393,7 @@ async function runUploadPublishAndSummary(systemKey, options, manifest, payload)
|
|
|
372
393
|
await pushAndLogCredentialSecrets(dataplaneUrl, authConfig, systemKey, payload, {
|
|
373
394
|
json: options.json === true
|
|
374
395
|
});
|
|
375
|
-
await logAndSyncLocalOpenApiForUpload(systemKey, manifest);
|
|
396
|
+
await logAndSyncLocalOpenApiForUpload(systemKey, manifest, { dataplaneUrl, authConfig });
|
|
376
397
|
await handlePublicationAndFollowups(
|
|
377
398
|
{
|
|
378
399
|
systemKey,
|
|
@@ -39,7 +39,10 @@ async function runVerifyTrustCommandAction(appName, options, cmd) {
|
|
|
39
39
|
systemKey: result.systemKey,
|
|
40
40
|
command: result.command,
|
|
41
41
|
verdict: result.verdict,
|
|
42
|
-
|
|
42
|
+
aiTrustPercent: result.aiTrustPercent,
|
|
43
|
+
accessConfidencePercent: result.accessConfidencePercent,
|
|
44
|
+
businessConfidencePercent: result.businessConfidencePercent,
|
|
45
|
+
findings: result.findings,
|
|
43
46
|
datasourceRows: opts.details ? result.datasourceRows : undefined
|
|
44
47
|
},
|
|
45
48
|
opts.details || opts.verbose
|
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @fileoverview verify-trust orchestration with
|
|
2
|
+
* @fileoverview verify-trust orchestration with dual-confidence report (433.0).
|
|
3
3
|
* @author AI Fabrix Team
|
|
4
|
-
* @version
|
|
4
|
+
* @version 2.0.0
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
'use strict';
|
|
8
8
|
|
|
9
9
|
const { runTestTrustForExternalSystem } = require('./test-trust-external');
|
|
10
|
-
const {
|
|
11
|
-
VERDICT,
|
|
12
|
-
verdictFromPassed,
|
|
13
|
-
worstConfidencePercent
|
|
14
|
-
} = require('../lifecycle/product-model');
|
|
10
|
+
const { VERDICT, verdictFromPassed } = require('../lifecycle/product-model');
|
|
15
11
|
|
|
16
12
|
/**
|
|
17
13
|
* @param {Array<Object>} rows
|
|
@@ -20,14 +16,12 @@ const {
|
|
|
20
16
|
function mapTrustDatasourceRows(rows) {
|
|
21
17
|
return (rows || []).map(row => {
|
|
22
18
|
const tr = row.trustRun;
|
|
23
|
-
const confidencePercent =
|
|
24
|
-
tr && typeof tr.confidence === 'number' ? Math.round(tr.confidence * 100) : null;
|
|
25
19
|
const verdict = row.success ? VERDICT.VERIFIED : VERDICT.FAILED;
|
|
26
20
|
return {
|
|
27
21
|
datasourceKey: row.key,
|
|
28
22
|
verdict,
|
|
29
|
-
confidencePercent,
|
|
30
23
|
trustDecision: tr?.trustDecision,
|
|
24
|
+
validationStatus: tr?.validationStatus,
|
|
31
25
|
error: row.error
|
|
32
26
|
};
|
|
33
27
|
});
|
|
@@ -40,22 +34,20 @@ function mapTrustDatasourceRows(rows) {
|
|
|
40
34
|
* @returns {Promise<Object>}
|
|
41
35
|
*/
|
|
42
36
|
async function runVerifyTrustForExternalSystem(systemKey, options = {}) {
|
|
43
|
-
const { success, results, systemKey: resolvedKey } =
|
|
44
|
-
systemKey,
|
|
45
|
-
options
|
|
46
|
-
);
|
|
37
|
+
const { success, results, systemKey: resolvedKey, trustReport } =
|
|
38
|
+
await runTestTrustForExternalSystem(systemKey, options);
|
|
47
39
|
const datasourceRows = mapTrustDatasourceRows(results);
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
.filter(v => v !== null);
|
|
51
|
-
const businessContextConfidencePercent = worstConfidencePercent(confidences);
|
|
52
|
-
const verdict = verdictFromPassed(success);
|
|
40
|
+
const report = trustReport || {};
|
|
41
|
+
const verdict = report.verdict ? report.verdict : verdictFromPassed(success);
|
|
53
42
|
|
|
54
43
|
return {
|
|
55
44
|
systemKey: resolvedKey || systemKey,
|
|
56
45
|
command: 'verify-trust',
|
|
57
46
|
verdict,
|
|
58
|
-
|
|
47
|
+
aiTrustPercent: report.aiTrustPercent ?? null,
|
|
48
|
+
accessConfidencePercent: report.accessConfidencePercent ?? null,
|
|
49
|
+
businessConfidencePercent: report.businessConfidencePercent ?? null,
|
|
50
|
+
findings: Array.isArray(report.findings) ? report.findings : [],
|
|
59
51
|
datasourceRows,
|
|
60
52
|
results
|
|
61
53
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `setupPlatformMode` field in `config.yaml` (`single` | `full`).
|
|
2
|
+
* `setupPlatformMode` field in `config.yaml` (`single` | `single-traefik` | `full`).
|
|
3
3
|
*
|
|
4
4
|
* @fileoverview Persists setup wizard platform mode
|
|
5
5
|
* @author AI Fabrix Team
|
|
@@ -15,7 +15,7 @@ const {
|
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* @param {() => Promise<Object>} getConfig
|
|
18
|
-
* @returns {Promise<'single'|'full'>}
|
|
18
|
+
* @returns {Promise<'single'|'single-traefik'|'full'>}
|
|
19
19
|
*/
|
|
20
20
|
async function getSetupPlatformModeFromConfig(getConfig) {
|
|
21
21
|
const cfg = await getConfig();
|
|
@@ -29,7 +29,7 @@ async function getSetupPlatformModeFromConfig(getConfig) {
|
|
|
29
29
|
* @param {() => Promise<Object>} getConfig
|
|
30
30
|
* @param {(data: Object) => Promise<void>} saveConfig
|
|
31
31
|
* @param {unknown} mode
|
|
32
|
-
* @returns {Promise<'single'|'full'>}
|
|
32
|
+
* @returns {Promise<'single'|'single-traefik'|'full'>}
|
|
33
33
|
*/
|
|
34
34
|
async function setSetupPlatformModeInConfig(getConfig, saveConfig, mode) {
|
|
35
35
|
const normalized = normalizeSetupPlatformMode(mode);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Setup platform topology mode (`single` | `full`).
|
|
2
|
+
* Setup platform topology mode (`single` | `single-traefik` | `full`).
|
|
3
3
|
*
|
|
4
4
|
* This is distinct from `setupInstallationProfile` (dev/pro password bundle) and from
|
|
5
5
|
* the login/run environment (`dev` | `tst` | `pro`).
|
|
@@ -14,12 +14,20 @@
|
|
|
14
14
|
/** @enum {string} */
|
|
15
15
|
const SETUP_PLATFORM_MODE = Object.freeze({
|
|
16
16
|
SINGLE: 'single',
|
|
17
|
+
SINGLE_TRAEFIK: 'single-traefik',
|
|
17
18
|
FULL: 'full'
|
|
18
19
|
});
|
|
19
20
|
|
|
21
|
+
/** @type {readonly string[]} */
|
|
22
|
+
const SETUP_PLATFORM_MODE_CLI_VALUES = Object.freeze([
|
|
23
|
+
SETUP_PLATFORM_MODE.SINGLE,
|
|
24
|
+
SETUP_PLATFORM_MODE.SINGLE_TRAEFIK,
|
|
25
|
+
SETUP_PLATFORM_MODE.FULL
|
|
26
|
+
]);
|
|
27
|
+
|
|
20
28
|
/**
|
|
21
29
|
* @param {unknown} value
|
|
22
|
-
* @returns {'single'|'full'}
|
|
30
|
+
* @returns {'single'|'single-traefik'|'full'}
|
|
23
31
|
*/
|
|
24
32
|
function normalizeSetupPlatformMode(value) {
|
|
25
33
|
const raw = String(value ?? '')
|
|
@@ -27,6 +35,8 @@ function normalizeSetupPlatformMode(value) {
|
|
|
27
35
|
.toLowerCase();
|
|
28
36
|
if (raw === SETUP_PLATFORM_MODE.FULL) return SETUP_PLATFORM_MODE.FULL;
|
|
29
37
|
if (raw === 'all' || raw === 'full-platform' || raw === 'platform-full') return SETUP_PLATFORM_MODE.FULL;
|
|
38
|
+
if (raw === SETUP_PLATFORM_MODE.SINGLE_TRAEFIK) return SETUP_PLATFORM_MODE.SINGLE_TRAEFIK;
|
|
39
|
+
if (raw === 'ingress' || raw === 'single-ingress' || raw === 'traefik') return SETUP_PLATFORM_MODE.SINGLE_TRAEFIK;
|
|
30
40
|
return SETUP_PLATFORM_MODE.SINGLE;
|
|
31
41
|
}
|
|
32
42
|
|
|
@@ -34,22 +44,47 @@ function normalizeSetupPlatformMode(value) {
|
|
|
34
44
|
* Derived config flags for a chosen platform mode.
|
|
35
45
|
*
|
|
36
46
|
* - single: direct ports, no front door ingress
|
|
37
|
-
* -
|
|
47
|
+
* - single-traefik: Traefik front door (domain + TLS) for one environment only
|
|
48
|
+
* - full: Traefik ingress + env-scoped resources (multi-env; CLI only until menu returns)
|
|
38
49
|
*
|
|
39
|
-
* @param {'single'|'full'} mode
|
|
50
|
+
* @param {'single'|'single-traefik'|'full'} mode
|
|
40
51
|
* @returns {{ traefik: boolean, useEnvironmentScopedResources: boolean }}
|
|
41
52
|
*/
|
|
42
53
|
function flagsForSetupPlatformMode(mode) {
|
|
43
54
|
const m = normalizeSetupPlatformMode(mode);
|
|
55
|
+
const traefik =
|
|
56
|
+
m === SETUP_PLATFORM_MODE.SINGLE_TRAEFIK || m === SETUP_PLATFORM_MODE.FULL;
|
|
44
57
|
return {
|
|
45
|
-
traefik
|
|
58
|
+
traefik,
|
|
46
59
|
useEnvironmentScopedResources: m === SETUP_PLATFORM_MODE.FULL
|
|
47
60
|
};
|
|
48
61
|
}
|
|
49
62
|
|
|
63
|
+
/**
|
|
64
|
+
* Interactive setup menu choices (full platform hidden until multi-env path ships).
|
|
65
|
+
*
|
|
66
|
+
* @returns {{ name: string, value: string }[]}
|
|
67
|
+
*/
|
|
68
|
+
function getSetupPlatformModePromptChoices() {
|
|
69
|
+
return [
|
|
70
|
+
{
|
|
71
|
+
name: 'Single environment — direct ports (no Traefik front door)',
|
|
72
|
+
value: SETUP_PLATFORM_MODE.SINGLE
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
name: 'Single environment — Traefik front door (domain + TLS)',
|
|
76
|
+
value: SETUP_PLATFORM_MODE.SINGLE_TRAEFIK
|
|
77
|
+
}
|
|
78
|
+
// Full platform — Traefik front door + miso/dev/tst/pro (shared infra) — menu returns soon.
|
|
79
|
+
// { name: 'Full platform — Traefik front door + miso/dev/tst/pro (shared infra)', value: SETUP_PLATFORM_MODE.FULL },
|
|
80
|
+
];
|
|
81
|
+
}
|
|
82
|
+
|
|
50
83
|
module.exports = {
|
|
51
84
|
SETUP_PLATFORM_MODE,
|
|
85
|
+
SETUP_PLATFORM_MODE_CLI_VALUES,
|
|
52
86
|
normalizeSetupPlatformMode,
|
|
53
|
-
flagsForSetupPlatformMode
|
|
87
|
+
flagsForSetupPlatformMode,
|
|
88
|
+
getSetupPlatformModePromptChoices
|
|
54
89
|
};
|
|
55
90
|
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
const { deepClone } = require('./copy-operations');
|
|
10
|
+
const { capabilitiesIncludes } = require('./capability-manifest');
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* @param {object} doc - Parsed datasource JSON
|
|
@@ -16,8 +17,7 @@ const { deepClone } = require('./copy-operations');
|
|
|
16
17
|
*/
|
|
17
18
|
function extractCapabilitySliceForDiff(doc, capabilityKey, profileKey) {
|
|
18
19
|
const cap = capabilityKey;
|
|
19
|
-
const listed =
|
|
20
|
-
Boolean(Array.isArray(doc.capabilities) && doc.capabilities.includes(cap));
|
|
20
|
+
const listed = capabilitiesIncludes(doc.capabilities, cap);
|
|
21
21
|
const openapiOp = doc.openapi?.operations?.[cap];
|
|
22
22
|
const cipOp = doc.execution?.cip?.operations?.[cap];
|
|
23
23
|
let exposedProfile;
|