Commit Graph
3 Commits
Author SHA1 Message Date
bircniandsilverwind c144668e59 fix(audit): record missing user and authentication events (#40317)
Several entry points change users, credentials or 2FA without writing an
audit event, while the equivalent web or service path does. This records
the existing actions on those paths:

- `user:create` for self sign-up, OAuth2 auto-registration, link-account
registration and `gitea admin user create`
- `user:accesstoken:add` for `gitea admin user generate-access-token`
and `user create --access-token`; `user:accesstoken:remove` for `DELETE
/api/v1/token`
- `user:twofactor:disable` for the admin "reset 2FA" option and `gitea
admin user disable-2fa`
- `user:key:ssh:add`, `user:key:gpg:add/remove` for the API
- `user:email:primary`, `user:email:activate`, `user:status:active` for
settings, the activation page/links and OAuth2 source sync deactivation
- `user:oauth2application:grant` when a grant's scope changes,
`user:externallogin:add` on registration via an external login
- `user:authentication:fail:twofactor` for wrong recovery codes, failed
WebAuthn assertions and 2FA during password reset

Should be backported to v28.

---------

Co-authored-by: silverwind <me@silverwind.io>
2026-11-15 20:42:12 +00:00
silverwind 8abda62312 test: consolidate Go tests (#39962)
Consolidate all Go tests. Coverage is identical to before. Go tests are
around 5% faster while being 7% smaller. No non-test code is touched.
2026-10-24 13:48:19 +00:00
TheFox0x7andwxiaoguang c6167d1ff5 feat(api): add token introspection and self-deletion endpoint (#37995)
Adds a /api/v1/token endpoint that allows tokens to introspect and
delete themselves.
partially fixes: https://github.com/go-gitea/gitea/issues/33583

Assisted-by: Mistral Vibe:mistral-medium-3.5

---------

Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-06-14 20:05:18 +02:00