Files
gitea/services/auth/source/oauth2
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
..
2026-08-24 18:26:10 +00:00