gitea/routers/web/admin
wxiaoguang 0148d03f21
Enforce two-factor auth (2FA: TOTP or WebAuthn) (#34187)
Fix #880

Design:

1. A global setting `security.TWO_FACTOR_AUTH`.
* To support org-level config, we need to introduce a better "owner
setting" system first (in the future)
2. A user without 2FA can login and may explore, but can NOT read or
write to any repositories via API/web.
3. Keep things as simple as possible.
* This option only aggressively suggest users to enable their 2FA at the
moment, it does NOT guarantee that users must have 2FA before all other
operations, it should be good enough for real world use cases.
* Some details and tests could be improved in the future since this
change only adds a check and seems won't affect too much.

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2025-04-28 15:31:59 -07:00
..
admin.go Support performance trace (#32973) 2025-01-21 18:57:07 +00:00
admin_test.go Make public URL generation configurable (#34250) 2025-04-22 06:49:37 +08:00
applications.go Enable addtional linters (#34085) 2025-04-01 10:14:01 +00:00
auths.go Enforce two-factor auth (2FA: TOTP or WebAuthn) (#34187) 2025-04-28 15:31:59 -07:00
config.go Refactor template & test related code (#32938) 2024-12-22 15:33:19 +00:00
diagnosis.go Support performance trace (#32973) 2025-01-21 18:57:07 +00:00
emails.go Refactor error system (#33610) 2025-02-16 22:13:17 -08:00
hooks.go Refactor template & test related code (#32938) 2024-12-22 15:33:19 +00:00
main_test.go make writing main test easier (#27270) 2023-09-28 01:38:53 +00:00
notice.go Refactor template & test related code (#32938) 2024-12-22 15:33:19 +00:00
orgs.go Refactor template & test related code (#32938) 2024-12-22 15:33:19 +00:00
packages.go Refactor pagination (#33037) 2024-12-30 01:57:38 +00:00
perftrace.go Support performance trace (#32973) 2025-01-21 18:57:07 +00:00
queue.go Move admin routers from /admin to /-/admin (#32189) 2024-10-10 04:56:49 +00:00
queue_tester.go Improve queue and logger context (#24924) 2023-05-26 07:31:55 +00:00
repos.go Refactor pagination (#33037) 2024-12-30 01:57:38 +00:00
runners.go Move admin routers from /admin to /-/admin (#32189) 2024-10-10 04:56:49 +00:00
stacktrace.go Support performance trace (#32973) 2025-01-21 18:57:07 +00:00
users.go Move ParseBool to optional (#33979) 2025-03-24 03:53:30 +00:00
users_test.go Move context from modules to services (#29440) 2024-02-27 08:12:22 +01:00