Allow using query search when setting identifier mapping in custom ocean integrations
D
David Meushar
We want to have the ability to map the entity identifier using a query search like the following mapping
identifier:
combinator: '"and"'
rules:
- operator: '"="'
property: '"$blueprint"'
value: '"_user"'
- operator: '"="'
property: '"$identifier"'
value: '"\(.user_handle)@github.com"'
- operator: '"!="'
property: '"port_type"'
value: '"Service Account"'
At this time this returns an entity and the custom ocean mapping give us a "identifier must be a string" error
D
David Meushar
Port is using upserts, so if a specific user isn’t exist it auto creates it, but we want the ability to have a filter up front for the user blueprint to avoid that and also avoid enriching unrelated entities like service accounts etc, so instead of having:
- kind: user-health-overview
selector:
query: 'true'
port:
entity:
mappings:
identifier: '"\(.user_handle)@github.com"'
blueprint: '"_user"'
properties:
...
We want to have:
- kind: user-health-overview
selector:
query: 'true'
port:
entity:
mappings:
identifier:
combinator: '"and"'
rules:
- operator: '"="'
property: '"$blueprint"'
value: '"_user"'
- operator: '"="'
property: '"$identifier"'
value: '"\(.user_handle)@github.com"'
- operator: '"!="'
property: '"port_type"'
value: '"Service Account"'
blueprint: '"_user"'
properties:
…