opal-security 3.1.0 → 3.1.1-beta.01fe2fd
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/README.md +142 -28
- package/lib/commands/login.js +6 -2
- package/lib/commands/request/create.d.ts +6 -1
- package/lib/commands/request/create.js +63 -19
- package/lib/commands/request/get.d.ts +7 -2
- package/lib/commands/request/get.js +105 -7
- package/lib/commands/request/list.d.ts +8 -2
- package/lib/commands/request/list.js +112 -8
- package/lib/commands/whoami.d.ts +8 -0
- package/lib/commands/whoami.js +34 -0
- package/lib/graphql/gql.d.ts +42 -2
- package/lib/graphql/gql.js +9 -1
- package/lib/graphql/graphql.d.ts +444 -117
- package/lib/graphql/graphql.js +2173 -173
- package/lib/lib/apollo.js +3 -4
- package/lib/lib/credentials/index.d.ts +2 -1
- package/lib/lib/credentials/index.js +2 -1
- package/lib/lib/flags.js +1 -1
- package/lib/lib/requests.d.ts +46 -14
- package/lib/lib/requests.js +1002 -120
- package/lib/utils/displays.d.ts +8 -3
- package/lib/utils/displays.js +204 -45
- package/oclif.manifest.json +138 -17
- package/package.json +7 -5
package/lib/utils/displays.d.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
import type { ApolloQueryResult } from "@apollo/client";
|
|
1
2
|
import type { Command } from "@oclif/core/lib/command";
|
|
2
|
-
import type {
|
|
3
|
+
import type { GetRequestQuery, GetRequestsQuery } from "../graphql/graphql";
|
|
4
|
+
import { type RequestMap, type RequestMetadata } from "../lib/requests";
|
|
3
5
|
export declare function headerMessage(cmd: Command): void;
|
|
4
|
-
export declare function treeifyRequestMap(requestMap: RequestMap):
|
|
5
|
-
export declare function displayFinalRequestSummary(cmd: Command,
|
|
6
|
+
export declare function treeifyRequestMap(cmd: Command, requestMap: RequestMap): void;
|
|
7
|
+
export declare function displayFinalRequestSummary(cmd: Command, metadata: RequestMetadata): void;
|
|
8
|
+
export declare function getStyledStatus(status: string): string;
|
|
9
|
+
export declare function displayRequestDetails(cmd: Command, requestResp: ApolloQueryResult<GetRequestQuery>): void;
|
|
10
|
+
export declare function displayRequestListTable(cmd: Command, requestResp: ApolloQueryResult<GetRequestsQuery>): void;
|
package/lib/utils/displays.js
CHANGED
|
@@ -3,63 +3,222 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.headerMessage = headerMessage;
|
|
4
4
|
exports.treeifyRequestMap = treeifyRequestMap;
|
|
5
5
|
exports.displayFinalRequestSummary = displayFinalRequestSummary;
|
|
6
|
-
|
|
6
|
+
exports.getStyledStatus = getStyledStatus;
|
|
7
|
+
exports.displayRequestDetails = displayRequestDetails;
|
|
8
|
+
exports.displayRequestListTable = displayRequestListTable;
|
|
9
|
+
const chalk_1 = require("chalk");
|
|
10
|
+
const terminal_link_1 = require("terminal-link");
|
|
11
|
+
const requests_1 = require("../lib/requests");
|
|
7
12
|
const Table = require("cli-table3");
|
|
8
|
-
const
|
|
9
|
-
top: "═",
|
|
10
|
-
"top-mid": "╤",
|
|
11
|
-
"top-left": "╔",
|
|
12
|
-
"top-right": "╗",
|
|
13
|
-
bottom: "═",
|
|
14
|
-
"bottom-mid": "╧",
|
|
15
|
-
"bottom-left": "╚",
|
|
16
|
-
"bottom-right": "╝",
|
|
17
|
-
left: "║",
|
|
18
|
-
"left-mid": "╟",
|
|
19
|
-
mid: "─",
|
|
20
|
-
"mid-mid": "┼",
|
|
21
|
-
right: "║",
|
|
22
|
-
"right-mid": "╢",
|
|
23
|
-
middle: "│",
|
|
24
|
-
};
|
|
13
|
+
const treeify = require("object-treeify").default;
|
|
25
14
|
function headerMessage(cmd) {
|
|
26
15
|
console.clear();
|
|
27
|
-
cmd.log("
|
|
16
|
+
cmd.log("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━");
|
|
28
17
|
cmd.log("Opal Access Request ✏️");
|
|
29
18
|
cmd.log("Press Ctrl+C to cancel at any time.\n");
|
|
30
19
|
}
|
|
31
|
-
function treeifyRequestMap(requestMap) {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
20
|
+
function treeifyRequestMap(cmd, requestMap) {
|
|
21
|
+
// Configuration options for treeify
|
|
22
|
+
const options = {
|
|
23
|
+
joined: true,
|
|
24
|
+
spacerNoNeighbour: " ",
|
|
25
|
+
spacerNeighbour: "│ ",
|
|
26
|
+
keyNoNeighbour: "└── ",
|
|
27
|
+
keyNeighbour: "├── ",
|
|
28
|
+
separator: "",
|
|
29
|
+
};
|
|
30
|
+
for (const [_appId, appNode] of Object.entries(requestMap)) {
|
|
31
|
+
const assetsTree = {};
|
|
32
|
+
for (const [_assetId, assetNode] of Object.entries(appNode.assets)) {
|
|
33
|
+
// If okta/azure asset with no role, change asset name
|
|
34
|
+
const assetName = assetNode.assetName || "No Role (Direct access)";
|
|
35
|
+
const assetKey = `${assetName} ${chalk_1.default.dim(`[${requests_1.DISPLAY_LABELS[assetNode.type]}]`)}`;
|
|
41
36
|
if (assetNode.roles !== undefined) {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
37
|
+
assetsTree[assetKey] = {};
|
|
38
|
+
for (const [_roleId, roleNode] of Object.entries(assetNode.roles)) {
|
|
39
|
+
const roleName = roleNode.roleName;
|
|
40
|
+
if (roleName !== "") {
|
|
41
|
+
const roleKey = `${roleName} ${chalk_1.default.dim("[Role]")}`;
|
|
42
|
+
assetsTree[assetKey][roleKey] = null;
|
|
43
|
+
}
|
|
47
44
|
}
|
|
48
45
|
}
|
|
49
46
|
else {
|
|
50
|
-
|
|
47
|
+
assetsTree[assetKey] = null;
|
|
51
48
|
}
|
|
52
49
|
}
|
|
50
|
+
// Render tree for this app's assets
|
|
51
|
+
const assetsTreeString = treeify(assetsTree, options);
|
|
52
|
+
// Print App title first (without tree lines)
|
|
53
|
+
cmd.log(`${chalk_1.default.bold(appNode.appName)} ${chalk_1.default.dim("[App]")}`);
|
|
54
|
+
// Print its assets/roles indented underneath
|
|
55
|
+
cmd.log(assetsTreeString);
|
|
53
56
|
}
|
|
54
|
-
|
|
57
|
+
cmd.log();
|
|
55
58
|
}
|
|
56
|
-
function displayFinalRequestSummary(cmd,
|
|
57
|
-
|
|
58
|
-
cmd.log("
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
cmd.log(
|
|
59
|
+
function displayFinalRequestSummary(cmd, metadata) {
|
|
60
|
+
console.clear();
|
|
61
|
+
cmd.log("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━");
|
|
62
|
+
cmd.log("Final Summary of Request ✏️");
|
|
63
|
+
cmd.log("Press Ctrl+C to cancel at any time.\n");
|
|
64
|
+
cmd.log();
|
|
65
|
+
treeifyRequestMap(cmd, metadata.requestMap);
|
|
66
|
+
const durationInMinutes = metadata.durationInMinutes;
|
|
67
|
+
cmd.log(`Duration: ${durationInMinutes ? formatDuration(durationInMinutes) : "Permanent"}`);
|
|
68
|
+
const reason = metadata.reason;
|
|
69
|
+
if (reason) {
|
|
70
|
+
cmd.log(`Reason: "${chalk_1.default.italic(reason)}"`);
|
|
71
|
+
}
|
|
72
|
+
cmd.log();
|
|
73
|
+
}
|
|
74
|
+
function getStyledStatus(status) {
|
|
75
|
+
switch (status) {
|
|
76
|
+
case "PENDING": {
|
|
77
|
+
return `${chalk_1.default.bold("Status:")} ${chalk_1.default.blueBright(status)}`;
|
|
78
|
+
}
|
|
79
|
+
case "APPROVED": {
|
|
80
|
+
return `${chalk_1.default.bold("Status:")} ${chalk_1.default.greenBright(status)}`;
|
|
81
|
+
}
|
|
82
|
+
case "DENIED": {
|
|
83
|
+
return `${chalk_1.default.bold("Status:")} ${chalk_1.default.redBright(status)}`;
|
|
84
|
+
}
|
|
85
|
+
case "CANCELED": {
|
|
86
|
+
return `${chalk_1.default.bold("Status:")} ${chalk_1.default.redBright(status)}`;
|
|
87
|
+
}
|
|
88
|
+
default: {
|
|
89
|
+
return `${chalk_1.default.bold("Status:")} ${chalk_1.default.gray(status)}`;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
function displayRequestDetails(cmd, requestResp) {
|
|
94
|
+
var _a, _b, _c, _d, _e, _f;
|
|
95
|
+
switch (requestResp.data.request.__typename) {
|
|
96
|
+
case "RequestResult": {
|
|
97
|
+
cmd.log("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━");
|
|
98
|
+
cmd.log(`Request Details ${chalk_1.default.cyan(requestResp.data.request.request.id)}`);
|
|
99
|
+
cmd.log("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━");
|
|
100
|
+
const status = requestResp.data.request.request.status;
|
|
101
|
+
cmd.log(getStyledStatus(status));
|
|
102
|
+
// Request users "Requested by: <requester> -> Requested for: <targetUser>"
|
|
103
|
+
const requester = (_a = requestResp.data.request.request.requester) === null || _a === void 0 ? void 0 : _a.displayName;
|
|
104
|
+
const targetUser = (_b = requestResp.data.request.request.targetUser) === null || _b === void 0 ? void 0 : _b.displayName;
|
|
105
|
+
if (requester && targetUser) {
|
|
106
|
+
cmd.log(`${chalk_1.default.bold("Requested by:")} ${requester} ${chalk_1.default.gray("->")} ${chalk_1.default.bold("Requested for:")} ${targetUser}`);
|
|
107
|
+
}
|
|
108
|
+
const durationInMinutes = requestResp.data.request.request.durationInMinutes;
|
|
109
|
+
cmd.log(`${chalk_1.default.bold("Duration:")} ${durationInMinutes ? formatDuration(durationInMinutes) : "Permanent"}`);
|
|
110
|
+
const reason = requestResp.data.request.request.reason;
|
|
111
|
+
if (reason) {
|
|
112
|
+
cmd.log(`${chalk_1.default.bold("Reason:")} "${chalk_1.default.italic(reason)}"`);
|
|
113
|
+
}
|
|
114
|
+
// Requested resources
|
|
115
|
+
const requestedResources = (_d = (_c = requestResp.data.request.request.requestedResources) === null || _c === void 0 ? void 0 : _c.map((resource) => {
|
|
116
|
+
var _a, _b, _c;
|
|
117
|
+
if (((_a = resource.resource) === null || _a === void 0 ? void 0 : _a.__typename) === "Resource") {
|
|
118
|
+
return formatAssetName((_b = resource.resource) === null || _b === void 0 ? void 0 : _b.displayName, ((_c = resource.accessLevel) === null || _c === void 0 ? void 0 : _c.accessLevelName) || "");
|
|
119
|
+
}
|
|
120
|
+
})) !== null && _d !== void 0 ? _d : [];
|
|
121
|
+
const requestedGroups = (_f = (_e = requestResp.data.request.request.requestedGroups) === null || _e === void 0 ? void 0 : _e.map((group) => {
|
|
122
|
+
var _a, _b, _c;
|
|
123
|
+
if (((_a = group.group) === null || _a === void 0 ? void 0 : _a.__typename) === "Group") {
|
|
124
|
+
return formatAssetName((_b = group.group) === null || _b === void 0 ? void 0 : _b.name, ((_c = group.accessLevel) === null || _c === void 0 ? void 0 : _c.accessLevelName) || "");
|
|
125
|
+
}
|
|
126
|
+
})) !== null && _f !== void 0 ? _f : [];
|
|
127
|
+
const requestedItems = [...requestedResources, ...requestedGroups].join(", ");
|
|
128
|
+
if (requestedItems) {
|
|
129
|
+
cmd.log(`${chalk_1.default.bold("Requested Items:")} ${chalk_1.default.cyan(requestedItems)}`);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
function displayRequestListTable(cmd, requestResp) {
|
|
135
|
+
var _a, _b, _c, _d, _e;
|
|
136
|
+
switch (requestResp.data.requests.__typename) {
|
|
137
|
+
case "RequestsResult": {
|
|
138
|
+
const requests = requestResp.data.requests.requests;
|
|
139
|
+
if (requests && requests.length > 0) {
|
|
140
|
+
const table = new Table({
|
|
141
|
+
head: [
|
|
142
|
+
"Request ID",
|
|
143
|
+
"Status",
|
|
144
|
+
"For",
|
|
145
|
+
"Duration",
|
|
146
|
+
"Requested Items",
|
|
147
|
+
"Reason",
|
|
148
|
+
],
|
|
149
|
+
colWidths: [null, null, 20, null, 30, 20],
|
|
150
|
+
wordWrap: true,
|
|
151
|
+
wrapOnWordBoundary: false,
|
|
152
|
+
});
|
|
153
|
+
for (const request of requests) {
|
|
154
|
+
const targetUser = (_a = request.targetUser) === null || _a === void 0 ? void 0 : _a.displayName;
|
|
155
|
+
const reason = request.reason;
|
|
156
|
+
const status = request.status;
|
|
157
|
+
const formattedDuration = request.durationInMinutes
|
|
158
|
+
? formatDuration(request.durationInMinutes)
|
|
159
|
+
: "Permanent";
|
|
160
|
+
const requestedResources = (_c = (_b = request.requestedResources) === null || _b === void 0 ? void 0 : _b.map((resource) => {
|
|
161
|
+
var _a, _b, _c;
|
|
162
|
+
if (((_a = resource.resource) === null || _a === void 0 ? void 0 : _a.__typename) === "Resource") {
|
|
163
|
+
return formatAssetName((_b = resource.resource) === null || _b === void 0 ? void 0 : _b.displayName, ((_c = resource.accessLevel) === null || _c === void 0 ? void 0 : _c.accessLevelName) || "");
|
|
164
|
+
}
|
|
165
|
+
})) !== null && _c !== void 0 ? _c : [];
|
|
166
|
+
const requestedGroups = (_e = (_d = request.requestedGroups) === null || _d === void 0 ? void 0 : _d.map((group) => {
|
|
167
|
+
var _a, _b, _c;
|
|
168
|
+
if (((_a = group.group) === null || _a === void 0 ? void 0 : _a.__typename) === "Group") {
|
|
169
|
+
return formatAssetName((_b = group.group) === null || _b === void 0 ? void 0 : _b.name, ((_c = group.accessLevel) === null || _c === void 0 ? void 0 : _c.accessLevelName) || "");
|
|
170
|
+
}
|
|
171
|
+
})) !== null && _e !== void 0 ? _e : [];
|
|
172
|
+
const requestedItems = [
|
|
173
|
+
...requestedResources,
|
|
174
|
+
...requestedGroups,
|
|
175
|
+
].join(", ");
|
|
176
|
+
const requestLink = (0, requests_1.getRequestLink)(cmd, request.id);
|
|
177
|
+
const clickableId = (0, terminal_link_1.default)(request.id, requestLink, {
|
|
178
|
+
fallback: false,
|
|
179
|
+
});
|
|
180
|
+
table.push([
|
|
181
|
+
clickableId,
|
|
182
|
+
status,
|
|
183
|
+
targetUser,
|
|
184
|
+
formattedDuration,
|
|
185
|
+
requestedItems,
|
|
186
|
+
reason,
|
|
187
|
+
]);
|
|
188
|
+
}
|
|
189
|
+
cmd.log(table.toString());
|
|
190
|
+
}
|
|
191
|
+
else {
|
|
192
|
+
cmd.log("No requests found.");
|
|
193
|
+
}
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
default: {
|
|
197
|
+
cmd.log("No requests found.");
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
function formatDuration(durationInMinutes) {
|
|
202
|
+
const days = Math.floor(durationInMinutes / 1440);
|
|
203
|
+
const remainingMinutes = durationInMinutes % 1440;
|
|
204
|
+
const hours = Math.floor(remainingMinutes / 60);
|
|
205
|
+
const minutes = remainingMinutes % 60;
|
|
206
|
+
let durationStr = "";
|
|
207
|
+
if (days > 0)
|
|
208
|
+
durationStr += `${days}d`;
|
|
209
|
+
if (hours > 0)
|
|
210
|
+
durationStr += `${hours}h`;
|
|
211
|
+
if (minutes > 0)
|
|
212
|
+
durationStr += `${minutes}m`;
|
|
213
|
+
if (durationStr === "")
|
|
214
|
+
durationStr = `${durationInMinutes}m`;
|
|
215
|
+
durationStr += ` (${durationInMinutes}m)`;
|
|
216
|
+
return durationStr;
|
|
217
|
+
}
|
|
218
|
+
function formatAssetName(assetName, roleName) {
|
|
219
|
+
let str = `${assetName}`;
|
|
220
|
+
if (roleName) {
|
|
221
|
+
str += ` (${roleName})`;
|
|
222
|
+
}
|
|
223
|
+
return str;
|
|
65
224
|
}
|
package/oclif.manifest.json
CHANGED
|
@@ -316,6 +316,34 @@
|
|
|
316
316
|
"set-url.js"
|
|
317
317
|
]
|
|
318
318
|
},
|
|
319
|
+
"whoami": {
|
|
320
|
+
"aliases": [],
|
|
321
|
+
"args": {},
|
|
322
|
+
"description": "Describes current url set, organization name, and logged in user if applicable.",
|
|
323
|
+
"flags": {
|
|
324
|
+
"help": {
|
|
325
|
+
"char": "h",
|
|
326
|
+
"description": "Show CLI help.",
|
|
327
|
+
"name": "help",
|
|
328
|
+
"allowNo": false,
|
|
329
|
+
"type": "boolean"
|
|
330
|
+
}
|
|
331
|
+
},
|
|
332
|
+
"hasDynamicHelp": false,
|
|
333
|
+
"hiddenAliases": [],
|
|
334
|
+
"id": "whoami",
|
|
335
|
+
"pluginAlias": "opal-security",
|
|
336
|
+
"pluginName": "opal-security",
|
|
337
|
+
"pluginType": "core",
|
|
338
|
+
"strict": true,
|
|
339
|
+
"enableJsonFlag": false,
|
|
340
|
+
"isESM": false,
|
|
341
|
+
"relativePath": [
|
|
342
|
+
"lib",
|
|
343
|
+
"commands",
|
|
344
|
+
"whoami.js"
|
|
345
|
+
]
|
|
346
|
+
},
|
|
319
347
|
"aws:identity": {
|
|
320
348
|
"aliases": [],
|
|
321
349
|
"args": {},
|
|
@@ -365,7 +393,7 @@
|
|
|
365
393
|
},
|
|
366
394
|
"id": {
|
|
367
395
|
"char": "i",
|
|
368
|
-
"description": "The Opal ID of the
|
|
396
|
+
"description": "The Opal ID of the asset. You can find this from the URL, e.g. https://opal.dev/resources/[ID]",
|
|
369
397
|
"name": "id",
|
|
370
398
|
"hasDynamicHelp": false,
|
|
371
399
|
"multiple": false,
|
|
@@ -407,7 +435,7 @@
|
|
|
407
435
|
},
|
|
408
436
|
"id": {
|
|
409
437
|
"char": "i",
|
|
410
|
-
"description": "The Opal ID of the
|
|
438
|
+
"description": "The Opal ID of the asset. You can find this from the URL, e.g. https://opal.dev/resources/[ID]",
|
|
411
439
|
"name": "id",
|
|
412
440
|
"hasDynamicHelp": false,
|
|
413
441
|
"multiple": false,
|
|
@@ -471,7 +499,7 @@
|
|
|
471
499
|
},
|
|
472
500
|
"id": {
|
|
473
501
|
"char": "i",
|
|
474
|
-
"description": "The Opal ID of the
|
|
502
|
+
"description": "The Opal ID of the asset. You can find this from the URL, e.g. https://opal.dev/resources/[ID]",
|
|
475
503
|
"name": "id",
|
|
476
504
|
"hasDynamicHelp": false,
|
|
477
505
|
"multiple": false,
|
|
@@ -537,7 +565,7 @@
|
|
|
537
565
|
},
|
|
538
566
|
"id": {
|
|
539
567
|
"char": "i",
|
|
540
|
-
"description": "The Opal ID of the
|
|
568
|
+
"description": "The Opal ID of the asset. You can find this from the URL, e.g. https://opal.dev/resources/[ID]",
|
|
541
569
|
"name": "id",
|
|
542
570
|
"hasDynamicHelp": false,
|
|
543
571
|
"multiple": false,
|
|
@@ -597,10 +625,41 @@
|
|
|
597
625
|
"request:create": {
|
|
598
626
|
"aliases": [],
|
|
599
627
|
"args": {},
|
|
600
|
-
"description": "
|
|
601
|
-
"flags": {
|
|
628
|
+
"description": "Creates an Opal access request via an interactive form",
|
|
629
|
+
"flags": {
|
|
630
|
+
"help": {
|
|
631
|
+
"char": "h",
|
|
632
|
+
"description": "Show CLI help.",
|
|
633
|
+
"name": "help",
|
|
634
|
+
"allowNo": false,
|
|
635
|
+
"type": "boolean"
|
|
636
|
+
},
|
|
637
|
+
"assets": {
|
|
638
|
+
"char": "a",
|
|
639
|
+
"description": "The ids of the assets (resource, group) to request access to. Append a role ID using a colon if needed, e.g. `--assets 123:456`. \n If not provided, an interactive selection flow will be available to select assets to request.",
|
|
640
|
+
"name": "assets",
|
|
641
|
+
"hasDynamicHelp": false,
|
|
642
|
+
"multiple": true,
|
|
643
|
+
"type": "option"
|
|
644
|
+
},
|
|
645
|
+
"reason": {
|
|
646
|
+
"char": "r",
|
|
647
|
+
"description": "The reason for the request, contained in quotes. If not provided, you will be prompted.",
|
|
648
|
+
"name": "reason",
|
|
649
|
+
"hasDynamicHelp": false,
|
|
650
|
+
"multiple": false,
|
|
651
|
+
"type": "option"
|
|
652
|
+
},
|
|
653
|
+
"duration": {
|
|
654
|
+
"char": "d",
|
|
655
|
+
"description": "The duration of access for the request in minutes. If not provided, you will be prompted.",
|
|
656
|
+
"name": "duration",
|
|
657
|
+
"hasDynamicHelp": false,
|
|
658
|
+
"multiple": false,
|
|
659
|
+
"type": "option"
|
|
660
|
+
}
|
|
661
|
+
},
|
|
602
662
|
"hasDynamicHelp": false,
|
|
603
|
-
"hidden": true,
|
|
604
663
|
"hiddenAliases": [],
|
|
605
664
|
"id": "request:create",
|
|
606
665
|
"pluginAlias": "opal-security",
|
|
@@ -620,9 +679,35 @@
|
|
|
620
679
|
"aliases": [],
|
|
621
680
|
"args": {},
|
|
622
681
|
"description": "Lists access requests",
|
|
623
|
-
"
|
|
682
|
+
"examples": [
|
|
683
|
+
"opal request get --id 54052a3e-5375-4392-aeaf-0c6c44c131d4",
|
|
684
|
+
"opal request get --id 54052a3e-5375-4392-aeaf-0c6c44c131d4 --verbose"
|
|
685
|
+
],
|
|
686
|
+
"flags": {
|
|
687
|
+
"help": {
|
|
688
|
+
"char": "h",
|
|
689
|
+
"description": "Show CLI help.",
|
|
690
|
+
"name": "help",
|
|
691
|
+
"allowNo": false,
|
|
692
|
+
"type": "boolean"
|
|
693
|
+
},
|
|
694
|
+
"id": {
|
|
695
|
+
"char": "i",
|
|
696
|
+
"description": "The Opal ID of the asset. You can find this from the URL, e.g. https://opal.dev/resources/[ID]",
|
|
697
|
+
"name": "id",
|
|
698
|
+
"hasDynamicHelp": false,
|
|
699
|
+
"multiple": false,
|
|
700
|
+
"type": "option"
|
|
701
|
+
},
|
|
702
|
+
"verbose": {
|
|
703
|
+
"char": "v",
|
|
704
|
+
"description": "Enable verbose output, prints full response in JSON format. Defaults to false.",
|
|
705
|
+
"name": "verbose",
|
|
706
|
+
"allowNo": false,
|
|
707
|
+
"type": "boolean"
|
|
708
|
+
}
|
|
709
|
+
},
|
|
624
710
|
"hasDynamicHelp": false,
|
|
625
|
-
"hidden": true,
|
|
626
711
|
"hiddenAliases": [],
|
|
627
712
|
"id": "request:get",
|
|
628
713
|
"pluginAlias": "opal-security",
|
|
@@ -643,10 +728,46 @@
|
|
|
643
728
|
"request:ls"
|
|
644
729
|
],
|
|
645
730
|
"args": {},
|
|
646
|
-
"description": "Lists access requests",
|
|
647
|
-
"
|
|
731
|
+
"description": "Lists your n recent outgoing access requests",
|
|
732
|
+
"examples": [
|
|
733
|
+
"opal request list --n 5",
|
|
734
|
+
"opal request list --n 5 --pending",
|
|
735
|
+
"opal request list --n 5 --verbose",
|
|
736
|
+
"opal request list --n 5 --pending --verbose"
|
|
737
|
+
],
|
|
738
|
+
"flags": {
|
|
739
|
+
"help": {
|
|
740
|
+
"char": "h",
|
|
741
|
+
"description": "Show CLI help.",
|
|
742
|
+
"name": "help",
|
|
743
|
+
"allowNo": false,
|
|
744
|
+
"type": "boolean"
|
|
745
|
+
},
|
|
746
|
+
"n": {
|
|
747
|
+
"char": "n",
|
|
748
|
+
"description": "Defines number of requests to be returned. 1 <= n <= 100.",
|
|
749
|
+
"name": "n",
|
|
750
|
+
"default": 10,
|
|
751
|
+
"hasDynamicHelp": false,
|
|
752
|
+
"multiple": false,
|
|
753
|
+
"type": "option"
|
|
754
|
+
},
|
|
755
|
+
"pending": {
|
|
756
|
+
"char": "p",
|
|
757
|
+
"description": "Show only pending requests. Defaults to false.",
|
|
758
|
+
"name": "pending",
|
|
759
|
+
"allowNo": false,
|
|
760
|
+
"type": "boolean"
|
|
761
|
+
},
|
|
762
|
+
"verbose": {
|
|
763
|
+
"char": "v",
|
|
764
|
+
"description": "Enable verbose output, prints full response in JSON format. Defaults to false.",
|
|
765
|
+
"name": "verbose",
|
|
766
|
+
"allowNo": false,
|
|
767
|
+
"type": "boolean"
|
|
768
|
+
}
|
|
769
|
+
},
|
|
648
770
|
"hasDynamicHelp": false,
|
|
649
|
-
"hidden": true,
|
|
650
771
|
"hiddenAliases": [],
|
|
651
772
|
"id": "request:list",
|
|
652
773
|
"pluginAlias": "opal-security",
|
|
@@ -679,7 +800,7 @@
|
|
|
679
800
|
},
|
|
680
801
|
"id": {
|
|
681
802
|
"char": "i",
|
|
682
|
-
"description": "The Opal ID of the
|
|
803
|
+
"description": "The Opal ID of the asset. You can find this from the URL, e.g. https://opal.dev/resources/[ID]",
|
|
683
804
|
"name": "id",
|
|
684
805
|
"hasDynamicHelp": false,
|
|
685
806
|
"multiple": false,
|
|
@@ -746,7 +867,7 @@
|
|
|
746
867
|
},
|
|
747
868
|
"id": {
|
|
748
869
|
"char": "i",
|
|
749
|
-
"description": "The Opal ID of the
|
|
870
|
+
"description": "The Opal ID of the asset. You can find this from the URL, e.g. https://opal.dev/resources/[ID]",
|
|
750
871
|
"name": "id",
|
|
751
872
|
"hasDynamicHelp": false,
|
|
752
873
|
"multiple": false,
|
|
@@ -821,7 +942,7 @@
|
|
|
821
942
|
},
|
|
822
943
|
"id": {
|
|
823
944
|
"char": "i",
|
|
824
|
-
"description": "The Opal ID of the
|
|
945
|
+
"description": "The Opal ID of the asset. You can find this from the URL, e.g. https://opal.dev/resources/[ID]",
|
|
825
946
|
"name": "id",
|
|
826
947
|
"hasDynamicHelp": false,
|
|
827
948
|
"multiple": false,
|
|
@@ -870,7 +991,7 @@
|
|
|
870
991
|
},
|
|
871
992
|
"id": {
|
|
872
993
|
"char": "i",
|
|
873
|
-
"description": "The Opal ID of the
|
|
994
|
+
"description": "The Opal ID of the asset. You can find this from the URL, e.g. https://opal.dev/resources/[ID]",
|
|
874
995
|
"name": "id",
|
|
875
996
|
"hasDynamicHelp": false,
|
|
876
997
|
"multiple": false,
|
|
@@ -909,5 +1030,5 @@
|
|
|
909
1030
|
]
|
|
910
1031
|
}
|
|
911
1032
|
},
|
|
912
|
-
"version": "3.1.
|
|
1033
|
+
"version": "3.1.1-beta.01fe2fd"
|
|
913
1034
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opal-security",
|
|
3
3
|
"description": "Opal allows you to centrally manage access to all of your sensitive systems.",
|
|
4
|
-
"version": "3.1.
|
|
4
|
+
"version": "3.1.1-beta.01fe2fd",
|
|
5
5
|
"author": "Stephen Cobbe",
|
|
6
6
|
"bin": {
|
|
7
7
|
"opal": "./bin/run"
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
"argon2": "^0.40.1",
|
|
17
17
|
"chalk": "^2.4.2",
|
|
18
18
|
"cli-table3": "^0.6.5",
|
|
19
|
+
"enquirer": "^2.4.1",
|
|
19
20
|
"graphql": "^15.5.0",
|
|
20
21
|
"inquirer": "^8.2.6",
|
|
21
22
|
"inquirer-autocomplete-prompt": "^2.0.1",
|
|
@@ -23,10 +24,12 @@
|
|
|
23
24
|
"lodash": "^4.17.21",
|
|
24
25
|
"moment": "^2.30.1",
|
|
25
26
|
"node-fetch": "^2.6.7",
|
|
27
|
+
"object-treeify": "^5.0.1",
|
|
26
28
|
"open": "^8.0.4",
|
|
27
29
|
"openid-client": "^5.6.5",
|
|
28
30
|
"prettyjson": "^1.2.1",
|
|
29
31
|
"semver": "^7.5.4",
|
|
32
|
+
"terminal-link": "^4.0.0",
|
|
30
33
|
"tslib": "^2.8.1"
|
|
31
34
|
},
|
|
32
35
|
"devDependencies": {
|
|
@@ -39,6 +42,7 @@
|
|
|
39
42
|
"@types/lodash": "^4.14.169",
|
|
40
43
|
"@types/node": "^22.14.0",
|
|
41
44
|
"@types/prettyjson": "0.0.29",
|
|
45
|
+
"@types/react": "^19.1.4",
|
|
42
46
|
"@types/semver": "^7.3.8",
|
|
43
47
|
"better-npm-audit": "^3.7.3",
|
|
44
48
|
"get-graphql-schema": "^2.1.2",
|
|
@@ -60,9 +64,7 @@
|
|
|
60
64
|
"/scripts"
|
|
61
65
|
],
|
|
62
66
|
"homepage": "https://github.com/opalsecurity/opal-cli/",
|
|
63
|
-
"keywords": [
|
|
64
|
-
"oclif"
|
|
65
|
-
],
|
|
67
|
+
"keywords": ["oclif"],
|
|
66
68
|
"license": "MIT",
|
|
67
69
|
"main": "lib/index.js",
|
|
68
70
|
"oclif": {
|
|
@@ -88,7 +90,7 @@
|
|
|
88
90
|
"prepack": "npm run build && oclif manifest && oclif readme",
|
|
89
91
|
"test": "vitest",
|
|
90
92
|
"coverage": "vitest run --coverage",
|
|
91
|
-
"version": "oclif readme && git add README.md",
|
|
93
|
+
"version": "oclif readme && git add README.md && biome check --write",
|
|
92
94
|
"posttest": "biome check",
|
|
93
95
|
"biome-ci": "biome ci --reporter=github",
|
|
94
96
|
"gql-codegen": "graphql-codegen",
|