forgejo/routers/web
Gusted 53df0bf9a4 chore(sec): unify usage of crypto/rand.Read (#7453)
- Unify the usage of [`crypto/rand.Read`](https://pkg.go.dev/crypto/rand#Read) to `util.CryptoRandomBytes`.
- Refactor `util.CryptoRandomBytes` to never return an error. It is documented by Go, https://go.dev/issue/66821, to always succeed. So if we still receive a error or if the returned bytes read is not equal to the expected bytes to be read we panic (just to be on the safe side).
- This simplifies a lot of code to no longer care about error handling.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7453
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-04-04 03:31:37 +00:00
..
admin Move ParseBool to optional (#33979) 2025-04-01 02:28:02 +02:00
auth chore(sec): unify usage of crypto/rand.Read (#7453) 2025-04-04 03:31:37 +00:00
devtest ui: improve error pages (#7274) 2025-03-28 19:50:43 +00:00
events chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
explore chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
feed chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
healthcheck chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
misc feat: include a default robots.txt to reduce the impact of crawlers (#7387) 2025-03-30 11:28:19 +00:00
org Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
repo fix: handle viewing a submodule entry (#7261) 2025-04-03 15:32:55 +00:00
shared chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
user chore(sec): unify usage of crypto/rand.Read (#7453) 2025-04-04 03:31:37 +00:00
base.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
githttp.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
goget.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
home.go ui: improve error pages (#7274) 2025-03-28 19:50:43 +00:00
metrics.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
nodeinfo.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
swagger_json.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
web.go Hide activity contributors, recent commits and code frequrency left tabs if there is no code permission (#34053) 2025-04-01 02:28:02 +02:00
webfinger.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00