Skip to content
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

allow CORS in import API #2546

Closed
javisantana opened this issue Feb 27, 2015 · 17 comments
Closed

allow CORS in import API #2546

javisantana opened this issue Feb 27, 2015 · 17 comments
Assignees

Comments

@javisantana
Copy link
Contributor

javisantana commented Feb 27, 2015

It would be nice to have CORS in the import API but we need to be really careful with the implementation in order to not open security holes.

If we just allow CORS adding http OPTIONS + headers a third party could import files if the user has the session open.

My proposal here is allow CORS only if a valid api_key is provided (and in the future with oauth), like

curl -X OPTIONS -H "Cookie: valid session" http://user.cartodb.com/api/v1/import

HTTP/1.1 200 OK
Server: nginx
Date: Fri, 27 Feb 2015 16:31:18 GMT
Transfer-Encoding: chunked
Connection: keep-alive

curl -X OPTIONS "http://user.cartodb.com/api/v1/import?api_key=validapikey"

HTTP/1.1 200 OK
Server: nginx
Date: Fri, 27 Feb 2015 16:31:18 GMT
Transfer-Encoding: chunked
Connection: keep-alive
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: X-Requested-With, X-Prototype-Version, X-CSRF-Token

thoughts? @juanignaciosl @Kartones @rafatower @rochoa

@juanignaciosl
Copy link
Contributor

Totally. It must have the same rules than SQL API, for example.

@Kartones
Copy link
Contributor

Fine, after the vizjson changes this changes can be attacked easier (or at least detect better possible problems), and I like the idea

@rafatower
Copy link
Contributor

Fine by me, but what's the use case you're thinking about?

@javisantana
Copy link
Contributor Author

being able to import a table from a third party application using only javascript cc @sanderpick

@rochoa
Copy link
Contributor

rochoa commented Feb 28, 2015

Do we want to make this available to anybody? Or do we want to enable it for specific third party applications (like in a whitelist)?

@sanderpick
Copy link

would be fine for the "map-in-cartodb-button" app to have a whitelist - but may be nice to just have it open so others can build stuff with it too if it's not a security concern.

@nateirwin
Copy link

Glad you all are thinking about this. I ran into this today while working on a client-side dataset upload tool.

@alasarr
Copy link
Contributor

alasarr commented May 20, 2016

+1

@xavijam
Copy link
Contributor

xavijam commented Nov 16, 2016

There has been no activity on this issue for more several months. We are closing it. If you think this still needs to be addressed please open a new issue.

@javisantana
Copy link
Contributor Author

please, keep this open

@rafatower rafatower added this to the Dataservices - backlog milestone Nov 21, 2016
@jorgesancha jorgesancha assigned rafatower and unassigned rafatower Jan 10, 2017
@jorgesancha jorgesancha removed this from the Dataservices - backlog milestone Jan 10, 2017
@jorgesancha jorgesancha removed this from the Dataservices - backlog milestone Jan 10, 2017
@rafatower rafatower added the Next label Jan 10, 2017
@noguerol
Copy link
Contributor

Should we close this?

@stale
Copy link

stale bot commented Sep 13, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Sep 13, 2018
@rochoa rochoa removed the stale label Sep 13, 2018
@rafatower
Copy link
Contributor

This PR CartoDB/CartoDB-SQL-API#261 added some CORS support (see the middleware and usage). Not sure whether this covers the original intent of the ticket cc/ @dgaubert

@rochoa
Copy link
Contributor

rochoa commented Sep 14, 2018

This was about the Import API. That looks related to SQL API batch queries, doesn't it?

@dgaubert
Copy link
Contributor

Summoning @javitonino for prioritization

@rafatower
Copy link
Contributor

This was about the Import API. That looks related to SQL API batch queries, doesn't it?

true, my bad

@alrocar
Copy link
Contributor

alrocar commented Oct 1, 2019

We have a new way to import data via the COPY API + instead of just enabling CORS for the Import API, to use it in web applications we should think on proper OAuth support.

It's sad but 4 and half years later it's time to close this issue.

@alrocar alrocar closed this as completed Oct 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests