1
0
mirror of https://github.com/go-gitea/gitea.git synced 2025-04-29 20:25:17 +00:00
gitea/models/auth
wxiaoguang 0148d03f21
Enforce two-factor auth (2FA: TOTP or WebAuthn) ()
Fix 

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
..
access_token_scope_test.go Enable addtional linters () 2025-04-01 10:14:01 +00:00
access_token_scope.go Add new CLI flags to set name and scopes when creating a user with access token () 2025-04-02 22:00:54 +08:00
access_token_test.go Use db.Find instead of writing methods for every object () 2023-11-24 03:49:41 +00:00
access_token.go Use db.Find instead of writing methods for every object () 2023-11-24 03:49:41 +00:00
auth_token.go Unify password changing and invalidate auth tokens () 2024-02-04 14:05:26 +00:00
main_test.go make writing main test easier () 2023-09-28 01:38:53 +00:00
oauth2_list.go Use db.Find instead of writing methods for every object () 2023-11-24 03:49:41 +00:00
oauth2_test.go Enable testifylint rules () 2025-03-31 01:53:48 -04:00
oauth2.go add skip secondary authorization option for public oauth2 clients () 2024-07-19 14:28:30 -04:00
session.go Fix session key conflict with database keyword () 2023-12-27 15:24:23 +08:00
source_test.go Enforce two-factor auth (2FA: TOTP or WebAuthn) () 2025-04-28 15:31:59 -07:00
source.go Enforce two-factor auth (2FA: TOTP or WebAuthn) () 2025-04-28 15:31:59 -07:00
twofactor.go Enforce two-factor auth (2FA: TOTP or WebAuthn) () 2025-04-28 15:31:59 -07:00
webauthn_test.go Refactor tests () 2024-12-29 01:05:56 +00:00
webauthn.go Fix: passkey login not working anymore () 2024-11-26 16:04:17 +00:00