Integration Events
As described in Architecture Overview holi uses Google Cloud Pub/Sub to communicate asynchronously and reliably between applications.
Event Types
Currently, the following events are emitted by holi-okuna:
Event Name | Description |
---|---|
UserNameUpdated | Emitted when a user updates their username. |
UserEmailUpdated | Emitted when a user updates their email address. |
UserDeleted | Emitted when a user deletes their account. |
SpaceCreated | Emitted when a user creates a space. |
SpaceUpdated | Emitted when a user updates a spaces attributes (e.g. name /slug ) |
SpaceUserAdded | Emitted when a user joins a space. |
SpaceUserLeft | Emitted when a user leaves a space. |
SpaceUserRemoved | Emitted when a user is removed from a space by a space administrator. |
SpaceDeleted | Emitted when a space is deleted. |
Currently, the only consumer of these events is holi-ocis-integration which ensures that users, their names and attributes and their rights and roles are in sync between holi (Okuna / Ory) and OwnCloud.
Event Payloads
Messages on Google Cloud Pub/Sub follow this (exemplary) structure:
{
"message": {
"data": "<BASE64_ENCODED_PAYLOAD>",
"attributes": {
"eventType": "SpaceCreated",
"eventVersion": "1.0.0"
}
},
"subscription": "projects/MY-PROJECT/subscriptions/MY-SUB"
}
For every event emitted by a holi emitter two key/value pairs are to be added to the attributes object:
eventType
: name of the eventeventVersion
: version of the event (uses semantic versioning)
At this point of time, there's no dedicated documentation for the data
field of the event (which varies depending on eventType
).
Please refer to
- the publishers source code in holi-okuna, and
- the consumers source code in holi-ocis-integration
to learn more about the payloads.
Publish/Subscribe Topics
Currently, topics are separated per environment only: okuna_$ENVIRONMENT
(in which $ENVIRONMENT
is either staging
or production
).