Hi All,

In API Manager REST API, we will be supporting cross tenant scenarios. Few
examples would be like below.

1. [email protected] wants to see the APIs that are available in the tenant
store; cloud.com
2. [email protected] wants to see the documents of an API weatherAPI that are
available in the tenant store; cloud.com

For this requirement we need to pass the "required tenant domain" parameter
with the request as the logged in user belongs to is a different tenant.
There are several possible ways to specify this.

1. Specify this as a query parameter for every resource this is required

ex: GET http://127.0.0.1:9763/api/am/publisher/v1/apis?*tenantDomain=cloud.com
<http://cloud.com>*


2. Specify this as a header parameter

3. Specify this within the URI.

a. before the Jax-RS web app context

ex: GET http://127.0.0.1:9763/*t/cloud.com <http://cloud.com>*
/api/am/publisher/v1/apis

b. after the Jax-RS web app context

ex: GET http://127.0.0.1:9763/api/am/publisher/v1/*t/cloud.com
<http://cloud.com>*/apis


Regarding these three options, option (3.a) would require the web app to be
deployed on each and every tenant. Or otherwise we should manually register
contexts in tomcat run-time to match those contexts. Even if we register
context manually, this would not be a good solution as the user might
expect the web app to be in the tenant space (when he sees the /t/tenant
part in the URI) but it is not there actually. Option (3.b) would require
the web app to handle the tenant as a resource and every other resource
would need to be a sub-resource. And we need to specifically handle for the
super tenant which we don't specify the tenant in the URL.
For options (1) and (2), we don't need to face such difficulties.

Please share your thoughts.

Thanks.
Malintha

-- 
Malintha Amarasinghe
Software Engineer
*WSO2, Inc. - lean | enterprise | middleware*
http://wso2.com/

Mobile : +94 712383306
_______________________________________________
Architecture mailing list
[email protected]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture

Reply via email to