I have an API that requires the tenant as a header.
If I create a custom in-sequence:
<sequence name="WSO2AM--Ext--In">
<header
name="X-Tenant-Id"
scope="transport"
action="set"
expression="???????????????????"
/>
</sequence>
Is there an expression that I can use to achieve this? Or should I resort to creating a per-API mediator to set it?
PS: Looking at WSO2 source code (CarbonTenantInfoConfigurator.java), I found this fragment that could be useful as a hint:
PrivilegedCarbonContext cc = PrivilegedCarbonContext.getThreadLocalCarbonContext();
String tenantDomain = cc.getTenantDomain();
int tenantId = cc.getTenantId();
messageContext.setProperty("tenant.info.domain", tenantDomain);
messageContext.setProperty("tenant.info.id", tenantId);
But I don't know how to access to those properties in the custom sequence, if possible.