mirror of
https://github.com/QuantumNous/new-api.git
synced 2026-05-06 08:19:36 +00:00
feat: add oidc support
This commit is contained in:
@@ -35,6 +35,7 @@ func InitOptionMap() {
|
||||
common.OptionMap["PasswordRegisterEnabled"] = strconv.FormatBool(common.PasswordRegisterEnabled)
|
||||
common.OptionMap["EmailVerificationEnabled"] = strconv.FormatBool(common.EmailVerificationEnabled)
|
||||
common.OptionMap["GitHubOAuthEnabled"] = strconv.FormatBool(common.GitHubOAuthEnabled)
|
||||
common.OptionMap["OIDCEnabled"] = strconv.FormatBool(common.OIDCEnabled)
|
||||
common.OptionMap["LinuxDOOAuthEnabled"] = strconv.FormatBool(common.LinuxDOOAuthEnabled)
|
||||
common.OptionMap["TelegramOAuthEnabled"] = strconv.FormatBool(common.TelegramOAuthEnabled)
|
||||
common.OptionMap["WeChatAuthEnabled"] = strconv.FormatBool(common.WeChatAuthEnabled)
|
||||
@@ -77,6 +78,12 @@ func InitOptionMap() {
|
||||
common.OptionMap["Chats"] = setting.Chats2JsonString()
|
||||
common.OptionMap["GitHubClientId"] = ""
|
||||
common.OptionMap["GitHubClientSecret"] = ""
|
||||
common.OptionMap["OIDCClientId"] = ""
|
||||
common.OptionMap["OIDCClientSecret"] = ""
|
||||
common.OptionMap["OIDCWellKnown"] = ""
|
||||
common.OptionMap["OIDCAuthorizationEndpoint"] = ""
|
||||
common.OptionMap["OIDCTokenEndpoint"] = ""
|
||||
common.OptionMap["OIDCUserInfoEndpoint"] = ""
|
||||
common.OptionMap["TelegramBotToken"] = ""
|
||||
common.OptionMap["TelegramBotName"] = ""
|
||||
common.OptionMap["WeChatServerAddress"] = ""
|
||||
@@ -200,6 +207,8 @@ func updateOptionMap(key string, value string) (err error) {
|
||||
common.EmailVerificationEnabled = boolValue
|
||||
case "GitHubOAuthEnabled":
|
||||
common.GitHubOAuthEnabled = boolValue
|
||||
case "OIDCEnabled":
|
||||
common.OIDCEnabled = boolValue
|
||||
case "LinuxDOOAuthEnabled":
|
||||
common.LinuxDOOAuthEnabled = boolValue
|
||||
case "WeChatAuthEnabled":
|
||||
@@ -298,6 +307,18 @@ func updateOptionMap(key string, value string) (err error) {
|
||||
common.GitHubClientId = value
|
||||
case "GitHubClientSecret":
|
||||
common.GitHubClientSecret = value
|
||||
case "OIDCClientId":
|
||||
common.OIDCClientId = value
|
||||
case "OIDCClientSecret":
|
||||
common.OIDCClientSecret = value
|
||||
case "OIDCWellKnown":
|
||||
common.OIDCWellKnown = value
|
||||
case "OIDCAuthorizationEndpoint":
|
||||
common.OIDCAuthorizationEndpoint = value
|
||||
case "OIDCTokenEndpoint":
|
||||
common.OIDCTokenEndpoint = value
|
||||
case "OIDCUserInfoEndpoint":
|
||||
common.OIDCUserInfoEndpoint = value
|
||||
case "LinuxDOClientId":
|
||||
common.LinuxDOClientId = value
|
||||
case "LinuxDOClientSecret":
|
||||
|
||||
Reference in New Issue
Block a user