Found in the hands-on acceptance test of next (092176d), #356.
Steps
Run pixa with debug off, as the example config configs/config.example.yml has it.
Open http://localhost:8080/ in a browser, type the signing key, press Login.
What happened
The browser shows a bare text page, Forbidden - origin invalid, status 403.
The origin is the page's own. The real cause is that the page was opened over plain HTTP while debug is off.
pixa logs nothing but the request line with status 403.
Other refusals answer the same way: a missing or stale form token gives Forbidden - CSRF token invalid.
These texts are the defaults of gorilla/csrf, the form-token library. internal/handlers/csrf.go builds its middleware without csrf.ErrorHandler.
What should happen
A refused form still answers 403, with a page that names the cause and what to do:
page opened over plain HTTP with debug off: open it over HTTPS, or turn debug on for plain HTTP on your own machine;
form from another host than the Host header: the reverse proxy must pass Host on unchanged;
missing or stale token: reload the page and submit again.
pixa logs a warning with the request ID and the cause (csrf.FailureReason).
Model: opus-5-5
Found in the hands-on acceptance test of `next` (`092176d`), https://git.eeqj.de/sneak/pixa/issues/356.
## Steps
1. Run pixa with `debug` off, as the example config `configs/config.example.yml` has it.
2. Open `http://localhost:8080/` in a browser, type the signing key, press Login.
## What happened
- The browser shows a bare text page, `Forbidden - origin invalid`, status 403.
- The origin is the page's own. The real cause is that the page was opened over plain HTTP while `debug` is off.
- pixa logs nothing but the request line with status 403.
- Other refusals answer the same way: a missing or stale form token gives `Forbidden - CSRF token invalid`.
These texts are the defaults of `gorilla/csrf`, the form-token library. `internal/handlers/csrf.go` builds its middleware without `csrf.ErrorHandler`.
## What should happen
- A refused form still answers 403, with a page that names the cause and what to do:
- page opened over plain HTTP with `debug` off: open it over HTTPS, or turn `debug` on for plain HTTP on your own machine;
- form from another host than the `Host` header: the reverse proxy must pass `Host` on unchanged;
- missing or stale token: reload the page and submit again.
- pixa logs a warning with the request ID and the cause (`csrf.FailureReason`).
Model: opus-5-5
A refused form now gets a 403 page naming the cause and what to do, and pixa logs a form refused warning with the request ID and reason. Two more causes are named than the issue lists: HTTPS while debug is on, and a form with neither Origin nor Referer.
Model: opus-5-5
PR: https://git.eeqj.de/sneak/pixa/pulls/365, branch `issue-358-name-form-refusal-cause`.
A refused form now gets a 403 page naming the cause and what to do, and pixa logs a `form refused` warning with the request ID and reason. Two more causes are named than the issue lists: HTTPS while `debug` is on, and a form with neither `Origin` nor `Referer`.
Model: opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Found in the hands-on acceptance test of
next(092176d), #356.Steps
debugoff, as the example configconfigs/config.example.ymlhas it.http://localhost:8080/in a browser, type the signing key, press Login.What happened
Forbidden - origin invalid, status 403.debugis off.Forbidden - CSRF token invalid.These texts are the defaults of
gorilla/csrf, the form-token library.internal/handlers/csrf.gobuilds its middleware withoutcsrf.ErrorHandler.What should happen
debugoff: open it over HTTPS, or turndebugon for plain HTTP on your own machine;Hostheader: the reverse proxy must passHoston unchanged;csrf.FailureReason).Model: opus-5-5
PR: #365, branch
issue-358-name-form-refusal-cause.A refused form now gets a 403 page naming the cause and what to do, and pixa logs a
form refusedwarning with the request ID and reason. Two more causes are named than the issue lists: HTTPS whiledebugis on, and a form with neitherOriginnorReferer.Model: opus-5-5