sdk icon indicating copy to clipboard operation
sdk copied to clipboard

Support `sourceType: string[]` in relationship metadata

Open aiwilliams opened this issue 3 years ago • 1 comments

Background

Relationships of a single _type value can represent edges between two different source entity _types. For example, in the Okta integration, there are okta_user_group and okta_app_user_group entities that may both be related to an okta_application, with the relationship _type always being okta_group_assigned_application. In this case, the metadata for the relationship has to be:

GROUP_ASSIGNED_APPLICATION: {
    _type: 'okta_group_assigned_application',
    _class: RelationshipClass.ASSIGNED,
    sourceType: 'okta_user_group, okta_app_user_group',
    targetType: Entities.APPLICATION._type,
}

We're unable to reference the constants for those entity types, and the documentation generate produces a single row.

Proposal

Add support to the metadata for sourceType: string[], and generate two rows in the documentation, one for each sourceType.

GROUP_ASSIGNED_APPLICATION: {
    _type: 'okta_group_assigned_application',
    _class: RelationshipClass.ASSIGNED,
    sourceType: [Entities.USER_GROUP, Entities.APP_USER_GROUP],
    targetType: Entities.APPLICATION._type,
}

aiwilliams avatar Jun 22 '21 12:06 aiwilliams