viza 1.8.15 → 1.8.16
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/src/commands/age/bootstrap/bootstrap.js +4 -4
- package/dist/src/commands/age/bootstrap/register.js +0 -2
- package/dist/src/commands/aws/rolesanywhere/bootstrap/bootstrap.js +4 -4
- package/dist/src/commands/aws/rolesanywhere/bootstrap/register.js +0 -2
- package/dist/src/commands/aws/rolesanywhere/rebootstrap/rebootstrap.js +4 -4
- package/dist/src/commands/aws/rolesanywhere/rebootstrap/register.js +0 -2
- package/dist/src/commands/aws/rolesanywhere/rotate/register.js +0 -2
- package/dist/src/commands/aws/rolesanywhere/rotate/rotate.js +4 -4
- package/dist/src/commands/aws/rolesanywhere/update-role/register.js +0 -3
- package/dist/src/commands/aws/rolesanywhere/update-role/update-role.js +3 -3
- package/dist/src/commands/bootstrap/register.js +4 -9
- package/dist/src/commands/dispatch/logs/logs.js +4 -4
- package/dist/src/commands/dispatch/logs/register.js +0 -2
- package/dist/src/commands/dispatch/runs/register.js +0 -2
- package/dist/src/commands/dispatch/runs/runs.js +2 -2
- package/dist/src/commands/github/secrets/backup/backup.js +4 -4
- package/dist/src/commands/github/secrets/backup/register.js +0 -2
- package/dist/src/commands/github/secrets/restore/register.js +0 -2
- package/dist/src/commands/github/secrets/restore/restore.js +2 -2
- package/dist/src/context/env.js +0 -11
- package/dist/src/context/hubIntent.js +3 -3
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { getEnv } from "../../../context/env.js";
|
|
2
|
+
import { resolveHubIntent } from "../../../context/hubIntent.js";
|
|
3
3
|
import { dispatchIntentAndWait } from "../../../core/dispatch.js";
|
|
4
4
|
import { policy } from "./policy.js";
|
|
5
5
|
/**
|
|
@@ -14,8 +14,8 @@ import { policy } from "./policy.js";
|
|
|
14
14
|
*/
|
|
15
15
|
export async function bootstrapAgeCommand(options) {
|
|
16
16
|
// 1) Resolve environment
|
|
17
|
-
const env =
|
|
18
|
-
const intent =
|
|
17
|
+
const env = getEnv();
|
|
18
|
+
const intent = resolveHubIntent();
|
|
19
19
|
// Resolve allowed teams
|
|
20
20
|
// - Dispatch mode: restrict by targetEnv
|
|
21
21
|
// - Status mode: allow union of all env teams (read-only query)
|
|
@@ -10,8 +10,6 @@ export function registerAgeBootstrapCommand(program) {
|
|
|
10
10
|
.description("Age (encryption) related commands")
|
|
11
11
|
.command("bootstrap")
|
|
12
12
|
.description("Bootstrap MASTER HUB age keypair")
|
|
13
|
-
.option("--prod", "Use production environment")
|
|
14
|
-
.option("--dev", "Use development environment")
|
|
15
13
|
.action(async (_opts, command) => {
|
|
16
14
|
const fullOpts = getResolvedOptions(command);
|
|
17
15
|
await bootstrapAgeCommand(fullOpts);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { getEnv } from "../../../../context/env.js";
|
|
2
|
+
import { resolveHubIntent } from "../../../../context/hubIntent.js";
|
|
3
3
|
import { dispatchIntentAndWait } from "../../../../core/dispatch.js";
|
|
4
4
|
import { policy } from "./policy.js";
|
|
5
5
|
/**
|
|
@@ -13,8 +13,8 @@ import { policy } from "./policy.js";
|
|
|
13
13
|
*/
|
|
14
14
|
export async function bootstrapAwsRolesAnywhereCommand(options) {
|
|
15
15
|
// 1) Resolve environment
|
|
16
|
-
const env =
|
|
17
|
-
const intent =
|
|
16
|
+
const env = getEnv();
|
|
17
|
+
const intent = resolveHubIntent();
|
|
18
18
|
// 2) Resolve allowed teams (no status mode for bootstrap)
|
|
19
19
|
const allowedTeams = Array.from(policy.byEnv[env]);
|
|
20
20
|
// 3) Dispatch intent (freeze)
|
|
@@ -4,8 +4,6 @@ export function registerAwsRolesAnywhereBootstrap(program) {
|
|
|
4
4
|
program
|
|
5
5
|
.command("bootstrap")
|
|
6
6
|
.description("Bootstrap AWS RolesAnywhere infrastructure")
|
|
7
|
-
.option("--prod", "Use production environment")
|
|
8
|
-
.option("--dev", "Use development environment")
|
|
9
7
|
.action(async (_opts, command) => {
|
|
10
8
|
const fullOpts = getResolvedOptions(command);
|
|
11
9
|
await bootstrapAwsRolesAnywhereCommand(fullOpts);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { getEnv } from "../../../../context/env.js";
|
|
2
|
+
import { resolveHubIntent } from "../../../../context/hubIntent.js";
|
|
3
3
|
import { dispatchIntentAndWait } from "../../../../core/dispatch.js";
|
|
4
4
|
import { policy } from "./policy.js";
|
|
5
5
|
/**
|
|
@@ -13,8 +13,8 @@ import { policy } from "./policy.js";
|
|
|
13
13
|
*/
|
|
14
14
|
export async function rebootstrapAwsRolesAnywhereCommand(options) {
|
|
15
15
|
// 1) Resolve environment
|
|
16
|
-
const env =
|
|
17
|
-
const intent =
|
|
16
|
+
const env = getEnv();
|
|
17
|
+
const intent = resolveHubIntent();
|
|
18
18
|
// 2) Resolve allowed teams (no status mode for bootstrap)
|
|
19
19
|
const allowedTeams = Array.from(policy.byEnv[env]);
|
|
20
20
|
// 3) Dispatch intent (freeze)
|
|
@@ -4,8 +4,6 @@ export function registerAwsRolesAnywhereRebootstrap(program) {
|
|
|
4
4
|
program
|
|
5
5
|
.command("rebootstrap")
|
|
6
6
|
.description("Re-bootstrap AWS RolesAnywhere infrastructure")
|
|
7
|
-
.option("--prod", "Use production environment")
|
|
8
|
-
.option("--dev", "Use development environment")
|
|
9
7
|
.action(async (_opts, command) => {
|
|
10
8
|
const fullOpts = getResolvedOptions(command);
|
|
11
9
|
await rebootstrapAwsRolesAnywhereCommand(fullOpts);
|
|
@@ -4,8 +4,6 @@ export function registerAwsRolesAnywhereRotate(program) {
|
|
|
4
4
|
program
|
|
5
5
|
.command("rotate")
|
|
6
6
|
.description("Rotate AWS RolesAnywhere certificates")
|
|
7
|
-
.option("--prod", "Use production environment")
|
|
8
|
-
.option("--dev", "Use development environment")
|
|
9
7
|
.action(async (_opts, command) => {
|
|
10
8
|
const fullOpts = getResolvedOptions(command);
|
|
11
9
|
await rotateAwsRolesAnywhereCommand(fullOpts);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { getEnv } from "../../../../context/env.js";
|
|
2
|
+
import { resolveHubIntent } from "../../../../context/hubIntent.js";
|
|
3
3
|
import { dispatchIntentAndWait } from "../../../../core/dispatch.js";
|
|
4
4
|
import { policy } from "./policy.js";
|
|
5
5
|
/**
|
|
@@ -13,8 +13,8 @@ import { policy } from "./policy.js";
|
|
|
13
13
|
*/
|
|
14
14
|
export async function rotateAwsRolesAnywhereCommand(options) {
|
|
15
15
|
// 1) Resolve environment
|
|
16
|
-
const env =
|
|
17
|
-
const intent =
|
|
16
|
+
const env = getEnv();
|
|
17
|
+
const intent = resolveHubIntent();
|
|
18
18
|
// 2) Resolve allowed teams (no status mode for rotate)
|
|
19
19
|
const allowedTeams = Array.from(policy.byEnv[env]);
|
|
20
20
|
// 3) Dispatch intent (freeze)
|
|
@@ -4,9 +4,6 @@ export function registerAwsRolesAnywhereUpdateRole(program) {
|
|
|
4
4
|
program
|
|
5
5
|
.command("update-role")
|
|
6
6
|
.description("Update AWS RolesAnywhere IAM role policies")
|
|
7
|
-
.option("--prod", "Use production environment")
|
|
8
|
-
.option("--dev", "Use development environment")
|
|
9
|
-
.option("--runner <type>", "Execution runner (hub | deployer | builder)", "hub")
|
|
10
7
|
.action(async (_opts, command) => {
|
|
11
8
|
const fullOpts = getResolvedOptions(command);
|
|
12
9
|
await updateAwsRolesAnywhereRoleCommand(fullOpts);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getEnv } from "../../../../context/env.js";
|
|
2
2
|
import { resolveHubIntent } from "../../../../context/hubIntent.js";
|
|
3
3
|
import { dispatchIntentAndWait } from "../../../../core/dispatch.js";
|
|
4
4
|
import { policy } from "./policy.js";
|
|
@@ -13,8 +13,8 @@ import { policy } from "./policy.js";
|
|
|
13
13
|
*/
|
|
14
14
|
export async function updateAwsRolesAnywhereRoleCommand(options) {
|
|
15
15
|
// 1) Resolve environment
|
|
16
|
-
const env =
|
|
17
|
-
const intent = resolveHubIntent(
|
|
16
|
+
const env = getEnv();
|
|
17
|
+
const intent = resolveHubIntent();
|
|
18
18
|
// 2) Resolve allowed teams (no status mode for rotate)
|
|
19
19
|
const allowedTeams = Array.from(policy.byEnv[env]);
|
|
20
20
|
// 3) Dispatch intent (freeze)
|
|
@@ -1,20 +1,15 @@
|
|
|
1
1
|
import { vizaBootstrapCommand } from "./index.js";
|
|
2
|
+
import { getEnv } from "../../context/env.js";
|
|
2
3
|
/**
|
|
3
4
|
* Register `viza bootstrap` commands
|
|
4
5
|
*/
|
|
5
6
|
export function registerBootstrapCommand(program) {
|
|
6
7
|
const cmd = program
|
|
7
8
|
.command("bootstrap")
|
|
8
|
-
.description("Bootstrap infrastructure or system components")
|
|
9
|
-
.option("--prod", "Use production environment")
|
|
10
|
-
.option("--dev", "Use development environment");
|
|
9
|
+
.description("Bootstrap infrastructure or system components");
|
|
11
10
|
// Default bootstrap
|
|
12
|
-
cmd.action(async (
|
|
13
|
-
const
|
|
14
|
-
if ((prod && dev) || (!prod && !dev)) {
|
|
15
|
-
throw new Error("You must specify exactly one environment: --dev or --prod");
|
|
16
|
-
}
|
|
17
|
-
const runtimeEnv = prod ? "prod" : "dev";
|
|
11
|
+
cmd.action(async () => {
|
|
12
|
+
const runtimeEnv = getEnv();
|
|
18
13
|
await vizaBootstrapCommand(runtimeEnv);
|
|
19
14
|
});
|
|
20
15
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { getEnv } from "../../../context/env.js";
|
|
2
|
+
import { resolveHubIntent } from "../../../context/hubIntent.js";
|
|
3
3
|
import { dispatchIntentAndWait } from "../../../core/dispatch.js";
|
|
4
4
|
import { policy } from "./policy.js";
|
|
5
5
|
/**
|
|
@@ -12,8 +12,8 @@ import { policy } from "./policy.js";
|
|
|
12
12
|
*/
|
|
13
13
|
export async function logsCommand(runId, options) {
|
|
14
14
|
// 1️⃣ Resolve environment
|
|
15
|
-
const env =
|
|
16
|
-
const intent =
|
|
15
|
+
const env = getEnv();
|
|
16
|
+
const intent = resolveHubIntent();
|
|
17
17
|
// Resolve allowed teams (same contract as other commands)
|
|
18
18
|
const allowedTeams = Array.from(policy.byEnv[env]);
|
|
19
19
|
// 2️⃣ Handle --app locally (do NOT dispatch)
|
|
@@ -8,8 +8,6 @@ export function registerDispatchLogsCommand(program) {
|
|
|
8
8
|
program
|
|
9
9
|
.command("logs <runId>")
|
|
10
10
|
.description("Download logs for a dispatch workflow run")
|
|
11
|
-
.option("--prod", "Use production environment")
|
|
12
|
-
.option("--dev", "Use development environment")
|
|
13
11
|
.option("--app", "Open GitHub Actions page for app pipelines instead of querying hub")
|
|
14
12
|
.action(async (runId, opts, command) => {
|
|
15
13
|
const fullOpts = getResolvedOptions(command);
|
|
@@ -8,8 +8,6 @@ export function registerDispatchRunsCommand(program) {
|
|
|
8
8
|
program
|
|
9
9
|
.command("runs")
|
|
10
10
|
.description("List latest dispatch workflow runs")
|
|
11
|
-
.option("--prod", "Use production environment")
|
|
12
|
-
.option("--dev", "Use development environment")
|
|
13
11
|
.option("--app", "Open GitHub Actions page for app pipelines instead of querying hub")
|
|
14
12
|
.option("--limit <n>", "Limit number of runs to fetch", "20")
|
|
15
13
|
.action(async (opts, command) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getEnv } from "../../../context/env.js";
|
|
2
2
|
import { RUNTIME_HUB_INTENT } from "../../../context/hubIntent.js";
|
|
3
3
|
import { dispatchIntentAndWait } from "../../../core/dispatch.js";
|
|
4
4
|
import { policy } from "./policy.js";
|
|
@@ -13,7 +13,7 @@ import { showDispatchRuns } from "./show-runs.js";
|
|
|
13
13
|
*/
|
|
14
14
|
export async function runsCommand(options) {
|
|
15
15
|
// 1️⃣ Resolve environment
|
|
16
|
-
const env =
|
|
16
|
+
const env = getEnv();
|
|
17
17
|
const intent = RUNTIME_HUB_INTENT;
|
|
18
18
|
// Resolve allowed teams (same contract as other commands)
|
|
19
19
|
const allowedTeams = Array.from(policy.byEnv[env]);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { getEnv } from "../../../../context/env.js";
|
|
2
|
+
import { resolveHubIntent } from "../../../../context/hubIntent.js";
|
|
3
3
|
import { dispatchIntentAndWait } from "../../../../core/dispatch.js";
|
|
4
4
|
import { policy } from "./policy.js";
|
|
5
5
|
/**
|
|
@@ -14,8 +14,8 @@ import { policy } from "./policy.js";
|
|
|
14
14
|
*/
|
|
15
15
|
export async function backupGithubSecretsCommand(options) {
|
|
16
16
|
// 1) Resolve environment
|
|
17
|
-
const env =
|
|
18
|
-
const intent =
|
|
17
|
+
const env = getEnv();
|
|
18
|
+
const intent = resolveHubIntent();
|
|
19
19
|
// Resolve allowed teams
|
|
20
20
|
// - Dispatch mode: restrict by targetEnv
|
|
21
21
|
// - Status mode: allow union of all env teams (read-only query)
|
|
@@ -8,8 +8,6 @@ export function registerGithubSecretsBackupCommand(program) {
|
|
|
8
8
|
program
|
|
9
9
|
.command("backup")
|
|
10
10
|
.description("Backup GitHub secrets and environment variables to AWS SSM")
|
|
11
|
-
.option("--prod", "Use production environment")
|
|
12
|
-
.option("--dev", "Use development environment")
|
|
13
11
|
.action(async (_opts, command) => {
|
|
14
12
|
const fullOpts = getResolvedOptions(command);
|
|
15
13
|
await backupGithubSecretsCommand(fullOpts);
|
|
@@ -8,8 +8,6 @@ export function registerGithubSecretsRestoreCommand(program) {
|
|
|
8
8
|
program
|
|
9
9
|
.command("restore")
|
|
10
10
|
.description("Restore GitHub secrets and environment variables to AWS SSM")
|
|
11
|
-
.option("--prod", "Use production environment")
|
|
12
|
-
.option("--dev", "Use development environment")
|
|
13
11
|
.option("--core", "Restore configuration for Modo-Core/core-actions")
|
|
14
12
|
.option("--infra", "Restore configuration for Modo-Infra hub repositories")
|
|
15
13
|
.option("--builder", "Restore configuration for build/publish app repositories")
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getEnv } from "../../../../context/env.js";
|
|
2
2
|
import { RUNTIME_HUB_INTENT } from "../../../../context/hubIntent.js";
|
|
3
3
|
import { dispatchIntentAndWait } from "../../../../core/dispatch.js";
|
|
4
4
|
import { policy } from "./policy.js";
|
|
@@ -14,7 +14,7 @@ import { policy } from "./policy.js";
|
|
|
14
14
|
*/
|
|
15
15
|
export async function restoreGithubSecretsCommand(options) {
|
|
16
16
|
// 1) Resolve environment
|
|
17
|
-
const env =
|
|
17
|
+
const env = getEnv();
|
|
18
18
|
const intent = RUNTIME_HUB_INTENT;
|
|
19
19
|
// Resolve allowed teams
|
|
20
20
|
// - Dispatch mode: restrict by targetEnv
|
package/dist/src/context/env.js
CHANGED
|
@@ -5,14 +5,3 @@ export function setEnv(env) {
|
|
|
5
5
|
export function getEnv() {
|
|
6
6
|
return currentEnv;
|
|
7
7
|
}
|
|
8
|
-
// Optional helper if some legacy code still uses flags
|
|
9
|
-
export function resolveEnv(flags, defaultEnv = "dev") {
|
|
10
|
-
if (flags.prod && flags.dev) {
|
|
11
|
-
throw new Error("Conflicting flags: --prod and --dev cannot be used together");
|
|
12
|
-
}
|
|
13
|
-
if (flags.prod)
|
|
14
|
-
return "prod";
|
|
15
|
-
if (flags.dev)
|
|
16
|
-
return "dev";
|
|
17
|
-
return defaultEnv;
|
|
18
|
-
}
|
|
@@ -9,15 +9,15 @@ export function getRunner() {
|
|
|
9
9
|
/**
|
|
10
10
|
* Deploy infrastructure resources (hub layer)
|
|
11
11
|
*/
|
|
12
|
-
|
|
12
|
+
const RESOURCE_HUB_INTENT_BY_ENV = "hub";
|
|
13
13
|
/**
|
|
14
14
|
* Deploy infrastructure resources (deployer reserved layer)
|
|
15
15
|
*/
|
|
16
|
-
|
|
16
|
+
const RESOURCE_DEPLOYER_INTENT_BY_ENV = "deployer";
|
|
17
17
|
/**
|
|
18
18
|
* Build & publish application layer
|
|
19
19
|
*/
|
|
20
|
-
|
|
20
|
+
const RESOURCE_BACKER_INTENT_BY_ENV = "builder";
|
|
21
21
|
/**
|
|
22
22
|
* Runtime command hub (worker layer)
|
|
23
23
|
* Single intent for both dev and prod (env derived at gateway)
|