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

Fix documentation for group assigned application #136

Merged
merged 1 commit into from
Jun 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions docs/jupiterone.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,18 +133,18 @@ The following entities are created:

The following relationships are created/mapped:

| Source Entity `_type` | Relationship `_class` | Target Entity `_type` |
| --------------------- | --------------------- | --------------------- |
| `okta_account` | **HAS** | `okta_application` |
| `okta_account` | **HAS** | `okta_user_group` |
| `okta_account` | **HAS** | `okta_service` |
| `okta_account` | **HAS** | `okta_user` |
| `okta_group` | **ASSIGNED** | `okta_application` |
| `okta_user_group` | **HAS** | `okta_user` |
| `okta_user` | **ASSIGNED** | `okta_application` |
| `okta_user` | **ASSIGNED** | `aws_iam_role` |
| `okta_user` | **ASSIGNED** | `mfa_device` |
| `okta_user_group` | **ASSIGNED** | `aws_iam_role` |
| Source Entity `_type` | Relationship `_class` | Target Entity `_type` |
| -------------------------------------- | --------------------- | --------------------- |
| `okta_account` | **HAS** | `okta_application` |
| `okta_account` | **HAS** | `okta_user_group` |
| `okta_account` | **HAS** | `okta_service` |
| `okta_account` | **HAS** | `okta_user` |
| `okta_user_group, okta_app_user_group` | **ASSIGNED** | `okta_application` |
| `okta_user_group` | **HAS** | `okta_user` |
| `okta_user` | **ASSIGNED** | `okta_application` |
| `okta_user` | **ASSIGNED** | `aws_iam_role` |
| `okta_user` | **ASSIGNED** | `mfa_device` |
| `okta_user_group` | **ASSIGNED** | `aws_iam_role` |

<!--
********************************************************************************
Expand Down
9 changes: 8 additions & 1 deletion src/converters/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,19 @@ export function createApplicationGroupRelationships(
const relationships: Relationship[] = [];

const relationship: Relationship = createDirectRelationship({
_class: RelationshipClass.ASSIGNED,
_class: Relationships.GROUP_ASSIGNED_APPLICATION._class,
fromKey: group.id,
// Actually okta_user_group or okta_app_user_group.
// See `createUserGroupEntity`.
fromType: 'okta_group',
toKey: application._key,
toType: application._type,
properties: {
// Override generated values for _key, _type to maintain
// values before migration to new SDK
_key: `${group.id}|assigned|${application._key}`,
_type: Relationships.GROUP_ASSIGNED_APPLICATION._type,

applicationId: application.id,
groupId: group.id,
// Array property not supported on the edge in Neptune
Expand Down
2 changes: 1 addition & 1 deletion src/steps/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export const Relationships: Record<
GROUP_ASSIGNED_APPLICATION: {
_type: 'okta_group_assigned_application',
_class: RelationshipClass.ASSIGNED,
sourceType: 'okta_group', // TODO what up with this?
sourceType: 'okta_user_group, okta_app_user_group',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should support arrays?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think supporting arrays would be good. 👍 Created JupiterOne/sdk#490.

targetType: Entities.APPLICATION._type,
},
USER_ASSIGNED_APPLICATION: {
Expand Down