google / google/gae-secure-scaffold-python3
Document how to use CSRF with SPAs
- Vorherrschende Sprache
- Python
- Sterne
- 35
- Forks
- 19
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
Please document how to use this secure scaffold with single page applications, e.g. Angular and React SPAs. These would typically serve the static HTML directly from AppEngine (not through Python templating), which makes it impossible to inject the CSRF token. To make things more complicated, the CSRF token can also not be read from client-side JavaScript, because the secure scaffold defaults set the cookie to `HttpOnly`.
As far as I can tell, setting the cookie to `HttpOnly` does not add to the protection in a major way - e.g. see https://docs.djangoproject.com/en/3.0/ref/settings/#csrf-cookie-httponly.
Beitragsleitfaden
Rechercherichtung
Beginnen Sie mit der Überprüfung, wie das secure scaffold CSRF für statisches HTML, das von AppEngine ausgeliefert wird, für Python-vorlagenbasierte Seiten und für clientseitiges JavaScript konfiguriert. Vergleichen Sie das Verhalten des HttpOnly-Cookies mit der verlinkten Django-Anleitung und dokumentieren Sie praktikable CSRF-Nutzung für Angular- und React-SPAs, einschließlich dessen, was Benutzer erwarten sollten, wenn das Token nicht injiziert oder gelesen werden kann.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- angular, python, react
- Bereich
- documentation, security
- Issue-Typ
- Dokumentation
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 45/100