@red-hat-developer-hub/e2e-test-utils 1.1.31 → 1.1.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/playwright/global-setup.d.ts +2 -1
- package/dist/playwright/global-setup.d.ts.map +1 -1
- package/dist/playwright/global-setup.js +21 -1
- package/dist/utils/plugin-metadata.d.ts +3 -1
- package/dist/utils/plugin-metadata.d.ts.map +1 -1
- package/dist/utils/plugin-metadata.js +5 -3
- package/dist/utils/tests/plugin-metadata.pr.test.js +55 -0
- package/dist/utils/tests/plugin-metadata.test.js +2 -2
- package/dist/utils/vault.d.ts +16 -0
- package/dist/utils/vault.d.ts.map +1 -0
- package/dist/utils/vault.js +94 -0
- package/package.json +2 -1
|
@@ -2,5 +2,6 @@
|
|
|
2
2
|
* Global setup for Playwright tests.
|
|
3
3
|
* This file runs once before all tests.
|
|
4
4
|
*/
|
|
5
|
-
|
|
5
|
+
import { type FullConfig } from "@playwright/test";
|
|
6
|
+
export default function globalSetup(config: FullConfig): Promise<void>;
|
|
6
7
|
//# sourceMappingURL=global-setup.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"global-setup.d.ts","sourceRoot":"","sources":["../../src/playwright/global-setup.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"global-setup.d.ts","sourceRoot":"","sources":["../../src/playwright/global-setup.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AA6EnD,wBAA8B,WAAW,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAQ3E"}
|
|
@@ -2,10 +2,13 @@
|
|
|
2
2
|
* Global setup for Playwright tests.
|
|
3
3
|
* This file runs once before all tests.
|
|
4
4
|
*/
|
|
5
|
+
import dotenv from "dotenv";
|
|
6
|
+
import { resolve } from "path";
|
|
5
7
|
import { KubernetesClientHelper } from "../utils/kubernetes-client.js";
|
|
6
8
|
import { $ } from "../utils/bash.js";
|
|
7
9
|
import { KeycloakHelper } from "../deployment/keycloak/index.js";
|
|
8
10
|
import { DEFAULT_KEYCLOAK_CONFIG, DEFAULT_RHDH_CLIENT, DEFAULT_USERS, } from "../deployment/keycloak/constants.js";
|
|
11
|
+
import { loadLocalVaultSecrets } from "../utils/vault.js";
|
|
9
12
|
const REQUIRED_BINARIES = ["oc", "kubectl", "helm"];
|
|
10
13
|
async function checkRequiredBinaries() {
|
|
11
14
|
const missingBinaries = [];
|
|
@@ -58,10 +61,27 @@ async function deployKeycloak() {
|
|
|
58
61
|
testPassword: DEFAULT_USERS[0].password,
|
|
59
62
|
});
|
|
60
63
|
}
|
|
61
|
-
export default async function globalSetup() {
|
|
64
|
+
export default async function globalSetup(config) {
|
|
62
65
|
console.log("Running global setup...");
|
|
63
66
|
await checkRequiredBinaries();
|
|
67
|
+
await loadLocalVaultSecrets();
|
|
68
|
+
loadDotenvFromProjects(config);
|
|
64
69
|
await setClusterRouterBaseEnv();
|
|
65
70
|
await deployKeycloak();
|
|
66
71
|
console.log("Global setup completed successfully");
|
|
67
72
|
}
|
|
73
|
+
/**
|
|
74
|
+
* Loads .env files from each project's e2e-tests directory.
|
|
75
|
+
* Uses `override: true` so local .env values take priority over Vault secrets.
|
|
76
|
+
*/
|
|
77
|
+
function loadDotenvFromProjects(config) {
|
|
78
|
+
const seen = new Set();
|
|
79
|
+
for (const project of config.projects) {
|
|
80
|
+
// testDir points to e2e-tests/tests, go up one level to e2e-tests/
|
|
81
|
+
const e2eRoot = resolve(project.testDir, "..");
|
|
82
|
+
if (seen.has(e2eRoot))
|
|
83
|
+
continue;
|
|
84
|
+
seen.add(e2eRoot);
|
|
85
|
+
dotenv.config({ path: resolve(e2eRoot, ".env"), override: true });
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -28,9 +28,11 @@ export interface DynamicPluginsConfig {
|
|
|
28
28
|
export declare function isNightlyJob(): boolean;
|
|
29
29
|
/**
|
|
30
30
|
* Extracts the plugin name from a package path or OCI reference.
|
|
31
|
+
* Strips the `-dynamic` suffix so local paths and OCI refs for the same
|
|
32
|
+
* logical plugin produce the same key.
|
|
31
33
|
*
|
|
32
34
|
* Handles various formats:
|
|
33
|
-
* - Local path: ./dynamic-plugins/dist/backstage-community-plugin-tech-radar
|
|
35
|
+
* - Local path: ./dynamic-plugins/dist/backstage-community-plugin-tech-radar-dynamic
|
|
34
36
|
* - OCI with alias: oci://quay.io/rhdh/plugin@sha256:...!backstage-community-plugin-tech-radar
|
|
35
37
|
* - OCI without alias: oci://quay.io/rhdh/backstage-community-plugin-tech-radar:tag
|
|
36
38
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-metadata.d.ts","sourceRoot":"","sources":["../../src/utils/plugin-metadata.ts"],"names":[],"mappings":"AAWA,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtC,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACpB;AAaD,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACvC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,CAAC,EAAE,WAAW,EAAE,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAID;;;;;;;;;GASG;AACH,wBAAgB,YAAY,IAAI,OAAO,CAqBtC;AAID
|
|
1
|
+
{"version":3,"file":"plugin-metadata.d.ts","sourceRoot":"","sources":["../../src/utils/plugin-metadata.ts"],"names":[],"mappings":"AAWA,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtC,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACpB;AAaD,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACvC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,CAAC,EAAE,WAAW,EAAE,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAID;;;;;;;;;GASG;AACH,wBAAgB,YAAY,IAAI,OAAO,CAqBtC;AAID;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAI5D;AAYD,eAAO,MAAM,qBAAqB,gBAAgB,CAAC;AAEnD,wBAAgB,oBAAoB,CAClC,YAAY,GAAE,MAA8B,GAC3C,MAAM,GAAG,IAAI,CAQf;AAED,wBAAsB,iBAAiB,CACrC,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,cAAc,CAAC,CAyBzB;AAED,wBAAsB,qBAAqB,CACzC,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,CAwBtC;AA2JD;;;;;;;GAOG;AACH;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE;IACjD,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,GAAG,MAAM,CAMT;AAqGD;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,oBAAoB,CAW7E;AAED;;;;;;;GAOG;AACH,wBAAsB,2BAA2B,CAC/C,YAAY,GAAE,MAA8B,GAC3C,OAAO,CAAC,oBAAoB,CAAC,CAwB/B;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,2BAA2B,CAC/C,MAAM,EAAE,oBAAoB,EAC5B,YAAY,GAAE,MAA8B,GAC3C,OAAO,CAAC,oBAAoB,CAAC,CA6B/B"}
|
|
@@ -35,16 +35,18 @@ export function isNightlyJob() {
|
|
|
35
35
|
// ── Utilities ─────────────────────────────────────────────────────────────────
|
|
36
36
|
/**
|
|
37
37
|
* Extracts the plugin name from a package path or OCI reference.
|
|
38
|
+
* Strips the `-dynamic` suffix so local paths and OCI refs for the same
|
|
39
|
+
* logical plugin produce the same key.
|
|
38
40
|
*
|
|
39
41
|
* Handles various formats:
|
|
40
|
-
* - Local path: ./dynamic-plugins/dist/backstage-community-plugin-tech-radar
|
|
42
|
+
* - Local path: ./dynamic-plugins/dist/backstage-community-plugin-tech-radar-dynamic
|
|
41
43
|
* - OCI with alias: oci://quay.io/rhdh/plugin@sha256:...!backstage-community-plugin-tech-radar
|
|
42
44
|
* - OCI without alias: oci://quay.io/rhdh/backstage-community-plugin-tech-radar:tag
|
|
43
45
|
*/
|
|
44
46
|
export function extractPluginName(packageRef) {
|
|
45
47
|
const ref = packageRef.includes("!") ? packageRef.split("!")[0] : packageRef;
|
|
46
48
|
const match = ref.match(/\/([^/:@]+)(?:[:@].*)?$/);
|
|
47
|
-
return match?.[1] || packageRef;
|
|
49
|
+
return (match?.[1] || packageRef).replace(/-dynamic$/, "");
|
|
48
50
|
}
|
|
49
51
|
/**
|
|
50
52
|
* Derives the displayName from a packageName.
|
|
@@ -207,7 +209,7 @@ export function getNormalizedPluginMergeKey(entry) {
|
|
|
207
209
|
if (pkg === undefined || pkg === "") {
|
|
208
210
|
return "";
|
|
209
211
|
}
|
|
210
|
-
return extractPluginName(pkg)
|
|
212
|
+
return extractPluginName(pkg);
|
|
211
213
|
}
|
|
212
214
|
async function resolvePluginPackages(plugins, metadataMap, metadataPath) {
|
|
213
215
|
// Build PR OCI URLs if applicable
|
|
@@ -256,6 +256,61 @@ describe("processPluginsForDeployment — PR mode", () => {
|
|
|
256
256
|
await fs.remove(metadataDir);
|
|
257
257
|
}
|
|
258
258
|
});
|
|
259
|
+
// ── -dynamic suffix normalization ────────────────────────────────────────
|
|
260
|
+
describe("-dynamic suffix normalization", () => {
|
|
261
|
+
it("resolves OCI plugin to metadata when dynamicArtifact has -dynamic suffix", async () => {
|
|
262
|
+
const metadataDir = await createMetadataFixture([
|
|
263
|
+
{
|
|
264
|
+
name: "backstage-plugin-catalog-backend-module-github",
|
|
265
|
+
packageName: "@backstage/plugin-catalog-backend-module-github",
|
|
266
|
+
dynamicArtifact: "./dynamic-plugins/dist/backstage-plugin-catalog-backend-module-github-dynamic",
|
|
267
|
+
appConfigExamples: {
|
|
268
|
+
catalog: { providers: { github: { org: "test" } } },
|
|
269
|
+
},
|
|
270
|
+
},
|
|
271
|
+
]);
|
|
272
|
+
try {
|
|
273
|
+
const config = {
|
|
274
|
+
plugins: [
|
|
275
|
+
{
|
|
276
|
+
package: "oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/backstage-plugin-catalog-backend-module-github:bs_1.45.3__0.11.2",
|
|
277
|
+
disabled: false,
|
|
278
|
+
},
|
|
279
|
+
],
|
|
280
|
+
};
|
|
281
|
+
const result = await processPluginsForDeployment(config, metadataDir);
|
|
282
|
+
assert.ok(result.plugins[0].pluginConfig, "metadata config must be injected even when dynamicArtifact has -dynamic suffix but OCI URL does not");
|
|
283
|
+
assert.deepStrictEqual(result.plugins[0].pluginConfig, { catalog: { providers: { github: { org: "test" } } } }, "injected config must match metadata appConfigExamples");
|
|
284
|
+
}
|
|
285
|
+
finally {
|
|
286
|
+
await fs.remove(metadataDir);
|
|
287
|
+
}
|
|
288
|
+
});
|
|
289
|
+
it("keeps local -dynamic path unchanged when metadata also has -dynamic", async () => {
|
|
290
|
+
const metadataDir = await createMetadataFixture([
|
|
291
|
+
{
|
|
292
|
+
name: "backstage-plugin-catalog-backend-module-github",
|
|
293
|
+
packageName: "@backstage/plugin-catalog-backend-module-github",
|
|
294
|
+
dynamicArtifact: "./dynamic-plugins/dist/backstage-plugin-catalog-backend-module-github-dynamic",
|
|
295
|
+
},
|
|
296
|
+
]);
|
|
297
|
+
try {
|
|
298
|
+
const config = {
|
|
299
|
+
plugins: [
|
|
300
|
+
{
|
|
301
|
+
package: "./dynamic-plugins/dist/backstage-plugin-catalog-backend-module-github-dynamic",
|
|
302
|
+
disabled: false,
|
|
303
|
+
},
|
|
304
|
+
],
|
|
305
|
+
};
|
|
306
|
+
const result = await processPluginsForDeployment(config, metadataDir);
|
|
307
|
+
assert.strictEqual(result.plugins[0].package, "./dynamic-plugins/dist/backstage-plugin-catalog-backend-module-github-dynamic", "local path with -dynamic must stay unchanged");
|
|
308
|
+
}
|
|
309
|
+
finally {
|
|
310
|
+
await fs.remove(metadataDir);
|
|
311
|
+
}
|
|
312
|
+
});
|
|
313
|
+
});
|
|
259
314
|
// ── PR vs nightly precedence ────────────────────────────────────────────
|
|
260
315
|
describe("PR vs nightly precedence", () => {
|
|
261
316
|
it("isNightlyJob returns false when both GIT_PR_NUMBER and E2E_NIGHTLY_MODE are set", () => {
|
|
@@ -18,8 +18,8 @@ describe("extractPluginName", () => {
|
|
|
18
18
|
it("extracts name from OCI URL with tag only (no alias)", () => {
|
|
19
19
|
assert.strictEqual(extractPluginName("oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/backstage-community-plugin-tekton:bs_1.45.3__3.33.3"), "backstage-community-plugin-tekton");
|
|
20
20
|
});
|
|
21
|
-
it("extracts name from local path", () => {
|
|
22
|
-
assert.strictEqual(extractPluginName("./dynamic-plugins/dist/backstage-community-plugin-keycloak-dynamic"), "backstage-community-plugin-keycloak
|
|
21
|
+
it("extracts name from local path and strips -dynamic suffix", () => {
|
|
22
|
+
assert.strictEqual(extractPluginName("./dynamic-plugins/dist/backstage-community-plugin-keycloak-dynamic"), "backstage-community-plugin-keycloak");
|
|
23
23
|
});
|
|
24
24
|
it("extracts name from OCI URL with digest but no alias", () => {
|
|
25
25
|
assert.strictEqual(extractPluginName("oci://quay.io/rhdh/backstage-plugin-events-backend-module-github@sha256:c1d17d47aaa"), "backstage-plugin-events-backend-module-github");
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Loads secrets from HashiCorp Vault into process.env.
|
|
3
|
+
* Only runs when `VAULT=1` or `VAULT=true` is set. Handles OIDC login automatically.
|
|
4
|
+
*
|
|
5
|
+
* Fetches secrets from:
|
|
6
|
+
* - Global path: `<basePath>/global`
|
|
7
|
+
* - Per-workspace paths: `<basePath>/workspaces/<name>`
|
|
8
|
+
*
|
|
9
|
+
* Configure via env vars:
|
|
10
|
+
* - `VAULT_ADDR` — Vault server URL (default: https://vault.ci.openshift.org)
|
|
11
|
+
* - `VAULT_BASE_PATH` — Base path in Vault (default: selfservice/rhdh-plugin-export-overlays)
|
|
12
|
+
*
|
|
13
|
+
* Security: Only key names are logged, never secret values.
|
|
14
|
+
*/
|
|
15
|
+
export declare function loadLocalVaultSecrets(): Promise<void>;
|
|
16
|
+
//# sourceMappingURL=vault.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vault.d.ts","sourceRoot":"","sources":["../../src/utils/vault.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;GAaG;AACH,wBAAsB,qBAAqB,IAAI,OAAO,CAAC,IAAI,CAAC,CAiE3D"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { $ } from "./bash.js";
|
|
2
|
+
const VAULT_ADDR_DEFAULT = "https://vault.ci.openshift.org";
|
|
3
|
+
const VAULT_BASE_PATH_DEFAULT = "selfservice/rhdh-plugin-export-overlays";
|
|
4
|
+
/**
|
|
5
|
+
* Loads secrets from HashiCorp Vault into process.env.
|
|
6
|
+
* Only runs when `VAULT=1` or `VAULT=true` is set. Handles OIDC login automatically.
|
|
7
|
+
*
|
|
8
|
+
* Fetches secrets from:
|
|
9
|
+
* - Global path: `<basePath>/global`
|
|
10
|
+
* - Per-workspace paths: `<basePath>/workspaces/<name>`
|
|
11
|
+
*
|
|
12
|
+
* Configure via env vars:
|
|
13
|
+
* - `VAULT_ADDR` — Vault server URL (default: https://vault.ci.openshift.org)
|
|
14
|
+
* - `VAULT_BASE_PATH` — Base path in Vault (default: selfservice/rhdh-plugin-export-overlays)
|
|
15
|
+
*
|
|
16
|
+
* Security: Only key names are logged, never secret values.
|
|
17
|
+
*/
|
|
18
|
+
export async function loadLocalVaultSecrets() {
|
|
19
|
+
if (process.env.VAULT !== "1" && process.env.VAULT !== "true")
|
|
20
|
+
return;
|
|
21
|
+
const vaultAddr = process.env.VAULT_ADDR || VAULT_ADDR_DEFAULT;
|
|
22
|
+
const basePath = process.env.VAULT_BASE_PATH || VAULT_BASE_PATH_DEFAULT;
|
|
23
|
+
process.env.VAULT_ADDR = vaultAddr;
|
|
24
|
+
// Check vault CLI is installed
|
|
25
|
+
const whichResult = await vaultCmd `command -v vault`;
|
|
26
|
+
if (whichResult.exitCode !== 0) {
|
|
27
|
+
throw new Error("vault CLI not found. Install from https://developer.hashicorp.com/vault/downloads");
|
|
28
|
+
}
|
|
29
|
+
// Check if already logged in
|
|
30
|
+
const tokenCheck = await vaultCmd `vault token lookup`;
|
|
31
|
+
if (tokenCheck.exitCode !== 0) {
|
|
32
|
+
console.log("Vault: not logged in, starting OIDC login...");
|
|
33
|
+
// vault login needs inherited stdio for browser-based OIDC flow
|
|
34
|
+
await $ `vault login -no-print -method=oidc`;
|
|
35
|
+
const retryCheck = await vaultCmd `vault token lookup`;
|
|
36
|
+
if (retryCheck.exitCode !== 0) {
|
|
37
|
+
throw new Error("Vault login failed. Run manually:\n export VAULT_ADDR='" +
|
|
38
|
+
vaultAddr +
|
|
39
|
+
"'\n vault login -method=oidc");
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
// Check access by fetching global secrets first
|
|
43
|
+
const globalResult = await vaultCmd `vault kv get -format=json -mount=kv ${basePath}/global`;
|
|
44
|
+
if (globalResult.stderr.includes("permission denied")) {
|
|
45
|
+
console.log("Vault: permission denied. Request access in Slack: #rhdh-e2e-tests");
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
console.log("Loading secrets from vault...");
|
|
49
|
+
// Load global secrets
|
|
50
|
+
loadSecretsFromResult(globalResult, "global");
|
|
51
|
+
// List and fetch per-workspace secrets
|
|
52
|
+
const listResult = await vaultCmd `vault kv list -format=json -mount=kv ${basePath}/workspaces`;
|
|
53
|
+
if (listResult.exitCode === 0) {
|
|
54
|
+
const workspaces = JSON.parse(listResult.stdout);
|
|
55
|
+
await Promise.all(workspaces.map((ws) => {
|
|
56
|
+
const name = ws.replace(/\/$/, "");
|
|
57
|
+
return exportSecretsFromPath(`${basePath}/workspaces/${name}`, name);
|
|
58
|
+
}));
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
console.log(" No workspace-specific secrets found");
|
|
62
|
+
}
|
|
63
|
+
console.log("Vault secrets loaded successfully.");
|
|
64
|
+
}
|
|
65
|
+
/** Runs a shell command with piped stdio and nothrow, for capturing vault CLI output. */
|
|
66
|
+
const vaultCmd = $({
|
|
67
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
68
|
+
nothrow: true,
|
|
69
|
+
});
|
|
70
|
+
async function exportSecretsFromPath(vaultPath, label) {
|
|
71
|
+
const result = await vaultCmd `vault kv get -format=json -mount=kv ${vaultPath}`;
|
|
72
|
+
loadSecretsFromResult(result, label);
|
|
73
|
+
}
|
|
74
|
+
function loadSecretsFromResult(result, label) {
|
|
75
|
+
if (result.exitCode !== 0) {
|
|
76
|
+
console.log(` No secrets at: ${label}`);
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
const json = JSON.parse(result.stdout);
|
|
80
|
+
const secrets = json?.data?.data;
|
|
81
|
+
if (!secrets) {
|
|
82
|
+
console.log(` No secrets at: ${label}`);
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
console.log(` From: ${label}`);
|
|
86
|
+
for (const [key, value] of Object.entries(secrets)) {
|
|
87
|
+
if (key.startsWith("secretsync/"))
|
|
88
|
+
continue;
|
|
89
|
+
if (!key.startsWith("VAULT_"))
|
|
90
|
+
continue;
|
|
91
|
+
const safeKey = key.replace(/[.\-/]/g, "_");
|
|
92
|
+
process.env[safeKey] = value;
|
|
93
|
+
}
|
|
94
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@red-hat-developer-hub/e2e-test-utils",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.33",
|
|
4
4
|
"description": "Test utilities for RHDH E2E tests",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -107,6 +107,7 @@
|
|
|
107
107
|
"@eslint/js": "10.0.1",
|
|
108
108
|
"@keycloak/keycloak-admin-client": "26.5.6",
|
|
109
109
|
"@kubernetes/client-node": "1.4.0",
|
|
110
|
+
"dotenv": "17.4.2",
|
|
110
111
|
"eslint": "10.2.0",
|
|
111
112
|
"eslint-plugin-check-file": "3.3.1",
|
|
112
113
|
"eslint-plugin-playwright": "2.10.1",
|