Skip to content

Commit e9e3d23

Browse files
committed
[Components] sailpoint #13241
Sources - New Identity (Instant) - New Identity Attribute Change (Instant) Actions - Upload Account Source File - List Certification Campaigns - Submit Access Request
1 parent 1969631 commit e9e3d23

File tree

14 files changed

+334
-301
lines changed

14 files changed

+334
-301
lines changed

components/sailpoint/.gitignore

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
import sailpoint from "../../sailpoint.app.mjs";
2-
import { axios } from "@pipedream/platform";
32

43
export default {
54
key: "sailpoint-list-certification-campaigns",
65
name: "List Certification Campaigns",
7-
description: "Retrieves multiple certification campaigns in IdentityNow. [See the documentation]()",
8-
version: "0.0.{{ts}}",
6+
description: "Retrieves multiple certification campaigns in IdentityNow. [See the documentation](https://developer.sailpoint.com/docs/api/v2024/get-active-campaigns)",
7+
version: "0.0.1",
98
type: "action",
109
props: {
11-
sailpoint: {
12-
type: "app",
13-
app: "identitynow",
14-
},
10+
sailpoint,
1511
filter: {
1612
propDefinition: [
1713
"sailpoint",
@@ -21,8 +17,20 @@ export default {
2117
},
2218
},
2319
async run({ $ }) {
24-
const campaigns = await this.sailpoint.retrieveCertificationCampaigns();
25-
$.export("$summary", `Successfully retrieved ${campaigns.length} certification campaigns`);
26-
return campaigns;
20+
const response = this.sailpoint.paginate({
21+
fn: this.sailpoint.listCertificationCampaigns,
22+
params: {
23+
detail: "full",
24+
},
25+
});
26+
27+
const responseArray = [];
28+
29+
for await (const item of response) {
30+
responseArray.push(item);
31+
}
32+
33+
$.export("$summary", `Successfully retrieved ${responseArray.length} certification campaigns`);
34+
return responseArray;
2735
},
2836
};

components/sailpoint/actions/submit-access-request/submit-access-request.mjs

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import identitynow from "../../identitynow.app.mjs";
2-
import { axios } from "@pipedream/platform";
2+
import { REQUEST_TYPE_OPTIONS } from "./common/constants.mjs";
33

44
export default {
55
key: "identitynow-submit-access-request",
66
name: "Submit Access Request",
77
description: "Sends an access request to IdentityNow. [See the documentation](https://developer.sailpoint.com/docs/api/v2024/create-access-request)",
8-
version: "0.0.{{ts}}",
8+
version: "0.0.1",
99
type: "action",
1010
props: {
1111
identitynow,
@@ -16,21 +16,34 @@ export default {
1616
],
1717
},
1818
requestType: {
19-
propDefinition: [
20-
identitynow,
21-
"requestType",
22-
],
23-
optional: true,
19+
type: "string",
20+
label: "Request Type",
21+
description: "Type of access request.",
22+
options: REQUEST_TYPE_OPTIONS,
23+
default: REQUEST_TYPE_OPTIONS[0].value,
2424
},
2525
requestedItems: {
26-
propDefinition: [
27-
identitynow,
28-
"requestedItems",
29-
],
26+
type: "string[]",
27+
label: "Requested Items",
28+
description: "List of requested items as JSON strings. **Example: [{\"type\": \"ROLE\",\"id\": \"2c9180835d2e5168015d32f890ca1581\",\"comment\": \"Requesting access profile for John Doe\",\"clientMetadata\": {\"requestedAppId\":\"2c91808f7892918f0178b78da4a305a1\",\"requestedAppName\":\"test-app\"},\"removeDate\": \"2020-07-11T21:23:15.000Z\"}]**. [See the documentation](https://developer.sailpoint.com/docs/api/v2024/create-access-request) for forther information.",
29+
},
30+
clientMetadata: {
31+
type: "object",
32+
label: "Client Metadata",
33+
description: "Arbitrary key-value pairs. They will never be processed by the IdentityNow system but will be returned on associated APIs such as /account-activities. **Example: {\"requestedAppId\":\"2c91808f7892918f0178b78da4a305a1\",\"requestedAppName\":\"test-app\"}**.",
34+
optional: true,
3035
},
3136
},
3237
async run({ $ }) {
33-
const response = await this.identitynow.submitAccessRequest();
38+
const response = await this.identitynow.submitAccessRequest({
39+
$,
40+
data: {
41+
requestedFor: this.requestedFor,
42+
requestType: this.requestType,
43+
resquestItems: this.resquestItems,
44+
clientMetadata: this.clientMetadata,
45+
},
46+
});
3447
$.export("$summary", "Access request submitted successfully.");
3548
return response;
3649
},
Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1+
import FormData from "form-data";
2+
import fs from "fs";
3+
import { checkTmp } from "../../common/utils.mjs";
14
import sailpoint from "../../sailpoint.app.mjs";
2-
import { axios } from "@pipedream/platform";
35

46
export default {
57
key: "sailpoint-upload-account-source-file",
68
name: "Upload Account Source File",
79
description: "Uploads a CSV-formatted account source file to IdentityNow. [See the documentation]()",
8-
version: "0.0.{{ts}}",
10+
version: "0.0.1",
911
type: "action",
1012
props: {
1113
sailpoint,
@@ -15,16 +17,25 @@ export default {
1517
"sourceId",
1618
],
1719
},
18-
csvAccountFile: {
19-
propDefinition: [
20-
sailpoint,
21-
"csvAccountFile",
22-
],
20+
filePath: {
21+
type: "string",
22+
label: "File Path",
23+
description: "The path to a file in the `/tmp` directory. [See the documentation on working with files](https://pipedream.com/docs/code/nodejs/working-with-files/#writing-a-file-to-tmp).",
2324
},
2425
},
2526
async run({ $ }) {
26-
const response = await this.sailpoint.uploadCsvAccountFile();
27-
$.export("$summary", `Successfully uploaded CSV account file for source ${response.id} (${response.name})`);
27+
const data = new FormData();
28+
29+
data.append("file", fs.createReadStream(checkTmp(this.filePath)));
30+
31+
const response = await this.sailpoint.uploadSourceAccountFile({
32+
$,
33+
sourceId: this.sourceId,
34+
data,
35+
headers: data.getHeaders(),
36+
});
37+
38+
$.export("$summary", `Successfully uploaded file for source account: ${response.id} (${response.name})`);
2839
return response;
2940
},
3041
};

components/sailpoint/app/sailpoint.app.ts

Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
export const LIMIT = 100;
2+
3+
export const REQUEST_TYPE_OPTIONS = [
4+
{
5+
label: "Grant Access",
6+
value: "GRANT_ACCESS",
7+
},
8+
{
9+
label: "Revoke Access",
10+
value: "REVOKE_ACCESS",
11+
},
12+
];
13+
14+
export const WEBHOOK_TYPE_OPTIONS = [
15+
"HTTP",
16+
"EVENTBRIDGE",
17+
"INLINE",
18+
"SCRIPT",
19+
"WORKFLOW",
20+
];

components/sailpoint/common/utils.mjs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
export default {
2+
checkTmp(filename) {
3+
if (!filename.startsWith("/tmp")) {
4+
return `/tmp/${filename}`;
5+
}
6+
return filename;
7+
},
8+
};

components/sailpoint/package.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
{
22
"name": "@pipedream/sailpoint",
3-
"version": "0.0.3",
3+
"version": "0.1.0",
44
"description": "Pipedream SailPoint Components",
5-
"main": "dist/app/sailpoint.app.mjs",
5+
"main": "sailpoint.app.mjs",
66
"keywords": [
77
"pipedream",
88
"sailpoint"
99
],
10-
"files": ["dist"],
1110
"homepage": "https://pipedream.com/apps/sailpoint",
1211
"author": "Pipedream <support@pipedream.com> (https://pipedream.com/)",
1312
"publishConfig": {
1413
"access": "public"
14+
},
15+
"dependencies": {
16+
"@pipedream/platform": "^3.0.3",
17+
"fs": "^0.0.1-security"
1518
}
1619
}
20+

0 commit comments

Comments
 (0)