...
Your application should be able to fetch the right API configuration (e.g.: which REST API host to use) based on the context of a controller action and/or database model. Multi-tenant configuration is achieved by associating a configuration manifest to a "tenant key" (unique identifier) which will then be used in to tag models and to parameterize routes.
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
# This piece of code should be put in an initializer. # # With the Maestrano SDKs, you have the ability to add as many # marketplace configurations as you want. E.g.: you can add a configuration manifest # for 'maestrano' and another one for 'acme-corp'. # # These configuration manifests only need to be added for Enterprise Tenants, which host a dedicated # Maestrano infrastructure on their private cloud. # # Create a configuration manifest for the key "maestrano" # Maestrano.with("acme-corpmaestrano").configure({ # Tenant specific configuration sso_idp: "https://maestrano.com", account_api_host: "https://maestrano.com", connec_api_host: "https://api-connec.maestrano.com", # My app configuration for this tenant - note the use of the tenant key # in the url. # This URL will be used by Maestrano.com to send you notifications app_webhook_path: "https://myapp.com/mno-enterprise/maestrano/connec/receive" }) # # Create a configuration manifest for the key "acme-corp" # Maestrano.with("acme-corp").configure({ # Tenant specific configuration sso_idp: "https://saml.acme-corp.com", account_api_host: "https://accounts.acme-corp.com", connec_api_host: "https://api-connec.acme-corp.com", # My app configuration for this tenant - note the use of the tenant key # in the url. # This URL will be used by Acme Corp to send you notifications app_webhook_path: "https://myapp.com/mno-enterprise/acme-corp/connec/receive" }) |
...