فهرست منبع

Update field name

Tomas Dabasinskas 7 سال پیش
والد
کامیت
eb517a3791
2فایلهای تغییر یافته به همراه33 افزوده شده و 33 حذف شده
  1. 15 15
      pkg/setting/setting_oauth.go
  2. 18 18
      pkg/social/social.go

+ 15 - 15
pkg/setting/setting_oauth.go

@@ -1,21 +1,21 @@
 package setting
 
 type OAuthInfo struct {
-	ClientId, ClientSecret   string
-	Scopes                   []string
-	AuthUrl, TokenUrl        string
-	Enabled                  bool
-	EmailAttributeName       string
-	AllowedDomains           []string
-	HostedDomain             string
-	ApiUrl                   string
-	AllowSignup              bool
-	Name                     string
-	TlsClientCert            string
-	TlsClientKey             string
-	TlsClientCa              string
-	TlsSkipVerify            bool
-	BrokenAuthHeaderProvider bool
+	ClientId, ClientSecret       string
+	Scopes                       []string
+	AuthUrl, TokenUrl            string
+	Enabled                      bool
+	EmailAttributeName           string
+	AllowedDomains               []string
+	HostedDomain                 string
+	ApiUrl                       string
+	AllowSignup                  bool
+	Name                         string
+	TlsClientCert                string
+	TlsClientKey                 string
+	TlsClientCa                  string
+	TlsSkipVerify                bool
+	SendClientCredentialsViaPost bool
 }
 
 type OAuther struct {

+ 18 - 18
pkg/social/social.go

@@ -63,23 +63,23 @@ func NewOAuthService() {
 	for _, name := range allOauthes {
 		sec := setting.Raw.Section("auth." + name)
 		info := &setting.OAuthInfo{
-			ClientId:                 sec.Key("client_id").String(),
-			ClientSecret:             sec.Key("client_secret").String(),
-			Scopes:                   util.SplitString(sec.Key("scopes").String()),
-			AuthUrl:                  sec.Key("auth_url").String(),
-			TokenUrl:                 sec.Key("token_url").String(),
-			ApiUrl:                   sec.Key("api_url").String(),
-			Enabled:                  sec.Key("enabled").MustBool(),
-			EmailAttributeName:       sec.Key("email_attribute_name").String(),
-			AllowedDomains:           util.SplitString(sec.Key("allowed_domains").String()),
-			HostedDomain:             sec.Key("hosted_domain").String(),
-			AllowSignup:              sec.Key("allow_sign_up").MustBool(),
-			Name:                     sec.Key("name").MustString(name),
-			TlsClientCert:            sec.Key("tls_client_cert").String(),
-			TlsClientKey:             sec.Key("tls_client_key").String(),
-			TlsClientCa:              sec.Key("tls_client_ca").String(),
-			TlsSkipVerify:            sec.Key("tls_skip_verify_insecure").MustBool(),
-			BrokenAuthHeaderProvider: sec.Key("send_client_credentials_via_post").MustBool(),
+			ClientId:                     sec.Key("client_id").String(),
+			ClientSecret:                 sec.Key("client_secret").String(),
+			Scopes:                       util.SplitString(sec.Key("scopes").String()),
+			AuthUrl:                      sec.Key("auth_url").String(),
+			TokenUrl:                     sec.Key("token_url").String(),
+			ApiUrl:                       sec.Key("api_url").String(),
+			Enabled:                      sec.Key("enabled").MustBool(),
+			EmailAttributeName:           sec.Key("email_attribute_name").String(),
+			AllowedDomains:               util.SplitString(sec.Key("allowed_domains").String()),
+			HostedDomain:                 sec.Key("hosted_domain").String(),
+			AllowSignup:                  sec.Key("allow_sign_up").MustBool(),
+			Name:                         sec.Key("name").MustString(name),
+			TlsClientCert:                sec.Key("tls_client_cert").String(),
+			TlsClientKey:                 sec.Key("tls_client_key").String(),
+			TlsClientCa:                  sec.Key("tls_client_ca").String(),
+			TlsSkipVerify:                sec.Key("tls_skip_verify_insecure").MustBool(),
+			SendClientCredentialsViaPost: sec.Key("send_client_credentials_via_post").MustBool(),
 		}
 
 		if !info.Enabled {
@@ -87,7 +87,7 @@ func NewOAuthService() {
 		}
 
 		// handle the clients that do not properly support Basic auth headers and require passing client_id/client_secret via POST payload
-		if info.BrokenAuthHeaderProvider {
+		if info.SendClientCredentialsViaPost {
 			oauth2.RegisterBrokenAuthHeaderProvider(info.TokenUrl)
 		}