fix: security & privacy (rate limiter fix, csrf session cookie, logout on server, drafts stale token passw, login timing, password over 72b, JWT_SECRET complexity, SMTP TLS, CSV export neutralised, fonts bundled, upload metadata, hourly cleanup job, privacy.md report)
This commit is contained in:
1 parent
e2812ee0b9
commit
ea98c5ec05
118 files changed
+3828
-130
No files matched your search
@@ -29,9 +29,10 @@ Package: `test` (black-box, alongside the existing `article_test.go` / `user_tes
|
||||
assert the returned user matches and `err` is `nil`.
|
||||
- `Authenticate("alice", "wrongpassword12")` with `fakeHasher.Compare` returning an error
|
||||
→ assert `errors.Is(err, user.ErrInvalidCredentials)` is `true`.
|
||||
- `Authenticate("bob", "hunter2example")` with no "bob" in the repo → assert
|
||||
`errors.Is(err, user.ErrUserNotFound)` is `true` and `fakeHasher`'s `Compare` was never
|
||||
invoked (record a `compareCalled` flag).
|
||||
- `Authenticate("bob", "hunter2example")` twice with no "bob" in the repo → assert
|
||||
`errors.Is(err, user.ErrUserNotFound)` is `true` each time, that `fakeHasher`'s `Compare`
|
||||
ran once per attempt (against the decoy hash), and that `Hash` ran exactly once overall
|
||||
(the decoy is computed lazily and reused).
|
||||
|
||||
## HTTP checks (real BcryptHasher, in-memory fake repo, mirroring api/router.go)
|
||||
8. Call `validator.InitValidator()`.
|
||||
|
||||
Reference in new issue
Block a user