@pipedream/signpath 0.0.1 → 0.1.0
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,30 @@
|
|
|
1
|
+
import signpath from "../../signpath.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "signpath-get-signing-request-data",
|
|
5
|
+
name: "Get Signing Request Data",
|
|
6
|
+
description: "Get data for a specific signing request. [See the documentation](https://docs.signpath.io/build-system-integration#get-signing-request-data)",
|
|
7
|
+
version: "0.0.1",
|
|
8
|
+
annotations: {
|
|
9
|
+
destructiveHint: false,
|
|
10
|
+
openWorldHint: true,
|
|
11
|
+
readOnlyHint: true,
|
|
12
|
+
},
|
|
13
|
+
type: "action",
|
|
14
|
+
props: {
|
|
15
|
+
signpath,
|
|
16
|
+
signingRequestId: {
|
|
17
|
+
type: "string",
|
|
18
|
+
label: "Signing Request ID",
|
|
19
|
+
description: "The ID of the signing request to get data for",
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
async run({ $ }) {
|
|
23
|
+
const response = await this.signpath.getSigningRequestData({
|
|
24
|
+
signingRequestId: this.signingRequestId,
|
|
25
|
+
$,
|
|
26
|
+
});
|
|
27
|
+
$.export("$summary", `Successfully retrieved signing request data for ID: ${this.signingRequestId}`);
|
|
28
|
+
return response;
|
|
29
|
+
},
|
|
30
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import signpath from "../../signpath.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "signpath-resubmit-signing-request",
|
|
5
|
+
name: "Resubmit Signing Request",
|
|
6
|
+
description: "Resubmit a signing request. [See the documentation](https://docs.signpath.io/build-system-integration#resubmit-a-signing-request)",
|
|
7
|
+
version: "0.0.1",
|
|
8
|
+
annotations: {
|
|
9
|
+
destructiveHint: false,
|
|
10
|
+
openWorldHint: true,
|
|
11
|
+
readOnlyHint: false,
|
|
12
|
+
},
|
|
13
|
+
type: "action",
|
|
14
|
+
props: {
|
|
15
|
+
signpath,
|
|
16
|
+
originalSigningRequestId: {
|
|
17
|
+
type: "string",
|
|
18
|
+
label: "Signing Request ID",
|
|
19
|
+
description: "ID of the signing request which you want to resubmit",
|
|
20
|
+
},
|
|
21
|
+
signingPolicySlug: {
|
|
22
|
+
propDefinition: [
|
|
23
|
+
signpath,
|
|
24
|
+
"signingPolicySlug",
|
|
25
|
+
],
|
|
26
|
+
},
|
|
27
|
+
description: {
|
|
28
|
+
propDefinition: [
|
|
29
|
+
signpath,
|
|
30
|
+
"description",
|
|
31
|
+
],
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
async run({ $ }) {
|
|
35
|
+
const response = await this.signpath.resubmitSigningRequest({
|
|
36
|
+
$,
|
|
37
|
+
data: {
|
|
38
|
+
originalSigningRequestId: this.originalSigningRequestId,
|
|
39
|
+
signingPolicySlug: this.signingPolicySlug,
|
|
40
|
+
description: this.description,
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
$.export("$summary", `Resubmitted signing request for ID: ${this.originalSigningRequestId}`);
|
|
44
|
+
return response;
|
|
45
|
+
},
|
|
46
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import signpath from "../../signpath.app.mjs";
|
|
2
|
+
import { getFileStreamAndMetadata } from "@pipedream/platform";
|
|
3
|
+
import FormData from "form-data";
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
key: "signpath-submit-signing-request",
|
|
7
|
+
name: "Submit Signing Request",
|
|
8
|
+
description: "Submit a signing request. [See the documentation](https://docs.signpath.io/build-system-integration#submit-a-signing-request)",
|
|
9
|
+
version: "0.0.1",
|
|
10
|
+
annotations: {
|
|
11
|
+
destructiveHint: false,
|
|
12
|
+
openWorldHint: true,
|
|
13
|
+
readOnlyHint: false,
|
|
14
|
+
},
|
|
15
|
+
type: "action",
|
|
16
|
+
props: {
|
|
17
|
+
signpath,
|
|
18
|
+
projectSlug: {
|
|
19
|
+
type: "string",
|
|
20
|
+
label: "Project Slug",
|
|
21
|
+
description: "The project for which you want to create the signing request",
|
|
22
|
+
},
|
|
23
|
+
signingPolicySlug: {
|
|
24
|
+
propDefinition: [
|
|
25
|
+
signpath,
|
|
26
|
+
"signingPolicySlug",
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
|
+
artifact: {
|
|
30
|
+
type: "string",
|
|
31
|
+
label: "Artifact",
|
|
32
|
+
description: "Artifact file to be signed. You can also provide a URL to a file. Allowed extensions: .ps1, .psm1, .psd1, .psc1, .ps1xml",
|
|
33
|
+
},
|
|
34
|
+
description: {
|
|
35
|
+
propDefinition: [
|
|
36
|
+
signpath,
|
|
37
|
+
"description",
|
|
38
|
+
],
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
async run({ $ }) {
|
|
42
|
+
const form = new FormData();
|
|
43
|
+
const {
|
|
44
|
+
stream, metadata,
|
|
45
|
+
} = await getFileStreamAndMetadata(this.artifact);
|
|
46
|
+
|
|
47
|
+
form.append("artifact", stream, {
|
|
48
|
+
contentType: metadata.contentType,
|
|
49
|
+
knownLength: metadata.size,
|
|
50
|
+
filename: metadata.name,
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
form.append("projectSlug", this.projectSlug);
|
|
54
|
+
form.append("signingPolicySlug", this.signingPolicySlug);
|
|
55
|
+
if (this.description) {
|
|
56
|
+
form.append("description", this.description);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const response = await this.signpath.submitSigningRequest({
|
|
60
|
+
$,
|
|
61
|
+
data: form,
|
|
62
|
+
headers: form.getHeaders(),
|
|
63
|
+
});
|
|
64
|
+
$.export("$summary", "Successfully submitted signing request");
|
|
65
|
+
return response;
|
|
66
|
+
},
|
|
67
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pipedream/signpath",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "Pipedream SignPath Components",
|
|
5
5
|
"main": "signpath.app.mjs",
|
|
6
6
|
"keywords": [
|
|
@@ -11,5 +11,9 @@
|
|
|
11
11
|
"author": "Pipedream <support@pipedream.com> (https://pipedream.com/)",
|
|
12
12
|
"publishConfig": {
|
|
13
13
|
"access": "public"
|
|
14
|
+
},
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@pipedream/platform": "^3.2.5",
|
|
17
|
+
"form-data": "^4.0.5"
|
|
14
18
|
}
|
|
15
19
|
}
|
package/signpath.app.mjs
CHANGED
|
@@ -1,11 +1,58 @@
|
|
|
1
|
+
import { axios } from "@pipedream/platform";
|
|
2
|
+
|
|
1
3
|
export default {
|
|
2
4
|
type: "app",
|
|
3
5
|
app: "signpath",
|
|
4
|
-
propDefinitions: {
|
|
6
|
+
propDefinitions: {
|
|
7
|
+
signingPolicySlug: {
|
|
8
|
+
type: "string",
|
|
9
|
+
label: "Signing Policy Slug",
|
|
10
|
+
description: "Signing policy for which you want to create the signing request",
|
|
11
|
+
},
|
|
12
|
+
description: {
|
|
13
|
+
type: "string",
|
|
14
|
+
label: "Description",
|
|
15
|
+
description: "Description of the signing request",
|
|
16
|
+
optional: true,
|
|
17
|
+
},
|
|
18
|
+
},
|
|
5
19
|
methods: {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
20
|
+
_baseUrl() {
|
|
21
|
+
return `https://app.signpath.io/API/v1/${this.$auth.organization_id}`;
|
|
22
|
+
},
|
|
23
|
+
_makeRequest({
|
|
24
|
+
$ = this, path, headers, ...opts
|
|
25
|
+
}) {
|
|
26
|
+
return axios($, {
|
|
27
|
+
url: `${this._baseUrl()}${path}`,
|
|
28
|
+
headers: {
|
|
29
|
+
...headers,
|
|
30
|
+
Authorization: `Bearer ${this.$auth.api_token}`,
|
|
31
|
+
},
|
|
32
|
+
...opts,
|
|
33
|
+
});
|
|
34
|
+
},
|
|
35
|
+
getSigningRequestData({
|
|
36
|
+
signingRequestId, ...opts
|
|
37
|
+
}) {
|
|
38
|
+
return this._makeRequest({
|
|
39
|
+
path: `/SigningRequests/${signingRequestId}`,
|
|
40
|
+
...opts,
|
|
41
|
+
});
|
|
42
|
+
},
|
|
43
|
+
submitSigningRequest(opts = {}) {
|
|
44
|
+
return this._makeRequest({
|
|
45
|
+
method: "POST",
|
|
46
|
+
path: "/SigningRequests/SubmitWithArtifact",
|
|
47
|
+
...opts,
|
|
48
|
+
});
|
|
49
|
+
},
|
|
50
|
+
resubmitSigningRequest(opts = {}) {
|
|
51
|
+
return this._makeRequest({
|
|
52
|
+
method: "POST",
|
|
53
|
+
path: "/SigningRequests/Resubmit",
|
|
54
|
+
...opts,
|
|
55
|
+
});
|
|
9
56
|
},
|
|
10
57
|
},
|
|
11
|
-
};
|
|
58
|
+
};
|