How to handle Multitenant Access Control’s integration events
Integration events are emitted on an AMQP message queue. An integration event is an asynchronous event, which is typically used to transfer state changes of entities to other applications. This is done by publishing those events to a message broker. Consumers will process these events individually, without having any effect on the publisher or other consumers. For example, when an organization gets deleted, other services consuming that event can react accordingly. For further information regarding that topic, check the Integration Guide for integration events and messaging infrastructure.
If one event caused multiple "dependent" (cascaded) events to happen, only the "top-level" event will be triggered. Example: If an organization is deleted, the "dependent" events would be Contract-Deletion, User-Deletion. Triggering those as well would cause a big amount of events, so consumers are expected to listen for changes to higher-level entities as well (even if only interested in User-Deletion). |
The integration events emitted are displayed in the following sections.
Organization (tenant)
Creation
{
"correlationId": "3e09850bde12416292b0f292ff8cd3e4",
"msgId": "80f139f4-a051-4eef-bab8-c59b10406e7a",
"msgSender": "https://nexeed.../macma",
"msgSendTime": "2020-07-21T13:10:31.596196Z",
"msgTopic": "nexeed.mib.integration.event.entity.urn:bosch:nexeed:macma:Tenant.created",
"payload": {
"eventId": "c09139b3-5694-4398-81e1-9014758414e4",
"eventTime": "2020-07-21T13:10:31.596218Z",
"operation": "created",
"ownerId": "cc34f192-0134-4e04-a475-6feb4421bf01",
"entityType": "urn:bosch:nexeed:macma:Tenant:v1",
"entityId": "cc34f192-0134-4e04-a475-6feb4421bf01",
"$type": "urn:bosch:nexeed:EntityChangedNotification:v1"
},
"$type": "urn:bosch:nexeed:IntegrationEvent:v1"
}
The organization/tenant creation event also includes the creation of the admin user for the new tenant. Therefore, also a user creation event is emitted. Since organizations(tenants) are first class citizens in Multitenant Access Control, they own themselves. Therefore, ownerId field is equal to entityId field in the payload.
Deletion
{
"correlationId": "3e09850bde12416292b0f292ff8cd3e4",
"msgId": "80f139f4-a051-4eef-bab8-c59b10406e7a",
"msgSender": "https://nexeed.../macma",
"msgSendTime": "2020-07-21T13:10:31.596196Z",
"msgTopic": "nexeed.mib.integration.event.entity.urn:bosch:nexeed:macma:Tenant.removed",
"payload": {
"eventId": "c09139b3-5694-4398-81e1-9014758414e4",
"eventTime": "2020-07-21T13:10:31.596218Z",
"operation": "removed",
"ownerId": "cc34f192-0134-4e04-a475-6feb4421bf01",
"entityType": "urn:bosch:nexeed:macma:Tenant:v1",
"entityId": "cc34f192-0134-4e04-a475-6feb4421bf01",
"$type": "urn:bosch:nexeed:EntityChangedNotification:v1"
},
"$type": "urn:bosch:nexeed:IntegrationEvent:v1"
}
User
For users synchronized with LDAP / OIDC no integration events will be sent. |
User creation
{
"correlationId": "69d379ed64684aafadcc42a89a183bb4",
"msgId": "c758ef9c-fa27-4d55-bcbc-8e1721b691c5",
"msgSender": "https://nexeed.../macma",
"msgSendTime": "2020-07-21T13:03:16.063058Z",
"msgTopic": "nexeed.mib.integration.event.entity.urn:bosch:nexeed:macma:User.created",
"payload": {
"eventId": "57f84c17-8662-4654-8fc4-d245cd17e9e3",
"eventTime": "2020-07-21T13:03:16.063086Z",
"operation": "created",
"ownerId": "7311ea8c-5d48-43fe-acf9-980eedf24b6c",
"entityType": "urn:bosch:nexeed:macma:User:v1",
"entityId": "4e941da5-16c6-438e-9b90-5891e3501a9f",
"$type": "urn:bosch:nexeed:EntityChangedNotification:v1"
},
"$type": "urn:bosch:nexeed:IntegrationEvent:v1"
}
User update
{
"correlationId": "99eab11cc0c24a34bc823882acc25f40",
"msgId": "961606ea-16fe-43d0-a5d1-b841dc9f3b16",
"msgSender": "https://nexeed.../macma",
"msgSendTime": "2020-07-21T13:06:00.067844Z",
"msgTopic": "nexeed.mib.integration.event.entity.urn:bosch:nexeed:macma:User.modified",
"payload": {
"eventId": "87705a1d-17a3-4d94-ba39-1bb2cd44d0a0",
"eventTime": "2020-07-21T13:06:00.067882Z",
"operation": "modified",
"ownerId": "7311ea8c-5d48-43fe-acf9-980eedf24b6c",
"entityType": "urn:bosch:nexeed:macma:User:v1",
"entityId": "4e941da5-16c6-438e-9b90-5891e3501a9f",
"$type": "urn:bosch:nexeed:EntityChangedNotification:v1"
},
"$type": "urn:bosch:nexeed:IntegrationEvent:v1"
}
User deletion
{
"correlationId": "78aa13e102a143338b363b3cf800a1af",
"msgId": "fc380344-0cc1-4f87-83d3-78260d62c00f",
"msgSender": "https://nexeed.../macma",
"msgSendTime": "2020-07-21T13:07:06.394550Z",
"msgTopic": "nexeed.mib.integration.event.entity.urn:bosch:nexeed:macma:User.removed",
"payload": {
"eventId": "38ec5a30-e8c3-4e25-b5c9-fc808686d26f",
"eventTime": "2020-07-21T13:07:06.394576Z",
"operation": "removed",
"ownerId": "7311ea8c-5d48-43fe-acf9-980eedf24b6c",
"entityType": "urn:bosch:nexeed:macma:User:v1",
"entityId": "4e941da5-16c6-438e-9b90-5891e3501a9f",
"$type": "urn:bosch:nexeed:EntityChangedNotification:v1"
},
"$type": "urn:bosch:nexeed:IntegrationEvent:v1"
}
Contract
Contract creation
{
"correlationId": "f4e921d685f546988d630212a0f12bba",
"msgId": "b69d50f9-748f-4512-b4e2-111c25dc9327",
"msgSender": "https://nexeed.../macma",
"msgSendTime": "2020-07-27T07:29:18.625Z",
"msgTopic": "nexeed.mib.integration.tenant.contract.created",
"payload": {
"eventId": "f6db8186-3b56-4cb3-8adb-dfe98a0a2f58",
"eventTime": "2020-07-27T07:29:18.627Z",
"contractId": "53a00f4d-291e-4fa2-8a49-ea0194613831",
"applicationIds": [
"kla3ktjejkefefr"
],
"$type": "urn:bosch:nexeed:macma:ContractCreated:v1"
},
"$type": "urn:bosch:nexeed:IntegrationEvent:v1"
}
Contract deletion
{
"correlationId": "3cbfc09faf4849dc807d3eb4ee253694",
"msgId": "bf5e7a1d-d050-4ec6-b0df-ae3d51b53223",
"msgSender": "https://nexeed.../macma",
"msgSendTime": "2020-07-27T07:34:24.733Z",
"msgTopic": "nexeed.mib.integration.tenant.contract.removed",
"payload": {
"eventId": "aa00d7b6-d2b6-4cb8-af7c-63590fc1de15",
"eventTime": "2020-07-27T07:34:24.733Z",
"contractId": "0197aa90-cfaa-44aa-a4d0-26b5bc31f0a5",
"applicationIds": [
"kla3ktjejkefefr"
],
"$type": "urn:bosch:nexeed:macma:ContractRemoved:v1"
},
"$type": "urn:bosch:nexeed:IntegrationEvent:v1"
}
Groups
Groups creation
{
"correlationId": "ee452d52712a480d95e8ecd7a488817c",
"msgId": "4f44964f-7b14-4adc-bc56-a1e3fcaa735a",
"msgSender": "https://nexeed.../macma",
"msgSendTime": "2023-04-18T08:13:10.397350400Z",
"msgTopic": "nexeed.mib.integration.event.entity.urn:bosch:nexeed:macma:Group.created",
"payload": {
"eventId": "863c5315-4e41-4fbf-b2ce-d6fe6aacc9c2",
"eventTime": "2023-04-18T08:13:10.397350400Z",
"operation": "created",
"ownerId": "7311ea8c-5d48-43fe-acf9-980eedf24b6c",
"entityType": "urn:bosch:nexeed:macma:Group:v1",
"entityId": "61b097e2-ca00-47f9-97a3-46ea567e66ad",
"$type": "urn:bosch:nexeed:EntityChangedNotification:v1"
},
"$type": "urn:bosch:nexeed:IntegrationEvent:v1"
}
Groups deletion
{
"correlationId": "73f1d3ffe850407babf27dc72cf2dc68",
"msgId": "b7875662-c91e-4091-8755-31d091d77faf",
"msgSender": "https://nexeed.../macma",
"msgSendTime": "2023-04-18T08:50:27.456634300Z",
"msgTopic": "nexeed.mib.integration.event.entity.urn:bosch:nexeed:macma:Group.removed",
"payload": {
"eventId": "090c04c7-6bd7-4b99-93d7-b41d5a5ca69a",
"eventTime": "2023-04-18T08:50:27.456634300Z",
"operation": "removed",
"ownerId": "7311ea8c-5d48-43fe-acf9-980eedf24b6c",
"entityType": "urn:bosch:nexeed:macma:Group:v1",
"entityId": "eee791e4-9368-4697-9004-e12d24cb8452",
"$type": "urn:bosch:nexeed:EntityChangedNotification:v1"
},
"$type": "urn:bosch:nexeed:IntegrationEvent:v1"
}
Relations
Relation deletion
To prevent disclosing sensitive information, only one party of the relation is sent as ownerId in the event. It is advised to extract the entityId from the event, retrieve all related tenants, and calculate the difference to identify the affected parties.
{
"correlationId": "d294f6360f6b4f3d9a05be1ecf58bb42",
"msgId": "5bef8a9e-834d-415e-a769-f123fab1cc8d",
"msgSender": "https://nexeed.../macma",
"msgSendTime": "2024-08-22T09:18:53.057758300Z",
"msgTopic": "nexeed.mib.integration.event.entity.urn:bosch:nexeed:macma:Relation.removed",
"payload": {
"eventId": "c40446a5-9477-4db2-9486-039a5660e0bc",
"eventTime": "2024-08-22T09:18:53.057758300Z",
"operation": "removed",
"ownerId": "c9f7d84d-43b5-42fb-bbca-6014b6e890fc",
"entityType": "urn:bosch:nexeed:macma:Relation:v1",
"entityId": "21ad5f1b-4b73-453a-9135-fedc1cdb2317",
"$type": "urn:bosch:nexeed:EntityChangedNotification:v1"
},
"$type": "urn:bosch:nexeed:IntegrationEvent:v1"
}