Commit 75dc1ae
committed
security: rate-limit /auth/refresh
Refresh is unauthenticated (expired/absent access token) and rotates sessions
but had no rate limiter, so a stolen refresh token could be hammered. Add a
per-IP limiter (login thresholds, own bucket), matching login/register.
NOTE: full refresh-token reuse detection (revoke the session family when an
already-rotated token is presented) is deferred — it needs a session-family
tombstone migration + raw-pgx repo changes on the auth hot path, which warrant
integration testing against a real DB. Token-at-rest hashing (done) already
removes the DB-leak theft vector.1 parent 223387b commit 75dc1ae
1 file changed
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
158 | 165 | | |
159 | 166 | | |
160 | 167 | | |
| |||
173 | 180 | | |
174 | 181 | | |
175 | 182 | | |
176 | | - | |
| 183 | + | |
177 | 184 | | |
178 | 185 | | |
179 | 186 | | |
| |||
0 commit comments