perf(X-Pack): Optimize OAuth2 customization logic (#478)

This commit is contained in:
fit2cloud-chenyw
2025-11-21 16:55:16 +08:00
committed by GitHub
parent c5ce41fdbf
commit 20ded06556
5 changed files with 27 additions and 4 deletions
+2 -1
View File
@@ -64,7 +64,8 @@ class Settings(BaseSettings):
LOG_DIR: str = "logs"
LOG_FORMAT: str = "%(asctime)s - %(name)s - %(levelname)s:%(lineno)d - %(message)s"
SQL_DEBUG: bool = False
BASE_DIR: str = "/opt/sqlbot"
SCRIPT_DIR: str = f"{BASE_DIR}/scripts"
UPLOAD_DIR: str = "/opt/sqlbot/data/file"
SQLBOT_KEY_EXPIRED: int = 100 # License key expiration timestamp, 0 means no expiration
+3 -1
View File
@@ -725,7 +725,9 @@
"userinfo_url": "User Info URL",
"token_url": "Token URL",
"revoke_url": "Revocation URL",
"oauth2_field_mapping_placeholder": "Example: {'{'}\"account\": \"OAuth2Account\", \"name\": \"OAuth2Name\", \"email\": \"email\"{'}'}"
"oauth2_field_mapping_placeholder": "Example: {'{'}\"account\": \"OAuth2Account\", \"name\": \"OAuth2Name\", \"email\": \"email\"{'}'}",
"token_auth_method": "Token auth method",
"userinfo_auth_method": "Userinfo auth method"
},
"login": {
"default_login": "Default",
+3 -1
View File
@@ -725,7 +725,9 @@
"userinfo_url": "사용자 정보 URL",
"token_url": "토큰 URL",
"revoke_url": "취소 URL",
"oauth2_field_mapping_placeholder": "예: {'{'}\"account\": \"OAuth2Account\", \"name\": \"OAuth2Name\", \"email\": \"email\"{'}'}"
"oauth2_field_mapping_placeholder": "예: {'{'}\"account\": \"OAuth2Account\", \"name\": \"OAuth2Name\", \"email\": \"email\"{'}'}",
"token_auth_method": "토큰 인증 방식",
"userinfo_auth_method": "사용자 정보 인증 방식"
},
"login": {
"default_login": "기본값",
+3 -1
View File
@@ -725,7 +725,9 @@
"userinfo_url": "用户信息地址",
"token_url": "令牌地址",
"revoke_url": "撤销地址",
"oauth2_field_mapping_placeholder": "例如:{'{'}\"account\": \"oauth2Account\", \"name\": \"oauth2Name\", \"email\": \"email\"{'}'}"
"oauth2_field_mapping_placeholder": "例如:{'{'}\"account\": \"oauth2Account\", \"name\": \"oauth2Name\", \"email\": \"email\"{'}'}",
"token_auth_method": "Token 认证方式",
"userinfo_auth_method": "用户信息认证方式"
},
"login": {
"default_login": "默认",
@@ -27,6 +27,8 @@ const state = reactive({
client_id: '',
client_secret: '',
redirect_url: '',
token_auth_method: 'basic',
userinfo_auth_method: 'header',
logout_redirect_url: '',
mapping: '',
}),
@@ -367,6 +369,20 @@ onBeforeMount(() => {
</el-radio-group>
</el-form-item> -->
<el-form-item :label="t('authentication.token_auth_method')" prop="token_auth_method">
<el-radio-group v-model="state.form.token_auth_method">
<el-radio value="basic">Basic</el-radio>
<el-radio value="body">Body</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item :label="t('authentication.userinfo_auth_method')" prop="userinfo_auth_method">
<el-radio-group v-model="state.form.userinfo_auth_method">
<el-radio value="header">Header</el-radio>
<el-radio value="query">Query</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
v-for="form_item in form_config_list"
:key="form_item.field"