gitea/routers/web
Denys Konovalov 63ab92d797
Pre-register OAuth2 applications for git credential helpers ()
This PR is an extended implementation of  and builds upon the
proposal by @hickford in , 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>
..
admin Pre-register OAuth2 applications for git credential helpers ()
auth Start using template context function ()
devtest Make "cancel" buttons have proper type in modal forms ()
events Implement FSFE REUSE for golang files ()
explore Replace `interface{}` with `any` ()
feed Add context parameter to some database functions ()
healthcheck Remove `db.DefaultContext` in `routers/` and `cmd/` ()
misc Serve pre-defined files in "public", add "security.txt", add CORS header for ".well-known" ()
org Move web JSON functions to web context and simplify code ()
repo Pre-register OAuth2 applications for git credential helpers ()
shared Do not show Profile README when repository is private ()
user Remove unnecessary template helper DisableGravatar ()
auth.go Implement FSFE REUSE for golang files ()
auth_windows.go Implement FSFE REUSE for golang files ()
base.go Fix all possible setting error related storages and added some tests ()
goget.go Support SSH for go get ()
home.go Refactor cookie ()
metrics.go Implement FSFE REUSE for golang files ()
nodeinfo.go Implement FSFE REUSE for golang files ()
swagger_json.go Start using template context function ()
web.go Allow package cleanup from admin page ()
webfinger.go Add a link to OpenID Issuer URL in WebFinger response ()