@vizamodo/viza-cli 1.5.17 → 1.5.22
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.
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { resolveEnv } from "../../../../context/env.js";
|
|
2
|
+
import { resolveHubIntent } from "../../../../context/hubIntent.js";
|
|
3
|
+
import { dispatchIntentAndWait } from "../../../../core/dispatch.js";
|
|
4
|
+
/**
|
|
5
|
+
* Target teams for `viza aws rolesanywhere enable-profiles`.
|
|
6
|
+
* CLI-only fail-fast UX constraint.
|
|
7
|
+
* NOT a policy and MUST NOT be sent to gateway.
|
|
8
|
+
*/
|
|
9
|
+
const TARGET_TEAMS = {
|
|
10
|
+
dev: ["viza-super"],
|
|
11
|
+
prod: ["viza-super"],
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* viza aws rolesanywhere enable-profiles
|
|
15
|
+
*
|
|
16
|
+
* Flow:
|
|
17
|
+
* 1) Resolve env
|
|
18
|
+
* 2) Resolve hub intent
|
|
19
|
+
* 3) Derive allowed teams (CLI UX only)
|
|
20
|
+
* 4) Dispatch frozen intent
|
|
21
|
+
*/
|
|
22
|
+
export async function enableProfilesAwsRolesAnywhereCommand(options) {
|
|
23
|
+
// 1) Resolve environment
|
|
24
|
+
const env = resolveEnv(options);
|
|
25
|
+
const intent = resolveHubIntent(env);
|
|
26
|
+
// 2) Resolve allowed teams (no status mode for enable-profiles)
|
|
27
|
+
const allowedTeams = TARGET_TEAMS[env];
|
|
28
|
+
// 3) Dispatch intent (freeze)
|
|
29
|
+
await dispatchIntentAndWait({
|
|
30
|
+
intent,
|
|
31
|
+
commandType: "aws.rolesanywhere.enable-profiles",
|
|
32
|
+
infraKey: "aws",
|
|
33
|
+
targetEnv: env,
|
|
34
|
+
allowedTeams,
|
|
35
|
+
// Canonical CLI contract (explicit, non-magical)
|
|
36
|
+
selfHosted: options.selfHosted === true,
|
|
37
|
+
keepLog: options.removeLog !== true,
|
|
38
|
+
flowGates: {
|
|
39
|
+
secrets: false,
|
|
40
|
+
},
|
|
41
|
+
payload: {}
|
|
42
|
+
}, {
|
|
43
|
+
status: options.status === true,
|
|
44
|
+
log: "show",
|
|
45
|
+
});
|
|
46
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { enableProfilesAwsRolesAnywhereCommand } from "./enable-profiles.js";
|
|
2
|
+
import { getResolvedOptions } from "../../../../cli/resolveOptions.js";
|
|
3
|
+
export function registerAwsRolesAnywhereEnableProfiles(program) {
|
|
4
|
+
program
|
|
5
|
+
.command("enable-profiles")
|
|
6
|
+
.description("Enable AWS RolesAnywhere profiles")
|
|
7
|
+
.option("--prod", "Use production environment")
|
|
8
|
+
.option("--dev", "Use development environment")
|
|
9
|
+
.action(async (_opts, command) => {
|
|
10
|
+
const fullOpts = getResolvedOptions(command);
|
|
11
|
+
await enableProfilesAwsRolesAnywhereCommand(fullOpts);
|
|
12
|
+
});
|
|
13
|
+
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { registerAwsRolesAnywhereBootstrap } from "./bootstrap/register.js";
|
|
2
|
+
import { registerAwsRolesAnywhereEnableProfiles } from "./enable-profiles/register.js";
|
|
2
3
|
export function registerAwsRolesAnywhereCommand(program) {
|
|
3
4
|
const aws = program.command("aws").description("AWS related commands");
|
|
4
5
|
const rolesanywhere = aws
|
|
5
6
|
.command("rolesanywhere")
|
|
6
7
|
.description("AWS RolesAnywhere operations");
|
|
7
8
|
registerAwsRolesAnywhereBootstrap(rolesanywhere);
|
|
9
|
+
registerAwsRolesAnywhereEnableProfiles(rolesanywhere);
|
|
8
10
|
// registerAwsRolesAnywhereRotate(rolesanywhere);
|
|
9
11
|
// registerAwsRolesAnywhereRollback(rolesanywhere);
|
|
10
12
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vizamodo/viza-cli",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.22",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Viza unified command line interface",
|
|
6
6
|
"bin": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@types/adm-zip": "^0.5.7",
|
|
30
30
|
"@types/figlet": "^1.7.0",
|
|
31
|
-
"@types/node": "^25.2.
|
|
31
|
+
"@types/node": "^25.2.3",
|
|
32
32
|
"@types/prompts": "^2.4.9",
|
|
33
33
|
"ts-node": "^10.9.2",
|
|
34
34
|
"typescript": "^5.9.3"
|