Using configuration interfaces per tenant and encryption

Hi,

  1. I need to create a configuration per tenant, I would like to use the cuba config mechanism. Is this possible?
    So In compile time, I will define the properties, and on run time ill input the config values (per tenant).

  2. Some of my configs needs to be encrypted. For example: Third party API passwords. I would like to encrypt a config property. is this possible? if now, can I encrypt none-config fields in the database?

Thanks

Hi Avi,

  1. Yes you can. Create two conversion classes TypeStringify and TypeFactory and use them in property annotations as described in the docs.

Hi @avi.fatal,

Currently add-on does not support separate configs for tenants.

But you can implement your own configuration tenant related entity with the service, which will provide correct config value for the tenant.

Regards,
Evgeny

@evgeny.zaharchenko Thanks. Do you mean I should have an entity TenantConfigEntity with relation to Tenant and I should fetch the config from it?
Can you explain more? I did not get you.

Thanks

Hi @avi.fatal,

Yes you can create TenantConfigEntity and create TenantConfigService with getConfig() method which will return correct tenant config for current user tenant.

Regards,
Evgeny