| Crates.io | tower-csrf |
| lib.rs | tower-csrf |
| version | 0.1.0 |
| created_at | 2025-09-02 09:10:08.905516+00 |
| updated_at | 2025-09-02 09:10:08.905516+00 |
| description | Go 1.25+ CSRF middleware port for Rust Tower |
| homepage | |
| repository | https://github.com/yawn/tower-csrf |
| max_upload_size | |
| id | 1820873 |
| size | 56,082 |
This is experimental middleware for tower. It has not received a formal audit.
It provides modern CSRF protection as outlined in a blogpost by Filippo Valsorda, discussing the research background for integrating CSRF protection in Go 1.25's net/http.
This repository has been discussed in tower and the axum project respectively.
This boils down to (quoting from the blog):
same-origin or none, allow the request, otherwise rejectSee tests/csrf.rs for an example using Axum.