Skip to content
This repository has been archived by the owner on Jun 24, 2024. It is now read-only.

Commit

Permalink
Merge pull request #241 from JupiterOne/INT-10103
Browse files Browse the repository at this point in the history
INT-10103: fix duplicated key
  • Loading branch information
gastonyelmini authored Feb 1, 2024
2 parents dac4d58 + 60cc901 commit a32247b
Show file tree
Hide file tree
Showing 4 changed files with 373 additions and 349 deletions.
14 changes: 7 additions & 7 deletions docs/jupiterone.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,25 +179,25 @@ The following relationships are created:

| Source Entity `_type` | Relationship `_class` | Target Entity `_type` |
| -------------------------------------- | --------------------- | --------------------- |
| `okta_account` | **HAS** | `okta_app_user_group` |
| `okta_account` | **HAS** | `okta_application` |
| `okta_account` | **HAS** | `okta_device` |
| `okta_account` | **HAS** | `okta_user_group` |
| `okta_account` | **HAS** | `okta_app_user_group` |
| `okta_account` | **HAS** | `okta_rule` |
| `okta_account` | **HAS** | `okta_service` |
| `okta_account` | **HAS** | `okta_user` |
| `okta_account` | **HAS** | `okta_user_group` |
| `okta_app_user_group` | **HAS** | `okta_user` |
| `okta_user_group, okta_app_user_group` | **ASSIGNED** | `okta_application` |
| `okta_user_group` | **HAS** | `okta_user` |
| `okta_rule` | **MANAGES** | `okta_user_group` |
| `okta_user` | **ASSIGNED** | `okta_application` |
| `okta_user` | **ASSIGNED** | `aws_iam_role` |
| `okta_user` | **ASSIGNED** | `mfa_device` |
| `okta_user` | **ASSIGNED** | `okta_role` |
| `okta_user` | **ASSIGNED** | `okta_application` |
| `okta_user` | **CREATED** | `okta_application` |
| `okta_user` | **HAS** | `okta_device` |
| `okta_user` | **ASSIGNED** | `okta_role` |
| `okta_user_group` | **ASSIGNED** | `aws_iam_role` |
| `okta_user_group` | **ASSIGNED** | `okta_role` |
| `okta_user` | **HAS** | `okta_device` |
| `okta_user_group` | **HAS** | `okta_user` |
| `okta_user_group, okta_app_user_group` | **ASSIGNED** | `okta_application` |

<!--
********************************************************************************
Expand Down
10 changes: 4 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,15 @@
"uuid": "^9.0.0"
},
"peerDependencies": {
"@jupiterone/integration-sdk-core": "^9.5.0"
"@jupiterone/integration-sdk-core": "^11.8.0"
},
"devDependencies": {
"@jupiterone/integration-sdk-core": "^9.5.0",
"@jupiterone/integration-sdk-dev-tools": "^9.5.0",
"@jupiterone/integration-sdk-testing": "^9.5.0",
"@jupiterone/integration-sdk-core": "^11.8.0",
"@jupiterone/integration-sdk-dev-tools": "^11.8.0",
"@jupiterone/integration-sdk-testing": "^11.8.0",
"@types/lodash": "^4.14.200",
"@types/node-fetch": "^2.6.3",
"@types/uuid": "^8.3.4",
"@typescript-eslint/eslint-plugin": "^4.29.3",
"@typescript-eslint/parser": "^4.29.3",
"auto": "^10.46.0",
"ts-jest": "^29.0.0-next.1",
"typescript": "^4.3.5"
Expand Down
16 changes: 9 additions & 7 deletions src/steps/roles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,15 @@ export async function fetchRoles({
await jobState.addEntity(roleEntity);
}

await jobState.addRelationship(
createDirectRelationship({
_class: RelationshipClass.ASSIGNED,
from: group,
to: roleEntity,
}),
);
const groupRoleRelationship = createDirectRelationship({
_class: RelationshipClass.ASSIGNED,
from: group,
to: roleEntity,
});

if (!jobState.hasKey(groupRoleRelationship._key)) {
await jobState.addRelationship(groupRoleRelationship);
}
});
},
);
Expand Down
Loading

0 comments on commit a32247b

Please sign in to comment.