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

Che Theia - CORS issue when Theia IDE client side browser trying to reach Che master #11240

Closed
sunix opened this issue Sep 17, 2018 · 12 comments
Closed
Labels
kind/task Internal things, technical debt, and to-do tasks to be performed.

Comments

@sunix
Copy link
Contributor

sunix commented Sep 17, 2018

Description

It happens that in some cluster configuration, Che Theia IDE is not located in the same location and when we are trying to reach Che master API from the browser, we encounter CORS issue like

Failed to load https://che.openshift.io/api/factory/factorywj3405v4cnxdjmln: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://routecw4tc0mt-sutan-1-che.8a09.starter-us-east-2.openshiftapps.com' is therefore not allowed access. The response had HTTP status code 403.
@sunix
Copy link
Contributor Author

sunix commented Sep 17, 2018

I see 2 ways of fixing it:

  • somehow allow as origin all the possible cluster public url that a che master could have. That would be done dynamically according to Che configuration
  • create a dedicated proxy in Theia node side for all our Che API.

@l0rd
Copy link
Contributor

l0rd commented Sep 17, 2018

@sunix why is this happening for theia and was not with GWT based IDE? I mean none of the solutions you are proposing is ideal, why can't we do it the GWT way?

@sunix
Copy link
Contributor Author

sunix commented Sep 17, 2018

@l0rd GWT app was hosted by che master

@skabashnyuk
Copy link
Contributor

skabashnyuk commented Sep 17, 2018

@sunix sunix changed the title Che Theia - CORS issue when Theia IDE client side browser code trying to reach Che master Che Theia - CORS issue when Theia IDE client side browser trying to reach Che master Sep 17, 2018
@AndrienkoAleksandr
Copy link
Contributor

AndrienkoAleksandr commented Sep 17, 2018

@sunix Maybe we should create common component and reuse it #11072

@benoitf
Copy link
Contributor

benoitf commented Sep 17, 2018

I would say that if extensions were plug-ins, then they would call APIs from server-side and then it won't hit CORS.

So if extension is still mandatory, they should use a server-side service.
I'm not sure it is interesting to have a proxy service as extensions should not be used

@sunix
Copy link
Contributor Author

sunix commented Sep 17, 2018

@benoitf thanks so maybe we could start moving factory extension to a plugin. It has to be done sooner or later anyway.

@ashumilova
Copy link
Contributor

@sunix do we know which APIs are missing to convert factory extension to plugin?

@sunix
Copy link
Contributor Author

sunix commented Sep 17, 2018

@ashumilova

  1. retrieve the url query string to get the factory id
  2. execute a given task
  3. open a file
  4. some UI entry point for notifications
  5. git (clone, checkout)
  6. trigger when app is ready

@ashumilova ashumilova added kind/task Internal things, technical debt, and to-do tasks to be performed. sprint/current labels Oct 4, 2018
@evidolob
Copy link
Contributor

The problem should be fixed by #11306

@slemeur slemeur mentioned this issue Dec 11, 2018
69 tasks
@sunix
Copy link
Contributor Author

sunix commented Feb 13, 2019

It is fixed as far as I know

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/task Internal things, technical debt, and to-do tasks to be performed.
Projects
None yet
Development

No branches or pull requests

7 participants