-
Notifications
You must be signed in to change notification settings - Fork 215
Implement dynamic logic for CORS request filtering #2230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@otsakir the second option makes more sense to me so far so it stays dynamic and as new domains are added no additional configuration is required. |
Also, some more thinking... The issue relates to this: The Btw, @deruelle , it's not only about cloud. It makes sense to be able to use an arbitrary RVD address (i.e. a configurable one, not a convention-based one) for more flexibility. |
Good point, we should have a simple way to configure the mapping in that case corresponding to your logic below
|
@deruelle , after discussion with @leftyb , we agreed to take advantage of existing rcmlsesrver-api configuration section in restcomm.xml which points to the RCML server/rvd. It was initially created for sending notifications when an account was removed. Here is a sample:
The section above should probably be refactored to the following to better reflect current state of codebase:
As far as i remember there are no major dependencies of this section other than RcmlserverApi class. Another issue should be created to handle setting restcomm.xml/rcmlserver appropriately |
Also @deruelle , regarding your comment
If you what you mean is to have a restcomm instance hooked up to multiple RVD instances in different domains each, i see no easy way to do this.
We need to be very careful when drafting this out and always have in mind what happens with the storage layer behind the servers. Will it be shared or not ? |
@otsakir what I mean is multi-tenancy ie that a given Restcomm Connect instance can manage many organizations (domains) and so should RVD. At any given point in time though a given Restcomm Connnect can send a request only for the domain it is currently processing the request for ie a request for cloud.restcomm.com will only go to rvd.cloud.restcomm.com never to rvd.anotherorg.restcomm.com by example |
ok @deruelle, i see. So there should be some kind of logic both in the client and the server. In the client (Dashboard) it will be able to guess rvd's location from restcomm's location (i.e. where index.html was retrieved from) and in the server it will check for Origin header in the inverse way. So, yes, we're definitely talking about a convention here. This seems part of another round of tasks. I think we can proceed with using configuration based allowwed origins for now (already mostly implemented) and review this as part of the organization work. wdyt ? |
… and RcmlserverApi class - renamed rcmlserver-api to rcmlserver - added api-path property Refers #2230
This relates to 'rcmlserver' configuration section since it used it Refers #2230
@otsakir works for me but please create a new issue to track it down and put the solution in there for when the time comes we know what has to be done and see if you can include it in the Organizations Epic as well. Thanks ! |
Closing this since it has been reviewed and merged. |
Which CORS requests should get responses with Allow-* headers ? We can do one of the following:
Use a configuration list defined by an administrator.
For example define a new section in restcom.xml like the following:
and add the necessary configuration scripts to populate this configuration from restcomm.conf/advanced.conf
Set up a convention
Set up a convention based on the destination name of the request. For example if the incoming request targeted
domainA.restcomm.com
return an Access-Control-Allow-Origin header likeAccess-Control-Allow-Origin=rvd.domainA.restcomm.com
.@deruelle , @leftyb thoughts ?
Or of course we could support both ways.
The text was updated successfully, but these errors were encountered: