~bigbes/sr-ht-ecore

ref: 34cf83d43d19071055e7e7593d0646519771e625 sr-ht-ecore/csrf/csrf_test.go -rw-r--r-- 11.7 KiB
ede9467a — Eugene Blikh 10 days ago
csrf: the shared same-origin guard

Five services carried their own copy of the Origin/Referer check and the
copies had drifted, not only in wording: tokens, cover and bench apply it
as router-wide middleware, while dolt and specs call a predicate from
individual handlers, so a form added to either of those goes out
unguarded. Require is therefore the API this package leads with, and
SameOrigin is the escape hatch for a service migrating one route at a
time.