forgejo/services/auth
Gusted a76099ca94 fix: require password login for creation of new token
- The creation of new API tokens for users via the API is guarded behind
a extra check. This extra makes sure the user is authorized via the
reverse proxy method (if enabled) or via basic authorization.
- For, what seems to me, historical reasons the basic authorization also
handles logging in via the API token.
- This results in a API token (with `write:user` scope) or OAuth2 token
being able to create a new API token with escalated privileges.
- Add a new condition to this check to ensure the user logged in via
password.
- Change error to better indicate what went wrong.

(cherry picked from commit 85e839e21d)
2025-08-30 11:13:36 +00:00
..
source [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
additional_scopes_test.go tests additional grant scopes 2024-08-09 14:58:15 +02:00
auth.go [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
auth_test.go [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
basic.go fix: require password login for creation of new token 2025-08-30 11:13:36 +00:00
group.go [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
httpsign.go [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
interface.go [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
main_test.go [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
oauth2.go [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
oauth2_test.go [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
reverseproxy.go [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
reverseproxy_test.go [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
session.go [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
signin.go [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
source.go [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
sync.go [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00