diff options
author | Denys Konovalov <kontakt@denyskon.de> | 2023-08-09 14:24:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-09 14:24:07 +0200 |
commit | 63ab92d7971e4931e98f014f2c5385d2242fa780 (patch) | |
tree | 8e5aabe7ab6d1b24578fd49dc8d4fc0fe8fc2478 /routers/web/admin | |
parent | Make `user-content-* ` consistent with github (#26388) (diff) | |
download | forgejo-63ab92d7971e4931e98f014f2c5385d2242fa780.tar.xz forgejo-63ab92d7971e4931e98f014f2c5385d2242fa780.zip |
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>
Diffstat (limited to 'routers/web/admin')
-rw-r--r-- | routers/web/admin/applications.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/web/admin/applications.go b/routers/web/admin/applications.go index 7b27524340..b26912db48 100644 --- a/routers/web/admin/applications.go +++ b/routers/web/admin/applications.go @@ -39,7 +39,7 @@ func Applications(ctx *context.Context) { return } ctx.Data["Applications"] = apps - + ctx.Data["BuiltinApplications"] = auth.BuiltinApplications() ctx.HTML(http.StatusOK, tplSettingsApplications) } |