@prismatic-io/prism 5.2.9 → 5.2.10
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/lib/commands/on-prem-resources/registration-jwt.js +55 -19
- package/oclif.manifest.json +17 -10
- package/package.json +1 -1
- /package/lib/commands/organization/{signingkeys → signingKeys}/delete.js +0 -0
- /package/lib/commands/organization/{signingkeys → signingKeys}/generate.js +0 -0
- /package/lib/commands/organization/{signingkeys → signingKeys}/import.js +0 -0
- /package/lib/commands/organization/{signingkeys → signingKeys}/list.js +0 -0
|
@@ -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.10",
|
|
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": {}
|
|
@@ -3815,8 +3822,8 @@
|
|
|
3815
3822
|
}
|
|
3816
3823
|
}
|
|
3817
3824
|
},
|
|
3818
|
-
"organization:
|
|
3819
|
-
"id": "organization:
|
|
3825
|
+
"organization:signingKeys:delete": {
|
|
3826
|
+
"id": "organization:signingKeys:delete",
|
|
3820
3827
|
"description": "Delete an embedded marketplace signing key",
|
|
3821
3828
|
"strict": true,
|
|
3822
3829
|
"pluginName": "@prismatic-io/prism",
|
|
@@ -3832,8 +3839,8 @@
|
|
|
3832
3839
|
}
|
|
3833
3840
|
}
|
|
3834
3841
|
},
|
|
3835
|
-
"organization:
|
|
3836
|
-
"id": "organization:
|
|
3842
|
+
"organization:signingKeys:generate": {
|
|
3843
|
+
"id": "organization:signingKeys:generate",
|
|
3837
3844
|
"description": "Generate an embedded marketplace signing key",
|
|
3838
3845
|
"strict": true,
|
|
3839
3846
|
"pluginName": "@prismatic-io/prism",
|
|
@@ -3843,8 +3850,8 @@
|
|
|
3843
3850
|
"flags": {},
|
|
3844
3851
|
"args": {}
|
|
3845
3852
|
},
|
|
3846
|
-
"organization:
|
|
3847
|
-
"id": "organization:
|
|
3853
|
+
"organization:signingKeys:import": {
|
|
3854
|
+
"id": "organization:signingKeys:import",
|
|
3848
3855
|
"description": "Import a RSA public key for use with embedded marketplace",
|
|
3849
3856
|
"strict": true,
|
|
3850
3857
|
"pluginName": "@prismatic-io/prism",
|
|
@@ -3863,8 +3870,8 @@
|
|
|
3863
3870
|
},
|
|
3864
3871
|
"args": {}
|
|
3865
3872
|
},
|
|
3866
|
-
"organization:
|
|
3867
|
-
"id": "organization:
|
|
3873
|
+
"organization:signingKeys:list": {
|
|
3874
|
+
"id": "organization:signingKeys:list",
|
|
3868
3875
|
"description": "List embedded signing keys for embedded marketplace",
|
|
3869
3876
|
"strict": true,
|
|
3870
3877
|
"pluginName": "@prismatic-io/prism",
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|