How to move webworkConfig out of inline JavaScript in templates/layouts/system.html.ep

Aperta
#2,761 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 4 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
18/100
Tipo di issue
Refactoring
Chiarezza
Da chiarire
Stato di attività
Tranquilla
Stack tecnologico
javascript, perl
Ambito
frontend, security

Direzione di ricerca

The inline script block that sets webworkConfig lives in templates/layouts/system.html.ep, and htdocs/js/System/system.js is the candidate home for the static part. The maintainer has not chosen an approach, so first decide how the URL value gets passed to the page, which is a design question. Done means the page works with a Content-Security-Policy that omits unsafe-inline for script-src.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

I am interested in getting the core WW2 functionality to work with a Content-Security-Policy which does not use unsafe-inline for script-src.

I'm not sure what is the best approach to replace the script block in templates/layouts/system.html.ep which sets the value of webworkConfig (and the value of webwork_url inside that object).

It seems one option would be to create a .js.ep template file, and have the controller handle requests for that file.

I'm not sure if it feasible to just add the standard value into htdocs/js/System/system.js and then somehow update that value if needed via a value passed in somehow in the HTML code (via a hidden form field?).

At present, I am working around this by using a hash value for the script block generated in the CSP. It could be that might remain the best approach, at least for now.

@drgrice1 Your advice on how to best approach this would be appreciated.

Lingua principale
Perl
Stelle
164
Fork
167
Merge medio
6g 7h
PR unite (30g)
27

Preparare l'ambiente

  • Include un Dockerfile o un file Docker Compose
  • Nessun modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di openwebwork/webwork2

Tutte le issue di openwebwork/webwork2

Issue simili

Altre issue su Perl

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.