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

Xtext tool cannot be used cross origin #68

Open
barnettwilliam opened this issue Apr 17, 2024 · 0 comments
Open

Xtext tool cannot be used cross origin #68

barnettwilliam opened this issue Apr 17, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@barnettwilliam
Copy link
Collaborator

Trying to use the Xtext tool service in a cross origin configuration editor instances autocompletion and validation do not work. This was seen when setting up the new ep.mde-network.org domain and trying to use the Xtext tool on mdenet-ep.sites.er.kcl.ac.uk/tools/xtext.

Until this issue is solved, it will not be possible to create an activity using the Xtext tool service from another education platform instance on a different domain. Workaround:

  • Run an instance of the Xtext tool service on the education platform domain
  • Run the activity on the education platform of the Xtext service

Details

Configuring the Xtext tool services Access-Control-Allow-Origin headers to allow all origins in the following places the editor instances autocompletion and validation do not work due to CORS errors.

  • in editor server in header text/editorserver/src/config.js and for the tool static files hosted on the editor server tomcat
  • in xtext/acemodebundler/web.xml

(There is a separate issue to use environment variables to configure these #38). .

Things to look into

  1. How the editor instance java service's CORS header is set and see if there is a way to set it to all origins "*". The cors origin value may be being derived from the createEditor() parameter baseUrl and serviceUrl in which case require changes as per 3 alternatively there may be a way to override this in the generated java service war in web.xml similar to how CORS setttings are being set in xtext/acemodebundler/web.xml or even globally overriding this globally in the editor server tomcat config.

  2. Another thing I suspect would be the Xtext web editor createEditor() method that is called in XtextEditorPanel.initialize(). We may not be calling createEditor() correctly as per the documentation there are lots of options and there may also be some undocumented behaviour, so changing the parameters may be able get fully stateless working.

  3. If something if something identifiable in createEditor() is preventing this from working it would be possible to customise it in platform/src/xtext/2.31.0/xtext-ace.js

  4. Bigger changes would be to try different editors or Xtext's LSP.

@barnettwilliam barnettwilliam added the bug Something isn't working label Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant