Skip to content

Multi-Tenancy Support #82

@thisisevanfox

Description

@thisisevanfox

Hello CAP Community,

We operate a multi-tenant CAP application and have currently implemented the creation of NotificationTypes and the sending of notifications via API calls ourselves. To improve maintainability, promote standardization, and eliminate custom code, we now want to switch to the cap-js/notifications plugin. We have noticed that the plugin requires a destination to the notification endpoint for creating NotificationTypes during deployment. This must be in the provider account. This logic is implemented in the getNotificationDestination method in utils.js. Because the destination is always taken from the provider account, we therefore assume that multitenancy is currently not supported.

Are there any plans to make the plugin usable for multi-tenant CAP applications?

I would like to briefly describe how we handle the sending of notifications in our multi-tenant application: When implementing our own solution, we found that NotificationTypes need to be rolled out per tenant. This raised the question of how to automate the rollout of these types to all tenants during deployment. Technically, this means that you need to read the "SAP_Notification" destination from all tenant subaccounts using a tenant-specific JWT token (which can be passed to the getDestination method from @sap-cloud-sdk/connectivity, but is only available at runtime) and then trigger the endpoint for creating/updating accordingly.

How did we solve this? We do not roll out the NotificationTypes directly during deployment but check in a tenant-specific context before each time a notification is send whether the NotificationType referenced in the notification already exists and respond accordingly.

Thank you in advance for your support!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions