@prismatic-io/prism 5.2.9 → 5.2.11
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.
|
@@ -4,33 +4,65 @@ const core_1 = require("@oclif/core");
|
|
|
4
4
|
const graphql_1 = require("../../graphql");
|
|
5
5
|
class CreateCommand extends core_1.Command {
|
|
6
6
|
async run() {
|
|
7
|
-
const { flags: { customerId, resourceId }, } = await this.parse(CreateCommand);
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
const { flags: { customerId, resourceId, rotate }, } = await this.parse(CreateCommand);
|
|
8
|
+
if (rotate) {
|
|
9
|
+
const result = await (0, graphql_1.gqlRequest)({
|
|
10
|
+
document: (0, graphql_1.gql) `
|
|
11
|
+
mutation rotateOnPremiseResourceJWT(
|
|
12
|
+
$customerId: ID
|
|
13
|
+
$resourceId: ID
|
|
13
14
|
) {
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
rotateOnPremiseResourceJWT(
|
|
16
|
+
input: { customerId: $customerId, resourceId: $resourceId }
|
|
17
|
+
) {
|
|
18
|
+
result {
|
|
19
|
+
jwt
|
|
20
|
+
}
|
|
21
|
+
errors {
|
|
22
|
+
field
|
|
23
|
+
messages
|
|
24
|
+
}
|
|
16
25
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
26
|
+
}
|
|
27
|
+
`,
|
|
28
|
+
variables: {
|
|
29
|
+
customerId,
|
|
30
|
+
resourceId,
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
this.log(result.rotateOnPremiseResourceJWT.result.jwt);
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
const result = await (0, graphql_1.gqlRequest)({
|
|
37
|
+
document: (0, graphql_1.gql) `
|
|
38
|
+
mutation createOnPremiseResourceJWT(
|
|
39
|
+
$customerId: ID
|
|
40
|
+
$resourceId: ID
|
|
41
|
+
) {
|
|
42
|
+
createOnPremiseResourceJWT(
|
|
43
|
+
input: { customerId: $customerId, resourceId: $resourceId }
|
|
44
|
+
) {
|
|
45
|
+
result {
|
|
46
|
+
jwt
|
|
47
|
+
}
|
|
48
|
+
errors {
|
|
49
|
+
field
|
|
50
|
+
messages
|
|
51
|
+
}
|
|
20
52
|
}
|
|
21
53
|
}
|
|
54
|
+
`,
|
|
55
|
+
variables: {
|
|
56
|
+
customerId,
|
|
57
|
+
resourceId,
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
this.log(result.createOnPremiseResourceJWT.result.jwt);
|
|
22
61
|
}
|
|
23
|
-
`,
|
|
24
|
-
variables: {
|
|
25
|
-
customerId,
|
|
26
|
-
resourceId,
|
|
27
|
-
},
|
|
28
|
-
});
|
|
29
|
-
this.log(result.createOnPremiseResourceJWT.result.jwt);
|
|
30
62
|
}
|
|
31
63
|
}
|
|
32
64
|
exports.default = CreateCommand;
|
|
33
|
-
CreateCommand.description = "Create a
|
|
65
|
+
CreateCommand.description = "Create a JWT that may be used to register an On-Premise Resource.";
|
|
34
66
|
CreateCommand.flags = {
|
|
35
67
|
customerId: core_1.Flags.string({
|
|
36
68
|
char: "c",
|
|
@@ -42,4 +74,8 @@ CreateCommand.flags = {
|
|
|
42
74
|
required: false,
|
|
43
75
|
description: "An optional ID of an existing On-Premise Resource for which to generate a new JWT.",
|
|
44
76
|
}),
|
|
77
|
+
rotate: core_1.Flags.boolean({
|
|
78
|
+
required: false,
|
|
79
|
+
description: "Invalidate all JWTs for the On-Premise Resource and get a new JWT.",
|
|
80
|
+
}),
|
|
45
81
|
};
|
package/oclif.manifest.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "5.2.
|
|
2
|
+
"version": "5.2.11",
|
|
3
3
|
"commands": {
|
|
4
4
|
"login": {
|
|
5
5
|
"id": "login",
|
|
@@ -1267,7 +1267,7 @@
|
|
|
1267
1267
|
},
|
|
1268
1268
|
"on-prem-resources:registration-jwt": {
|
|
1269
1269
|
"id": "on-prem-resources:registration-jwt",
|
|
1270
|
-
"description": "Create a
|
|
1270
|
+
"description": "Create a JWT that may be used to register an On-Premise Resource.",
|
|
1271
1271
|
"strict": true,
|
|
1272
1272
|
"pluginName": "@prismatic-io/prism",
|
|
1273
1273
|
"pluginAlias": "@prismatic-io/prism",
|
|
@@ -1289,6 +1289,13 @@
|
|
|
1289
1289
|
"description": "An optional ID of an existing On-Premise Resource for which to generate a new JWT.",
|
|
1290
1290
|
"required": false,
|
|
1291
1291
|
"multiple": false
|
|
1292
|
+
},
|
|
1293
|
+
"rotate": {
|
|
1294
|
+
"name": "rotate",
|
|
1295
|
+
"type": "boolean",
|
|
1296
|
+
"description": "Invalidate all JWTs for the On-Premise Resource and get a new JWT.",
|
|
1297
|
+
"required": false,
|
|
1298
|
+
"allowNo": false
|
|
1292
1299
|
}
|
|
1293
1300
|
},
|
|
1294
1301
|
"args": {}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prismatic-io/prism",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.11",
|
|
4
4
|
"description": "Build, deploy, and support integrations in Prismatic from the comfort of your command line",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"prismatic",
|
|
@@ -64,7 +64,6 @@
|
|
|
64
64
|
"jwt-decode": "2.2.0",
|
|
65
65
|
"lodash": "4.17.21",
|
|
66
66
|
"mime-types": "2.1.27",
|
|
67
|
-
"oclif": "3.11.3",
|
|
68
67
|
"open": "8.4.2",
|
|
69
68
|
"prettier": "2.6.2",
|
|
70
69
|
"striptags": "3.2.0",
|
|
@@ -96,6 +95,7 @@
|
|
|
96
95
|
"eslint-plugin-prettier": "3.1.3",
|
|
97
96
|
"jest": "29.5.0",
|
|
98
97
|
"jest-config": "29.5.0",
|
|
98
|
+
"oclif": "3.11.3",
|
|
99
99
|
"ts-jest": "29.0.5",
|
|
100
100
|
"ts-node": "9.0.0",
|
|
101
101
|
"typescript": "4.6.3"
|