0
0
mirror of https://github.com/go-gitea/gitea.git synced 2025-01-19 09:06:20 +01:00
gitea/routers/web
Denys Konovalov 63ab92d797
Pre-register OAuth2 applications for git credential helpers (#26291)
This PR is an extended implementation of #25189 and builds upon the
proposal by @hickford in #25653, utilizing some ideas proposed
internally by @wxiaoguang.

Mainly, this PR consists of a mechanism to pre-register OAuth2
applications on startup, which can be enabled or disabled by modifying
the `[oauth2].DEFAULT_APPLICATIONS` parameter in app.ini. The OAuth2
applications registered this way are being marked as "locked" and
neither be deleted nor edited over UI to prevent confusing/unexpected
behavior. Instead, they're being removed if no longer enabled in config.


![grafik](https://github.com/go-gitea/gitea/assets/47871822/81a78b1c-4b68-40a7-9e99-c272ebb8f62e)

The implemented mechanism can also be used to pre-register other OAuth2
applications in the future, if wanted.

Co-authored-by: hickford <mirth.hickford@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>

---------

Co-authored-by: M Hickford <mirth.hickford@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-08-09 14:24:07 +02:00
..
admin Pre-register OAuth2 applications for git credential helpers (#26291) 2023-08-09 14:24:07 +02:00
auth Start using template context function (#26254) 2023-08-08 01:22:47 +00:00
devtest
events
explore
feed Add context parameter to some database functions (#26055) 2023-07-22 22:14:27 +08:00
healthcheck Remove db.DefaultContext in routers/ and cmd/ (#26076) 2023-07-23 23:47:27 -04:00
misc
org Move web JSON functions to web context and simplify code (#26132) 2023-07-26 06:04:01 +00:00
repo Pre-register OAuth2 applications for git credential helpers (#26291) 2023-08-09 14:24:07 +02:00
shared Do not show Profile README when repository is private (#26295) 2023-08-04 14:45:33 +00:00
user Remove unnecessary template helper DisableGravatar (#26386) 2023-08-08 08:29:14 +00:00
auth_windows.go
auth.go
base.go
goget.go
home.go
metrics.go
nodeinfo.go
swagger_json.go Start using template context function (#26254) 2023-08-08 01:22:47 +00:00
web.go Allow package cleanup from admin page (#25307) 2023-08-08 00:46:10 +00:00
webfinger.go