Skip to content

Commit f11bdff

Browse files
committed
Pre-register OAuth application for gh-tea
1 parent fcfe1fb commit f11bdff

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

custom/conf/app.example.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,8 @@ ENABLED = true
581581
;; * https://github.com/hickford/git-credential-oauth
582582
;; * https://github.com/git-ecosystem/git-credential-manager
583583
;; * https://gitea.com/gitea/tea
584-
;DEFAULT_APPLICATIONS = git-credential-oauth, git-credential-manager, tea
584+
;; * https://github.com/hiifong/gh-tea
585+
;DEFAULT_APPLICATIONS = git-credential-oauth, git-credential-manager, tea, gh-tea
585586

586587
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
587588
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

models/auth/oauth2.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@ func BuiltinApplications() map[string]*BuiltinOAuth2Application {
7373
DisplayName: "tea",
7474
RedirectURIs: []string{"http://127.0.0.1", "https://127.0.0.1"},
7575
}
76+
m["9c0c7633-de85-4b51-938b-9fabc8cb7099"] = &BuiltinOAuth2Application{
77+
ConfigName: "gh-tea",
78+
DisplayName: "gh-tea",
79+
RedirectURIs: []string{"http://127.0.0.1", "https://127.0.0.1"},
80+
}
7681
return m
7782
}
7883

modules/setting/oauth2.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ var OAuth2 = struct {
106106
JWTSigningAlgorithm: "RS256",
107107
JWTSigningPrivateKeyFile: "jwt/private.pem",
108108
MaxTokenLength: math.MaxInt16,
109-
DefaultApplications: []string{"git-credential-oauth", "git-credential-manager", "tea"},
109+
DefaultApplications: []string{"git-credential-oauth", "git-credential-manager", "tea", "gh-tea"},
110110
}
111111

112112
func loadOAuth2From(rootCfg ConfigProvider) {

modules/setting/oauth2_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func TestGetGeneralSigningSecretSave(t *testing.T) {
6262
func TestOauth2DefaultApplications(t *testing.T) {
6363
cfg, _ := NewConfigProviderFromData(``)
6464
loadOAuth2From(cfg)
65-
assert.Equal(t, []string{"git-credential-oauth", "git-credential-manager", "tea"}, OAuth2.DefaultApplications)
65+
assert.Equal(t, []string{"git-credential-oauth", "git-credential-manager", "tea", "gh-tea"}, OAuth2.DefaultApplications)
6666

6767
cfg, _ = NewConfigProviderFromData(`[oauth2]
6868
DEFAULT_APPLICATIONS = tea

0 commit comments

Comments
 (0)