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

Abierto
#2,761 4 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 4 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
18/100
Tipo de issue
Refactorización
Claridad
Necesita aclaración
Estado de actividad
Tranquilo
Stack tecnológico
javascript, perl

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Perl
Estrellas
164
Forks
167
Merge medio
6 d 7 h
PR fusionados (30 d)
27

Preparar el entorno

  • Incluye un Dockerfile o un archivo de Docker Compose
  • Sin plantilla de pull request
  • Sin guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de openwebwork/webwork2

Todos los issues de openwebwork/webwork2

Issues similares

Más issues de Perl

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.