(linkis) branch release-1.8.0-rc1 updated: fix token security

2025-10-17 Thread kinghao
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 
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, 

(linkis) branch release-1.8.0-rc1 updated: fix token security

2025-10-17 Thread kinghao
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 57967e7838 fix token security
57967e7838 is described below

commit 57967e7838e31a473e8be20d7b9d933b930738d9
Author: aiceflower 
AuthorDate: Tue Oct 7 23:25:33 2025 +0800

fix token security
---
 .../gateway/authentication/dao/TokenDaoTest.java   | 122 +++---
 .../service/CachedTokenServiceTest.java| 179 +++--
 2 files changed, 161 insertions(+), 140 deletions(-)

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 2cc6c03af3..203ea9f903 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
@@ -1,56 +1,66 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-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;
-
-import org.junit.jupiter.api.Test;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertNotEquals;
-
-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", 
Configuration.LINKIS_TOKEN().getValue()).getValue();
-
-  @Autowired TokenDao tokenDao;
-
-  @Test
-  void testSelectTokenByName() {
-TokenEntity result = tokenDao.selectTokenByName(TokenName);
-assertEquals(result.getTokenName(), TokenName);
-  }
-
-  @Test
-  void testGetAllTokens() {
-List result = tokenDao.getAllTokens();
-assertNotEquals(result.size(), 0);
-  }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+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.apache.commons.lang3.StringUtils;
+
+import org.springframework.beans.factory.annotation.Autowired;
+
+import java.util.List;
+
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+
+class TokenDaoTest extends BaseDaoTest {
+
+  private static final Logger logger = 
LoggerFactor