This is an automated email from the ASF dual-hosted git repository.
kinghao pushed a commit to branch release-1.8.0-rc1
in repository https://gitbox.apache.org/repos/asf/linkis.git
The following commit(s) were added to refs/heads/release-1.8.0-rc1 by this push:
new b0ddf3b4ef fix token security
b0ddf3b4ef is described below
commit b0ddf3b4ef56e85e5bbf5f1413038401cc2ef72a
Author: aiceflower <[email protected]>
AuthorDate: Wed Oct 1 16:18:46 2025 +0800
fix token security
---
.../apache/linkis/common/conf/Configuration.scala | 2 +-
.../src/test/resources/conf/linkis-cli.properties | 2 +-
.../src/test/resources/linkis-cli.properties | 2 +-
.../linkis/ujes/client/JobObserveActionTest.scala | 4 +-
linkis-dist/bin/install.sh | 100 +++++++++++++++++----
.../linkis/templates/configmap-init-sql.yaml | 4 +-
.../linkis/templates/configmap-linkis-config.yaml | 4 +-
linkis-dist/package/admin/configuration_helper.sh | 6 +-
.../package/conf/linkis-cli/linkis-cli.properties | 2 +-
linkis-dist/package/conf/linkis.properties | 18 ++--
linkis-dist/package/db/linkis_dml.sql | 14 +--
linkis-dist/package/db/linkis_dml_pg.sql | 12 +--
linkis-dist/package/db/module/linkis-mg.sql | 17 +---
.../gateway/authentication/dao/TokenDaoTest.java | 4 +-
.../service/CachedTokenServiceTest.java | 3 +-
.../src/test/resources/create.sql | 8 +-
.../src/test/resources/create_pg.sql | 7 +-
17 files changed, 126 insertions(+), 83 deletions(-)
diff --git
a/linkis-commons/linkis-common/src/main/scala/org/apache/linkis/common/conf/Configuration.scala
b/linkis-commons/linkis-common/src/main/scala/org/apache/linkis/common/conf/Configuration.scala
index 822bc2aa07..16cac1d204 100644
---
a/linkis-commons/linkis-common/src/main/scala/org/apache/linkis/common/conf/Configuration.scala
+++
b/linkis-commons/linkis-common/src/main/scala/org/apache/linkis/common/conf/Configuration.scala
@@ -81,7 +81,7 @@ object Configuration extends Logging {
"The request interface %s is abnormal. You can try to troubleshoot
common problems in the knowledge base document"
)
- val LINKIS_TOKEN = CommonVars("wds.linkis.token", "LINKIS-AUTH")
+ val LINKIS_TOKEN = CommonVars("wds.linkis.token", "")
val GLOBAL_CONF_CHN_NAME = "全局设置"
diff --git
a/linkis-computation-governance/linkis-client/linkis-cli/src/test/resources/conf/linkis-cli.properties
b/linkis-computation-governance/linkis-client/linkis-cli/src/test/resources/conf/linkis-cli.properties
index a792c9ef69..699b1d4093 100644
---
a/linkis-computation-governance/linkis-client/linkis-cli/src/test/resources/conf/linkis-cli.properties
+++
b/linkis-computation-governance/linkis-client/linkis-cli/src/test/resources/conf/linkis-cli.properties
@@ -17,7 +17,7 @@ wds.linkis.client.common.creator=LINKISCLI
wds.linkis.client.common.gatewayUrl=http://127.0.0.1:9001
wds.linkis.client.common.authStrategy=token
wds.linkis.client.common.tokenKey=Validation-Code
-wds.linkis.client.common.tokenValue=LINKIS-AUTH
+wds.linkis.client.common.tokenValue=LINKIS-UNAVAILABLE-TOKEN
wds.linkis.client.noncustomizable.enable.user.specification=true
#wds.linkis.client.noncustomizable.enable.proxy.user=true
#wds.linkis.client.common.submitUser
diff --git
a/linkis-computation-governance/linkis-client/linkis-cli/src/test/resources/linkis-cli.properties
b/linkis-computation-governance/linkis-client/linkis-cli/src/test/resources/linkis-cli.properties
index 8d20858645..7cd0d129ea 100644
---
a/linkis-computation-governance/linkis-client/linkis-cli/src/test/resources/linkis-cli.properties
+++
b/linkis-computation-governance/linkis-client/linkis-cli/src/test/resources/linkis-cli.properties
@@ -17,7 +17,7 @@
wds.linkis.client.common.gatewayUrl=http://127.0.0.1:9001
wds.linkis.client.common.authStrategy=token
wds.linkis.client.common.tokenKey=Validation-Code
-wds.linkis.client.common.tokenValue=LINKIS-AUTH
+wds.linkis.client.common.tokenValue=LINKIS-UNAVAILABLE-TOKEN
#
#wds.linkis.client.common.submitUser
#wds.linkis.client.common.submitPassword
diff --git
a/linkis-computation-governance/linkis-client/linkis-computation-client/src/test/java/org/apache/linkis/ujes/client/JobObserveActionTest.scala
b/linkis-computation-governance/linkis-client/linkis-computation-client/src/test/java/org/apache/linkis/ujes/client/JobObserveActionTest.scala
index 1dec59387f..7a4c3bb106 100644
---
a/linkis-computation-governance/linkis-client/linkis-computation-client/src/test/java/org/apache/linkis/ujes/client/JobObserveActionTest.scala
+++
b/linkis-computation-governance/linkis-client/linkis-computation-client/src/test/java/org/apache/linkis/ujes/client/JobObserveActionTest.scala
@@ -18,7 +18,7 @@
package org.apache.linkis.ujes.client
import org.apache.commons.io.IOUtils
-import org.apache.linkis.common.conf.CommonVars
+import org.apache.linkis.common.conf.{CommonVars, Configuration}
import
org.apache.linkis.httpclient.dws.authentication.{StaticAuthenticationStrategy,
TokenAuthenticationStrategy}
import org.apache.linkis.httpclient.dws.config.{DWSClientConfig,
DWSClientConfigBuilder}
import org.apache.linkis.ujes.client.request.{EmsListAction, JobExecuteAction,
JobObserveAction, ResultSetAction}
@@ -29,7 +29,7 @@ import java.util.concurrent.TimeUnit
@Deprecated
object JobObserveActionTest extends App {
- val bmlToken = CommonVars("wds.linkis.bml.auth.token.value",
"LINKIS-AUTH").getValue
+ val bmlToken = CommonVars("wds.linkis.bml.auth.token.value",
Configuration.LINKIS_TOKEN.getValue).getValue
val clientConfig = DWSClientConfigBuilder.newBuilder()
.addServerUrl("127.0.0.1:9001") // Change to test gateway address
diff --git a/linkis-dist/bin/install.sh b/linkis-dist/bin/install.sh
index 299308f9ce..a103d1bf57 100644
--- a/linkis-dist/bin/install.sh
+++ b/linkis-dist/bin/install.sh
@@ -124,17 +124,34 @@ cp ${LINKIS_DB_CONFIG_PATH} $LINKIS_HOME/conf
common_conf=$LINKIS_HOME/conf/linkis.properties
-RANDOM_BML_TOKEN="LINKIS-`cat /proc/sys/kernel/random/uuid | awk -F- '{print
$1$2$3$4$5}'`"
-RANDOM_WS_TOKEN="WS-`cat /proc/sys/kernel/random/uuid | awk -F- '{print
$1$2$3$4$5}'`"
-RANDOM_DSM_TOKEN="DSM-`cat /proc/sys/kernel/random/uuid | awk -F- '{print
$1$2$3$4$5}'`"
-RANDOM_DSS_TOKEN="DSS-`cat /proc/sys/kernel/random/uuid | awk -F- '{print
$1$2$3$4$5}'`"
-RANDOM_QUALITIS_TOKEN="QUALITIS-`cat /proc/sys/kernel/random/uuid | awk -F-
'{print $1$2$3$4$5}'`"
-RANDOM_VALIDATOR_TOKEN="VALIDATOR-`cat /proc/sys/kernel/random/uuid | awk -F-
'{print $1$2$3$4$5}'`"
-if [ $DEBUG_MODE != "true" ];then
- sed -i ${txt} "s#LINKIS-AUTH#$RANDOM_BML_TOKEN#g"
$LINKIS_HOME/conf/linkis-cli/linkis-cli.properties
- sed -i ${txt} "s#LINKIS-AUTH#$RANDOM_BML_TOKEN#g" $common_conf
- sed -i ${txt} "s#LINKIS-AUTH#$RANDOM_BML_TOKEN#g"
$LINKIS_HOME/admin/configuration_helper.sh
-fi
+echo "======= SECURITY: Generating secure random tokens =========="
+
+# SECURITY: Generate secure random tokens for all services using new secure
placeholders
+LINKIS_GATEWAY_TOKEN="LINKIS-`cat /proc/sys/kernel/random/uuid | awk -F-
'{print $1$2$3$4$5}'`"
+WS_SERVICE_TOKEN="WS-`cat /proc/sys/kernel/random/uuid | awk -F- '{print
$1$2$3$4$5}'`"
+DSM_SERVICE_TOKEN="DSM-`cat /proc/sys/kernel/random/uuid | awk -F- '{print
$1$2$3$4$5}'`"
+DSS_SERVICE_TOKEN="DSS-`cat /proc/sys/kernel/random/uuid | awk -F- '{print
$1$2$3$4$5}'`"
+QUALITIS_SERVICE_TOKEN="QUALITIS-`cat /proc/sys/kernel/random/uuid | awk -F-
'{print $1$2$3$4$5}'`"
+VALIDATOR_SERVICE_TOKEN="VALIDATOR-`cat /proc/sys/kernel/random/uuid | awk -F-
'{print $1$2$3$4$5}'`"
+CLI_SERVICE_TOKEN="CLI-`cat /proc/sys/kernel/random/uuid | awk -F- '{print
$1$2$3$4$5}'`"
+
+# SECURITY: Set secure user and host restrictions (no wildcards)
+echo "Generated secure tokens:"
+echo "- LINKIS Gateway Token: $LINKIS_GATEWAY_TOKEN"
+echo "- WS Service Token: $WS_SERVICE_TOKEN"
+echo "- DSM Service Token: $DSM_SERVICE_TOKEN"
+echo "- DSS Service Token: $DSS_SERVICE_TOKEN"
+echo "- QUALITIS Service Token: $QUALITIS_SERVICE_TOKEN"
+echo "- VALIDATOR Service Token: $VALIDATOR_SERVICE_TOKEN"
+echo "- CLI Service Token: $CLI_SERVICE_TOKEN"
+
+# SECURITY: Replace secure placeholders in all configuration files
+echo "Replacing secure placeholders in configuration files..."
+sed -i ${txt} "s#LINKIS-UNAVAILABLE-TOKEN#$LINKIS_GATEWAY_TOKEN#g"
$LINKIS_HOME/conf/linkis-cli/linkis-cli.properties 2>/dev/null || true
+sed -i ${txt} "s#CLI-UNAVAILABLE-TOKEN#$CLI_SERVICE_TOKEN#g"
$LINKIS_HOME/conf/linkis-cli/linkis-cli.properties 2>/dev/null || true
+sed -i ${txt} "s#LINKIS-UNAVAILABLE-TOKEN#$LINKIS_GATEWAY_TOKEN#g"
$common_conf 2>/dev/null || true
+sed -i ${txt} "s#DSM-UNAVAILABLE-TOKEN#$DSM_SERVICE_TOKEN#g" $common_conf
2>/dev/null || true
+sed -i ${txt} "s#LINKIS-UNAVAILABLE-TOKEN#$LINKIS_GATEWAY_TOKEN#g"
$LINKIS_HOME/admin/configuration_helper.sh 2>/dev/null || true
echo "======= Step 3: Create necessary directory =========="
@@ -219,13 +236,60 @@ dml_file_name=linkis_dml.sql
if [[ 'postgresql' = "$dbType" ]];then
dml_file_name=linkis_dml_pg.sql
fi
-if [ $DEBUG_MODE != "true" ];then
- sed -i ${txt} "s#LINKIS-AUTH#$RANDOM_BML_TOKEN#g"
$LINKIS_HOME/db/${dml_file_name}
- sed -i ${txt} "s#WS-AUTH#$RANDOM_WS_TOKEN#g"
$LINKIS_HOME/db/${dml_file_name}
- sed -i ${txt} "s#DSM-AUTH#$RANDOM_DSM_TOKEN#g"
$LINKIS_HOME/db/${dml_file_name}
- sed -i ${txt} "s#DSS-AUTH#$RANDOM_DSS_TOKEN#g"
$LINKIS_HOME/db/${dml_file_name}
- sed -i ${txt} "s#QUALITIS-AUTH#$RANDOM_QUALITIS_TOKEN#g"
$LINKIS_HOME/db/${dml_file_name}
- sed -i ${txt} "s#VALIDATOR-AUTH#$RANDOM_VALIDATOR_TOKEN#g"
$LINKIS_HOME/db/${dml_file_name}
+echo "======= SECURITY: Replacing database placeholders with secure tokens
=========="
+
+# SECURITY: Replace secure placeholders in database initialization file
+echo "Replacing secure placeholders in database file:
$LINKIS_HOME/db/${dml_file_name}"
+sed -i ${txt} "s#{{LINKIS_GATEWAY_TOKEN}}#$LINKIS_GATEWAY_TOKEN#g"
$LINKIS_HOME/db/${dml_file_name} 2>/dev/null || true
+sed -i ${txt} "s#{{WS_SERVICE_TOKEN}}#$WS_SERVICE_TOKEN#g"
$LINKIS_HOME/db/${dml_file_name} 2>/dev/null || true
+sed -i ${txt} "s#{{DSM_SERVICE_TOKEN}}#$DSM_SERVICE_TOKEN#g"
$LINKIS_HOME/db/${dml_file_name} 2>/dev/null || true
+sed -i ${txt} "s#{{DSS_SERVICE_TOKEN}}#$DSS_SERVICE_TOKEN#g"
$LINKIS_HOME/db/${dml_file_name} 2>/dev/null || true
+sed -i ${txt} "s#{{QUALITIS_SERVICE_TOKEN}}#$QUALITIS_SERVICE_TOKEN#g"
$LINKIS_HOME/db/${dml_file_name} 2>/dev/null || true
+sed -i ${txt} "s#{{VALIDATOR_SERVICE_TOKEN}}#$VALIDATOR_SERVICE_TOKEN#g"
$LINKIS_HOME/db/${dml_file_name} 2>/dev/null || true
+sed -i ${txt} "s#{{CLI_SERVICE_TOKEN}}#$CLI_SERVICE_TOKEN#g"
$LINKIS_HOME/db/${dml_file_name} 2>/dev/null || true
+# Replace old insecure placeholder token with secure gateway token
+sed -i ${txt} "s#LINKIS-UNAVAILABLE-TOKEN#$LINKIS_GATEWAY_TOKEN#g"
$LINKIS_HOME/db/${dml_file_name} 2>/dev/null || true
+
+# SECURITY: Replace user and host placeholders with secure values
+sed -i ${txt} "s#{{LINKIS_GATEWAY_USER}}#$LINKIS_GATEWAY_USER#g"
$LINKIS_HOME/db/${dml_file_name} 2>/dev/null || true
+sed -i ${txt} "s#{{LINKIS_GATEWAY_HOST}}#$LINKIS_GATEWAY_HOST#g"
$LINKIS_HOME/db/${dml_file_name} 2>/dev/null || true
+
+echo "Database placeholder replacement completed."
+
+# SECURITY: Final verification - check for unreplaced placeholders
+remaining_placeholders=$(grep -o "{{[^}]*}}" $LINKIS_HOME/db/${dml_file_name}
2>/dev/null | wc -l)
+if [ $remaining_placeholders -gt 0 ]; then
+ echo "WARNING: Found $remaining_placeholders unreplaced placeholders in
database file!"
+ echo "SECURITY RISK: Please review $LINKIS_HOME/db/${dml_file_name}
manually."
+ grep "{{[^}]*}}" $LINKIS_HOME/db/${dml_file_name} 2>/dev/null || true
+else
+ echo "SUCCESS: All security placeholders in database file have been replaced
with secure tokens."
+fi
+
+# SECURITY: Check for any remaining old insecure tokens
+old_tokens=$(grep -o
"LINKIS-AUTH\|WS-AUTH\|DSS-AUTH\|QUALITIS-AUTH\|VALIDATOR-AUTH\|LINKISCLI-AUTH\|DSM-AUTH\|LINKIS-UNAVAILABLE-TOKEN"
$LINKIS_HOME/db/${dml_file_name} 2>/dev/null | wc -l)
+if [ $old_tokens -gt 0 ]; then
+ echo "CRITICAL: Found $old_tokens old insecure tokens still in database
file!"
+ echo "These should have been replaced with secure placeholders. Please check
the file manually."
+ grep -o
"LINKIS-AUTH\|WS-AUTH\|DSS-AUTH\|QUALITIS-AUTH\|VALIDATOR-AUTH\|LINKISCLI-AUTH\|DSM-AUTH\|LINKIS-UNAVAILABLE-TOKEN"
$LINKIS_HOME/db/${dml_file_name} 2>/dev/null || true
+else
+ echo "SUCCESS: No old insecure tokens found in database file."
+fi
+
+# SECURITY: Final verification - check for unreplaced LINKIS-UNAVAILABLE-TOKEN
in all configuration files
+echo "======= SECURITY: Final verification for remaining insecure tokens
=========="
+remaining_insecure_config=$(grep -r "LINKIS-UNAVAILABLE-TOKEN"
$LINKIS_HOME/conf/ 2>/dev/null | wc -l)
+remaining_insecure_admin=$(grep -o "LINKIS-UNAVAILABLE-TOKEN"
$LINKIS_HOME/admin/configuration_helper.sh 2>/dev/null | wc -l)
+
+if [ $remaining_insecure_config -gt 0 ] || [ $remaining_insecure_admin -gt 0
]; then
+ echo "WARNING: Found remaining LINKIS-UNAVAILABLE-TOKEN in configuration
files!"
+ echo "Configuration files: $remaining_insecure_config occurrences"
+ echo "Admin scripts: $remaining_insecure_admin occurrences"
+ echo "SECURITY RISK: Please review these files manually:"
+ grep -r "LINKIS-UNAVAILABLE-TOKEN" $LINKIS_HOME/conf/ 2>/dev/null || true
+ grep -n "LINKIS-UNAVAILABLE-TOKEN"
$LINKIS_HOME/admin/configuration_helper.sh 2>/dev/null || true
+else
+ echo "SUCCESS: All LINKIS-UNAVAILABLE-TOKEN placeholders have been replaced
with secure tokens."
fi
diff --git a/linkis-dist/helm/charts/linkis/templates/configmap-init-sql.yaml
b/linkis-dist/helm/charts/linkis/templates/configmap-init-sql.yaml
index 634c089220..27fa0b7afe 100644
--- a/linkis-dist/helm/charts/linkis/templates/configmap-init-sql.yaml
+++ b/linkis-dist/helm/charts/linkis/templates/configmap-init-sql.yaml
@@ -1426,9 +1426,9 @@ data:
INSERT INTO linkis_ps_error_code
(error_code,error_desc,error_regex,error_type) VALUES
('91007','JobServer中不存在您的脚本文件,请将你的脚本文件放入对应的JobServer路径中', 'Could not open input
file for reading%does not exist',0);
-- ----------------------------
- -- Default Tokens
+ -- Default Tokens
-- ----------------------------
- REPLACE INTO
`linkis_mg_gateway_auth_token`(`token_name`,`legal_users`,`legal_hosts`,`business_owner`,`create_time`,`update_time`,`elapse_day`,`update_by`)
VALUES ('LINKIS-AUTH','*','*','BDP',curdate(),curdate(),-1,'LINKIS');
+ REPLACE INTO
`linkis_mg_gateway_auth_token`(`token_name`,`legal_users`,`legal_hosts`,`business_owner`,`create_time`,`update_time`,`elapse_day`,`update_by`)
VALUES
('LINKIS-UNAVAILABLE-TOKEN','*','*','BDP',curdate(),curdate(),-1,'LINKIS');
INSERT INTO `linkis_ps_dm_datasource_type` (`name`, `description`,
`option`, `classifier`, `icon`, `layers`) VALUES ('mysql', 'mysql数据库',
'mysql数据库', '关系型数据库', '', 3);
INSERT INTO `linkis_ps_dm_datasource_type` (`name`, `description`,
`option`, `classifier`, `icon`, `layers`) VALUES ('kafka', 'kafka', 'kafka',
'消息队列', '', 2);
diff --git
a/linkis-dist/helm/charts/linkis/templates/configmap-linkis-config.yaml
b/linkis-dist/helm/charts/linkis/templates/configmap-linkis-config.yaml
index 5c12b9f791..e7042d0089 100644
--- a/linkis-dist/helm/charts/linkis/templates/configmap-linkis-config.yaml
+++ b/linkis-dist/helm/charts/linkis/templates/configmap-linkis-config.yaml
@@ -69,7 +69,7 @@ data:
## Token-Code=Token-User
## eg:TEST-AUTH=hadoop,root,user01
### http request with header { Token-Code:TEST-AUTH,Token-User:user01 }
- LINKIS-AUTH=*
+ LINKIS-UNAVAILABLE-TOKEN=*
application-linkis.yml: |
debug: {{ .Values.linkis.featureGates.testMode }}
@@ -212,7 +212,7 @@ data:
wds.linkis.client.common.gatewayUrl={{- include "linkis.gateway.url" . }}
wds.linkis.client.common.authStrategy=token
wds.linkis.client.common.tokenKey=Validation-Code
- wds.linkis.client.common.tokenValue=LINKIS-AUTH
+ wds.linkis.client.common.tokenValue=LINKIS-UNAVAILABLE-TOKE
spring.spring.mvc.pathmatch.matching-strategy=ant_path_matcher
spring.spring.cloud.loadbalancer.cache.enabled=false
springfox.documentation.enabled=false
diff --git a/linkis-dist/package/admin/configuration_helper.sh
b/linkis-dist/package/admin/configuration_helper.sh
index 3ebdcc2822..87e7dea804 100644
--- a/linkis-dist/package/admin/configuration_helper.sh
+++ b/linkis-dist/package/admin/configuration_helper.sh
@@ -61,21 +61,21 @@ fi
get()
{
requestUrl="$gatewayUrl/api/rest_j/v1/configuration/keyvalue?creator=$creator&engineType=$engineType&version=$version&configKey=$configKey"
- curl --location --request GET $requestUrl -H "Token-Code:LINKIS-AUTH" -H
"Token-User:$user"
+ curl --location --request GET $requestUrl -H
"Token-Code:LINKIS-UNAVAILABLE-TOKEN" -H "Token-User:$user"
}
delete()
{
requestUrl="$gatewayUrl/api/rest_j/v1/configuration/keyvalue"
requestBody="{\"engineType\":\"$engineType\",\"version\":\"$version\",\"creator\":\"$creator\",\"configKey\":\"$configKey\"}"
- curl -i -X DELETE $requestUrl -H "Accept: application/json" -H
"Content-Type: application/json" -H "Token-Code:LINKIS-AUTH" -H
"Token-User:$user" -d "$requestBody"
+ curl -i -X DELETE $requestUrl -H "Accept: application/json" -H
"Content-Type: application/json" -H "Token-Code:LINKIS-UNAVAILABLE-TOKEN" -H
"Token-User:$user" -d "$requestBody"
}
add()
{
requestUrl="$gatewayUrl/api/rest_j/v1/configuration/keyvalue"
requestBody="{\"engineType\":\"$engineType\",\"version\":\"$version\",\"creator\":\"$creator\",\"configKey\":\"$configKey\",\"configValue\":\"$configValue\",\"force\":\"$force\",\"user\":\"$user\"}"
- curl -i -X POST $requestUrl -H "Accept: application/json" -H
"Content-Type: application/json" -H "Token-Code:LINKIS-AUTH" -H
"Token-User:hadoop" -d "$requestBody"
+ curl -i -X POST $requestUrl -H "Accept: application/json" -H
"Content-Type: application/json" -H "Token-Code:LINKIS-UNAVAILABLE-TOKEN" -H
"Token-User:hadoop" -d "$requestBody"
}
case $COMMAND in
diff --git a/linkis-dist/package/conf/linkis-cli/linkis-cli.properties
b/linkis-dist/package/conf/linkis-cli/linkis-cli.properties
index 39eeccb421..1eae88fde1 100644
--- a/linkis-dist/package/conf/linkis-cli/linkis-cli.properties
+++ b/linkis-dist/package/conf/linkis-cli/linkis-cli.properties
@@ -17,6 +17,6 @@
wds.linkis.client.common.gatewayUrl=http://127.0.0.1:9001
wds.linkis.client.common.authStrategy=token
wds.linkis.client.common.tokenKey=Validation-Code
-wds.linkis.client.common.tokenValue=LINKIS-AUTH
+wds.linkis.client.common.tokenValue=LINKIS-UNAVAILABLE-TOKEN
wds.linkis.client.noncustomizable.enable.user.specification=true
wds.linkis.client.noncustomizable.enable.proxy.user=true
\ No newline at end of file
diff --git a/linkis-dist/package/conf/linkis.properties
b/linkis-dist/package/conf/linkis.properties
index 7b0a9e7d56..5d3a454f41 100644
--- a/linkis-dist/package/conf/linkis.properties
+++ b/linkis-dist/package/conf/linkis.properties
@@ -104,15 +104,15 @@ wds.linkis.workspace.filesystem.owner.check=true
wds.linkis.workspace.filesystem.path.check=true
#linkis token
-linkis.configuration.linkisclient.auth.token.value=LINKIS-AUTH
-wds.linkis.client.common.tokenValue=LINKIS-AUTH
-wds.linkis.bml.auth.token.value=LINKIS-AUTH
-wds.linkis.context.client.auth.value=LINKIS-AUTH
-wds.linkis.errorcode.auth.token=LINKIS-AUTH
-wds.linkis.client.test.common.tokenValue=LINKIS-AUTH
-wds.linkis.filesystem.token.value=LINKIS-AUTH
-wds.linkis.gateway.access.token=LINKIS-AUTH
-wds.linkis.server.dsm.auth.token.value=LINKIS-AUTH
+linkis.configuration.linkisclient.auth.token.value=LINKIS-UNAVAILABLE-TOKEN
+wds.linkis.client.common.tokenValue=LINKIS-UNAVAILABLE-TOKEN
+wds.linkis.bml.auth.token.value=LINKIS-UNAVAILABLE-TOKEN
+wds.linkis.context.client.auth.value=LINKIS-UNAVAILABLE-TOKEN
+wds.linkis.errorcode.auth.token=LINKIS-UNAVAILABLE-TOKEN
+wds.linkis.client.test.common.tokenValue=LINKIS-UNAVAILABLE-TOKEN
+wds.linkis.filesystem.token.value=LINKIS-UNAVAILABLE-TOKEN
+wds.linkis.gateway.access.token=LINKIS-UNAVAILABLE-TOKEN
+wds.linkis.server.dsm.auth.token.value=LINKIS-UNAVAILABLE-TOKEN
# s3 file system
diff --git a/linkis-dist/package/db/linkis_dml.sql
b/linkis-dist/package/db/linkis_dml.sql
index a7e8e924dc..8e9ebdc4d1 100644
--- a/linkis-dist/package/db/linkis_dml.sql
+++ b/linkis-dist/package/db/linkis_dml.sql
@@ -583,13 +583,13 @@ INSERT INTO linkis_ps_error_code
(error_code,error_desc,error_regex,error_type)
-- ----------------------------
-- Default Tokens
-- ----------------------------
-INSERT INTO
`linkis_mg_gateway_auth_token`(`token_name`,`legal_users`,`legal_hosts`,`business_owner`,`create_time`,`update_time`,`elapse_day`,`update_by`)
VALUES ('LINKIS-AUTH','*','*','BDP',curdate(),curdate(),-1,'LINKIS');
-INSERT INTO
`linkis_mg_gateway_auth_token`(`token_name`,`legal_users`,`legal_hosts`,`business_owner`,`create_time`,`update_time`,`elapse_day`,`update_by`)
VALUES ('WS-AUTH','*','*','BDP',curdate(),curdate(),-1,'LINKIS');
-INSERT INTO
`linkis_mg_gateway_auth_token`(`token_name`,`legal_users`,`legal_hosts`,`business_owner`,`create_time`,`update_time`,`elapse_day`,`update_by`)
VALUES ('DSS-AUTH','*','*','BDP',curdate(),curdate(),-1,'LINKIS');
-INSERT INTO
`linkis_mg_gateway_auth_token`(`token_name`,`legal_users`,`legal_hosts`,`business_owner`,`create_time`,`update_time`,`elapse_day`,`update_by`)
VALUES ('QUALITIS-AUTH','*','*','BDP',curdate(),curdate(),-1,'LINKIS');
-INSERT INTO
`linkis_mg_gateway_auth_token`(`token_name`,`legal_users`,`legal_hosts`,`business_owner`,`create_time`,`update_time`,`elapse_day`,`update_by`)
VALUES ('VALIDATOR-AUTH','*','*','BDP',curdate(),curdate(),-1,'LINKIS');
-INSERT INTO
`linkis_mg_gateway_auth_token`(`token_name`,`legal_users`,`legal_hosts`,`business_owner`,`create_time`,`update_time`,`elapse_day`,`update_by`)
VALUES ('LINKISCLI-AUTH','*','*','BDP',curdate(),curdate(),-1,'LINKIS');
-INSERT INTO
`linkis_mg_gateway_auth_token`(`token_name`,`legal_users`,`legal_hosts`,`business_owner`,`create_time`,`update_time`,`elapse_day`,`update_by`)
VALUES ('DSM-AUTH','*','*','BDP',curdate(),curdate(),-1,'LINKIS');
+INSERT INTO
`linkis_mg_gateway_auth_token`(`token_name`,`legal_users`,`legal_hosts`,`business_owner`,`create_time`,`update_time`,`elapse_day`,`update_by`)
VALUES
('LINKIS-UNAVAILABLE-TOKEN','*','*','BDP',curdate(),curdate(),-1,'LINKIS');
+INSERT INTO
`linkis_mg_gateway_auth_token`(`token_name`,`legal_users`,`legal_hosts`,`business_owner`,`create_time`,`update_time`,`elapse_day`,`update_by`)
VALUES ('WS-UNAVAILABLE-TOKEN','*','*','BDP',curdate(),curdate(),-1,'LINKIS');
+INSERT INTO
`linkis_mg_gateway_auth_token`(`token_name`,`legal_users`,`legal_hosts`,`business_owner`,`create_time`,`update_time`,`elapse_day`,`update_by`)
VALUES ('DSS-UNAVAILABLE-TOKEN','*','*','BDP',curdate(),curdate(),-1,'LINKIS');
+INSERT INTO
`linkis_mg_gateway_auth_token`(`token_name`,`legal_users`,`legal_hosts`,`business_owner`,`create_time`,`update_time`,`elapse_day`,`update_by`)
VALUES
('QUALITIS-UNAVAILABLE-TOKEN','*','*','BDP',curdate(),curdate(),-1,'LINKIS');
+INSERT INTO
`linkis_mg_gateway_auth_token`(`token_name`,`legal_users`,`legal_hosts`,`business_owner`,`create_time`,`update_time`,`elapse_day`,`update_by`)
VALUES
('VALIDATOR-UNAVAILABLE-TOKEN','*','*','BDP',curdate(),curdate(),-1,'LINKIS');
+INSERT INTO
`linkis_mg_gateway_auth_token`(`token_name`,`legal_users`,`legal_hosts`,`business_owner`,`create_time`,`update_time`,`elapse_day`,`update_by`)
VALUES
('LINKISCLI-UNAVAILABLE-TOKEN','*','*','BDP',curdate(),curdate(),-1,'LINKIS');
+INSERT INTO
`linkis_mg_gateway_auth_token`(`token_name`,`legal_users`,`legal_hosts`,`business_owner`,`create_time`,`update_time`,`elapse_day`,`update_by`)
VALUES ('DSM-UNAVAILABLE-TOKEN','*','*','BDP',curdate(),curdate(),-1,'LINKIS');
INSERT INTO `linkis_ps_dm_datasource_type` (`name`, `description`, `option`,
`classifier`, `icon`, `layers`, `description_en`, `option_en`, `classifier_en`)
VALUES ('kafka', 'kafka', 'kafka', '消息队列', '', 2, 'Kafka', 'Kafka', 'Message
Queue');
INSERT INTO `linkis_ps_dm_datasource_type` (`name`, `description`, `option`,
`classifier`, `icon`, `layers`, `description_en`, `option_en`, `classifier_en`)
VALUES ('hive', 'hive数据库', 'hive', '大数据存储', '', 3, 'Hive Database', 'Hive',
'Big Data storage');
diff --git a/linkis-dist/package/db/linkis_dml_pg.sql
b/linkis-dist/package/db/linkis_dml_pg.sql
index 2ae838d5e3..18cbcb20b9 100644
--- a/linkis-dist/package/db/linkis_dml_pg.sql
+++ b/linkis-dist/package/db/linkis_dml_pg.sql
@@ -482,12 +482,12 @@ alter sequence linkis_mg_gateway_auth_token_id_seq
restart with 1;
-- ----------------------------
-- Default Tokens
-- ----------------------------
-INSERT INTO
"linkis_mg_gateway_auth_token"("token_name","legal_users","legal_hosts","business_owner","create_time","update_time","elapse_day","update_by")
VALUES ('LINKIS-AUTH','*','*','BDP',now(),now(),-1,'LINKIS');
-INSERT INTO
"linkis_mg_gateway_auth_token"("token_name","legal_users","legal_hosts","business_owner","create_time","update_time","elapse_day","update_by")
VALUES ('WS-AUTH','*','*','BDP',now(),now(),-1,'LINKIS');
-INSERT INTO
"linkis_mg_gateway_auth_token"("token_name","legal_users","legal_hosts","business_owner","create_time","update_time","elapse_day","update_by")
VALUES ('DSS-AUTH','*','*','BDP',now(),now(),-1,'LINKIS');
-INSERT INTO
"linkis_mg_gateway_auth_token"("token_name","legal_users","legal_hosts","business_owner","create_time","update_time","elapse_day","update_by")
VALUES ('QUALITIS-AUTH','*','*','BDP',now(),now(),-1,'LINKIS');
-INSERT INTO
"linkis_mg_gateway_auth_token"("token_name","legal_users","legal_hosts","business_owner","create_time","update_time","elapse_day","update_by")
VALUES ('VALIDATOR-AUTH','*','*','BDP',now(),now(),-1,'LINKIS');
-INSERT INTO
"linkis_mg_gateway_auth_token"("token_name","legal_users","legal_hosts","business_owner","create_time","update_time","elapse_day","update_by")
VALUES ('DSM-AUTH','*','*','BDP',now(),now(),-1,'LINKIS');
+INSERT INTO
"linkis_mg_gateway_auth_token"("token_name","legal_users","legal_hosts","business_owner","create_time","update_time","elapse_day","update_by")
VALUES ('LINKIS-UNAVAILABLE-TOKEN','*','*','BDP',now(),now(),-1,'LINKIS');
+INSERT INTO
"linkis_mg_gateway_auth_token"("token_name","legal_users","legal_hosts","business_owner","create_time","update_time","elapse_day","update_by")
VALUES ('WS-UNAVAILABLE-TOKEN','*','*','BDP',now(),now(),-1,'LINKIS');
+INSERT INTO
"linkis_mg_gateway_auth_token"("token_name","legal_users","legal_hosts","business_owner","create_time","update_time","elapse_day","update_by")
VALUES ('DSS-UNAVAILABLE-TOKEN','*','*','BDP',now(),now(),-1,'LINKIS');
+INSERT INTO
"linkis_mg_gateway_auth_token"("token_name","legal_users","legal_hosts","business_owner","create_time","update_time","elapse_day","update_by")
VALUES ('QUALITIS-UNAVAILABLE-TOKEN','*','*','BDP',now(),now(),-1,'LINKIS');
+INSERT INTO
"linkis_mg_gateway_auth_token"("token_name","legal_users","legal_hosts","business_owner","create_time","update_time","elapse_day","update_by")
VALUES ('VALIDATOR-UNAVAILABLE-TOKEN','*','*','BDP',now(),now(),-1,'LINKIS');
+INSERT INTO
"linkis_mg_gateway_auth_token"("token_name","legal_users","legal_hosts","business_owner","create_time","update_time","elapse_day","update_by")
VALUES ('DSM-UNAVAILABLE-TOKEN','*','*','BDP',now(),now(),-1,'LINKIS');
delete from linkis_ps_dm_datasource_type;
alter sequence linkis_ps_dm_datasource_type_id_seq restart with 1;
INSERT INTO "linkis_ps_dm_datasource_type" ("name", "description", "option",
"classifier", "icon", "layers", "description_en", "option_en", "classifier_en")
VALUES ('kafka', 'kafka', 'kafka', '消息队列', '', 2, 'Kafka', 'Kafka', 'Message
Queue');
diff --git a/linkis-dist/package/db/module/linkis-mg.sql
b/linkis-dist/package/db/module/linkis-mg.sql
index 8d48fe3e90..c92c4f0c41 100644
--- a/linkis-dist/package/db/module/linkis-mg.sql
+++ b/linkis-dist/package/db/module/linkis-mg.sql
@@ -31,19 +31,4 @@ CREATE TABLE `linkis_mg_gateway_auth_token` (
`update_by` varchar(32),
PRIMARY KEY (`id`),
UNIQUE KEY `token_name` (`token_name`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-INSERT INTO `linkis_mg_gateway_auth_token`(
- `token_name`,
- `legal_users`,
- `legal_hosts`,
- `business_owner`,
- `create_time`,
- `update_time`,
- `elapse_day`,
- `update_by`
-) VALUES
-('LINKIS-AUTH','*','*','BDP',curdate(),curdate(),-1,'LINKIS'),
-('BML-AUTH','*','*','BDP',curdate(),curdate(),-1,'LINKIS'),
-('WS-AUTH','*','*','BDP',curdate(),curdate(),-1,'LINKIS'),
-('dss-AUTH','*','*','BDP',curdate(),curdate(),-1,'LINKIS'),
-('QUALITIS-AUTH','*','*','BDP',curdate(),curdate(),-1,'LINKIS'));
\ No newline at end of file
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
\ No newline at end of file
diff --git
a/linkis-spring-cloud-services/linkis-service-gateway/linkis-gateway-authentication/src/test/java/org/apache/linkis/gateway/authentication/dao/TokenDaoTest.java
b/linkis-spring-cloud-services/linkis-service-gateway/linkis-gateway-authentication/src/test/java/org/apache/linkis/gateway/authentication/dao/TokenDaoTest.java
index 78f7a3c1ec..2cc6c03af3 100644
---
a/linkis-spring-cloud-services/linkis-service-gateway/linkis-gateway-authentication/src/test/java/org/apache/linkis/gateway/authentication/dao/TokenDaoTest.java
+++
b/linkis-spring-cloud-services/linkis-service-gateway/linkis-gateway-authentication/src/test/java/org/apache/linkis/gateway/authentication/dao/TokenDaoTest.java
@@ -18,8 +18,10 @@
package org.apache.linkis.gateway.authentication.dao;
import org.apache.linkis.common.conf.CommonVars;
+import org.apache.linkis.common.conf.Configuration;
import org.apache.linkis.gateway.authentication.entity.TokenEntity;
+import org.glassfish.jersey.model.internal.CommonConfig;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
@@ -36,7 +38,7 @@ class TokenDaoTest extends BaseDaoTest {
private static final Logger logger =
LoggerFactory.getLogger(BaseDaoTest.class);
private static String TokenName =
- CommonVars.apply("wds.linkis.bml.auth.token.value",
"LINKIS-AUTH").getValue();
+ CommonVars.apply("wds.linkis.bml.auth.token.value",
Configuration.LINKIS_TOKEN().getValue()).getValue();
@Autowired TokenDao tokenDao;
diff --git
a/linkis-spring-cloud-services/linkis-service-gateway/linkis-gateway-authentication/src/test/java/org/apache/linkis/gateway/authentication/service/CachedTokenServiceTest.java
b/linkis-spring-cloud-services/linkis-service-gateway/linkis-gateway-authentication/src/test/java/org/apache/linkis/gateway/authentication/service/CachedTokenServiceTest.java
index e41508a646..d1b46c2d85 100644
---
a/linkis-spring-cloud-services/linkis-service-gateway/linkis-gateway-authentication/src/test/java/org/apache/linkis/gateway/authentication/service/CachedTokenServiceTest.java
+++
b/linkis-spring-cloud-services/linkis-service-gateway/linkis-gateway-authentication/src/test/java/org/apache/linkis/gateway/authentication/service/CachedTokenServiceTest.java
@@ -18,6 +18,7 @@
package org.apache.linkis.gateway.authentication.service;
import org.apache.linkis.common.conf.CommonVars;
+import org.apache.linkis.common.conf.Configuration;
import org.apache.linkis.gateway.authentication.Scan;
import org.apache.linkis.gateway.authentication.WebApplicationServer;
import org.apache.linkis.gateway.authentication.exception.TokenAuthException;
@@ -39,7 +40,7 @@ public class CachedTokenServiceTest {
private static final Logger logger =
LoggerFactory.getLogger(CachedTokenServiceTest.class);
private static String TokenName =
- CommonVars.apply("wds.linkis.bml.auth.token.value",
"LINKIS-AUTH").getValue();
+ CommonVars.apply("wds.linkis.bml.auth.token.value",
Configuration.LINKIS_TOKEN().getValue()).getValue();
@Autowired CachedTokenService tokenService;
diff --git
a/linkis-spring-cloud-services/linkis-service-gateway/linkis-gateway-authentication/src/test/resources/create.sql
b/linkis-spring-cloud-services/linkis-service-gateway/linkis-gateway-authentication/src/test/resources/create.sql
index a72b41c12b..efcf6cc908 100644
---
a/linkis-spring-cloud-services/linkis-service-gateway/linkis-gateway-authentication/src/test/resources/create.sql
+++
b/linkis-spring-cloud-services/linkis-service-gateway/linkis-gateway-authentication/src/test/resources/create.sql
@@ -37,10 +37,4 @@ DELETE FROM linkis_mg_gateway_auth_token;
-- ----------------------------
-- Default Tokens
-- ----------------------------
-INSERT INTO
`linkis_mg_gateway_auth_token`(`token_name`,`legal_users`,`legal_hosts`,`business_owner`,`create_time`,`update_time`,`elapse_day`,`update_by`)
VALUES ('QML-AUTH','*','*','BDP',curdate(),curdate(),-1,'LINKIS');
-INSERT INTO
`linkis_mg_gateway_auth_token`(`token_name`,`legal_users`,`legal_hosts`,`business_owner`,`create_time`,`update_time`,`elapse_day`,`update_by`)
VALUES
('LINKIS-AUTH','hadoop,test','127.0.0.1','BDP',curdate(),curdate(),-1,'LINKIS');
-INSERT INTO
`linkis_mg_gateway_auth_token`(`token_name`,`legal_users`,`legal_hosts`,`business_owner`,`create_time`,`update_time`,`elapse_day`,`update_by`)
VALUES ('WS-AUTH','*','*','BDP',curdate(),curdate(),-1,'LINKIS');
-INSERT INTO
`linkis_mg_gateway_auth_token`(`token_name`,`legal_users`,`legal_hosts`,`business_owner`,`create_time`,`update_time`,`elapse_day`,`update_by`)
VALUES ('dss-AUTH','*','*','BDP',curdate(),curdate(),-1,'LINKIS');
-INSERT INTO
`linkis_mg_gateway_auth_token`(`token_name`,`legal_users`,`legal_hosts`,`business_owner`,`create_time`,`update_time`,`elapse_day`,`update_by`)
VALUES ('QUALITIS-AUTH','*','*','BDP',curdate(),curdate(),-1,'LINKIS');
-INSERT INTO
`linkis_mg_gateway_auth_token`(`token_name`,`legal_users`,`legal_hosts`,`business_owner`,`create_time`,`update_time`,`elapse_day`,`update_by`)
VALUES ('VALIDATOR-AUTH','*','*','BDP',curdate(),curdate(),-1,'LINKIS');
-INSERT INTO
`linkis_mg_gateway_auth_token`(`token_name`,`legal_users`,`legal_hosts`,`business_owner`,`create_time`,`update_time`,`elapse_day`,`update_by`)
VALUES ('LINKISCLI-AUTH','*','*','BDP',curdate(),curdate(),-1,'LINKIS');
+INSERT INTO
`linkis_mg_gateway_auth_token`(`token_name`,`legal_users`,`legal_hosts`,`business_owner`,`create_time`,`update_time`,`elapse_day`,`update_by`)
VALUES
('LINKIS-UNAVAILABLE-TOKE','*','*','BDP',curdate(),curdate(),-1,'LINKIS');
\ No newline at end of file
diff --git
a/linkis-spring-cloud-services/linkis-service-gateway/linkis-gateway-authentication/src/test/resources/create_pg.sql
b/linkis-spring-cloud-services/linkis-service-gateway/linkis-gateway-authentication/src/test/resources/create_pg.sql
index 33d45db6c8..64b0def6e2 100644
---
a/linkis-spring-cloud-services/linkis-service-gateway/linkis-gateway-authentication/src/test/resources/create_pg.sql
+++
b/linkis-spring-cloud-services/linkis-service-gateway/linkis-gateway-authentication/src/test/resources/create_pg.sql
@@ -35,11 +35,8 @@ delete from linkis_mg_gateway_auth_token;
-- Default Tokens
-- ----------------------------
INSERT INTO
"linkis_mg_gateway_auth_token"("token_name","legal_users","legal_hosts","business_owner","create_time","update_time","elapse_day","update_by")
VALUES (concat('QML-', md5(cast(random() as
varchar))),'*','*','BDP',now(),now(),-1,'LINKIS');
-INSERT INTO
"linkis_mg_gateway_auth_token"("token_name","legal_users","legal_hosts","business_owner","create_time","update_time","elapse_day","update_by")
VALUES ('LINKIS-AUTH','*','*','BDP',now(),now(),-1,'LINKIS');
-INSERT INTO
"linkis_mg_gateway_auth_token"("token_name","legal_users","legal_hosts","business_owner","create_time","update_time","elapse_day","update_by")
VALUES ('WS-AUTH','*','*','BDP',now(),now(),-1,'LINKIS');
+INSERT INTO
"linkis_mg_gateway_auth_token"("token_name","legal_users","legal_hosts","business_owner","create_time","update_time","elapse_day","update_by")
VALUES ('LINKIS-UNAVAILABLE-TOKE','*','*','BDP',now(),now(),-1,'LINKIS');
INSERT INTO
"linkis_mg_gateway_auth_token"("token_name","legal_users","legal_hosts","business_owner","create_time","update_time","elapse_day","update_by")
VALUES (concat('DSS-', md5(cast(random() as
varchar))),'*','*','BDP',now(),now(),-1,'LINKIS');
INSERT INTO
"linkis_mg_gateway_auth_token"("token_name","legal_users","legal_hosts","business_owner","create_time","update_time","elapse_day","update_by")
VALUES (concat('QUALITIS-', md5(cast(random() as
varchar))),'*','*','BDP',now(),now(),-1,'LINKIS');
INSERT INTO
"linkis_mg_gateway_auth_token"("token_name","legal_users","legal_hosts","business_owner","create_time","update_time","elapse_day","update_by")
VALUES (concat('VALIDATOR-', md5(cast(random() as
varchar))),'*','*','BDP',now(),now(),-1,'LINKIS');
-INSERT INTO
"linkis_mg_gateway_auth_token"("token_name","legal_users","legal_hosts","business_owner","create_time","update_time","elapse_day","update_by")
VALUES (concat('LINKISCLI-', md5(cast(random() as
varchar))),'*','*','BDP',now(),now(),-1,'LINKIS');
-INSERT INTO
"linkis_mg_gateway_auth_token"("token_name","legal_users","legal_hosts","business_owner","create_time","update_time","elapse_day","update_by")
VALUES ('DSM-AUTH','*','*','BDP',now(),now(),-1,'LINKIS');
-INSERT INTO
"linkis_mg_gateway_auth_token"("token_name","legal_users","legal_hosts","business_owner","create_time","update_time","elapse_day","update_by")
VALUES ('LINKIS_CLI_TEST','*','*','BDP',now(),now(),-1,'LINKIS');
\ No newline at end of file
+INSERT INTO
"linkis_mg_gateway_auth_token"("token_name","legal_users","legal_hosts","business_owner","create_time","update_time","elapse_day","update_by")
VALUES (concat('LINKISCLI-', md5(cast(random() as
varchar))),'*','*','BDP',now(),now(),-1,'LINKIS');
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]