Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ CREATE TABLE `linkis_ps_python_module_info` (
ALTER TABLE `linkis_cg_manager_service_instance` ADD COLUMN mapping_ports varchar(128);
ALTER TABLE `linkis_cg_manager_service_instance` ADD COLUMN mapping_host varchar(128);

-- Add token_sign column to linkis_token table for token signature support
ALTER TABLE `linkis_token` ADD COLUMN `token_sign` VARCHAR(255) DEFAULT NULL COMMENT 'Token签名' AFTER `token_name`;




Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* 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.
*/

-- Add token_sign column to linkis_token table for token signature support
ALTER TABLE linkis_token ADD COLUMN IF NOT EXISTS token_sign VARCHAR(255) DEFAULT NULL;
COMMENT ON COLUMN linkis_token.token_sign IS 'Token签名';
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
~ 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.
Expand Down Expand Up @@ -68,6 +68,14 @@
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
<exclusion>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
</exclusion>
</exclusions>
</dependency>

Expand All @@ -76,6 +84,28 @@
<artifactId>jersey-apache-client4</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
<version>${spring.boot.version}</version>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
<exclusion>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
<scope>compile</scope>
</dependency>

</dependencies>
<build>
<plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
<exclude>aopalliance:aopalliance:jar</exclude>
<exclude>com.netflix.archaius:archaius-core:jar</exclude>
<exclude>org.aspectj:aspectjweaver:jar</exclude>
<exclude>org.bouncycastle:bcpkix-jdk18on:jar</exclude>
<exclude>org.bouncycastle:bcprov-jdk18on:jar</exclude>
<exclude>org.bouncycastle:bcpkix-jdk15on:jar</exclude>
<exclude>org.bouncycastle:bcprov-jdk15on:jar</exclude>
<exclude>org.checkerframework:checker-qual:jar</exclude>
<exclude>commons-collections:commons-collections:jar</exclude>
<exclude>commons-configuration:commons-configuration:jar</exclude>
Expand All @@ -70,6 +70,11 @@
<exclude>com.fasterxml.jackson.module:jackson-module-parameter-names:jar</exclude>
<exclude>jakarta.annotation:jakarta.annotation-api:jar</exclude>
<exclude>javax.inject:javax.inject:jar</exclude>
<exclude>com.sun.jersey.contribs:jersey-apache-client4:jar</exclude>
<exclude>com.sun.jersey:jersey-client:jar</exclude>
<exclude>com.sun.jersey:jersey-core:jar</exclude>
<exclude>com.sun.jersey:jersey-server:jar</exclude>
<exclude>com.sun.jersey:jersey-servlet:jar</exclude>
<exclude>org.codehaus.jettison:jettison:jar</exclude>
<exclude>joda-time:joda-time:jar</exclude>
<exclude>com.google.code.findbugs:jsr305:jar</exclude>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class CachedTokenService extends TokenService {

private val tokenCache: LoadingCache[String, Token] = CacheBuilder.newBuilder
.maximumSize(TokenConfiguration.TOKEN_CACHE_MAX_SIZE)
.refreshAfterWrite(TokenConfiguration.TOKEN_CACHE_EXPIRE_MINUTES, TimeUnit.MINUTES)
.expireAfterWrite(TokenConfiguration.TOKEN_CACHE_EXPIRE_MINUTES, TimeUnit.MINUTES)
.build(new CacheLoader[String, Token]() {

override def load(tokenName: String): Token = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,16 @@ void testDoAuth() {
assertThrows(
TokenAuthException.class, () -> tokenService.doAuth(TokenName, "test", "10.10.10.10"));
logger.info("assertThrows:{}", exception.getMessage());

exception =
assertThrows(
TokenAuthException.class, () -> tokenService.doAuth("NOT-EXIST", "test", "127.0.0.1"));
logger.info("assertThrows:{}", exception.getMessage());

exception =
assertThrows(
TokenAuthException.class,
() -> tokenService.doAuth("LINKISCLI-AUTH", "test", "127.0.0.1"));
logger.info("assertThrows:{}", exception.getMessage());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@ 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 ('LINKIS-UNAVAILABLE-TOKEN','test','127.0.0.1','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');

Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* 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.
*/

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 ('LINKIS-UNAVAILABLE-TOKEN','test','127.0.0.1','BDP',curdate(),curdate(),-1,'LINKIS');
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,17 @@
<groupId>io.springfox</groupId>
<artifactId>springfox-spring-web</artifactId>
<version>${springfox.version}</version>
<exclusions>
<exclusion>
<groupId>io.github.classgraph</groupId>
<artifactId>classgraph</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.github.classgraph</groupId>
<artifactId>classgraph</artifactId>
<version>${classgraph.version}</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ object GatewayConfiguration {
val OAUTH_CLIENT_ID = CommonVars("wds.linkis.gateway.auth.oauth.client.id", "")
val OAUTH_CLIENT_SECRET = CommonVars("wds.linkis.gateway.auth.oauth.client.secret", "")
val OAUTH_SCOPE = CommonVars("wds.linkis.gateway.auth.oauth.scope", "")

val PASS_AUTH_REQUEST_URI =
CommonVars("wds.linkis.gateway.conf.url.pass.auth", "/dws/").getValue.split(",")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-gateway</artifactId>
</exclusion>
<exclusion>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-core-asl</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
Expand Down Expand Up @@ -97,8 +101,17 @@
<groupId>io.projectreactor.netty</groupId>
<artifactId>reactor-netty</artifactId>
</exclusion>
<exclusion>
<groupId>io.projectreactor.netty</groupId>
<artifactId>reactor-netty-http</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.projectreactor.netty</groupId>
<artifactId>reactor-netty-http</artifactId>
<version>${reactor-netty-http.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
Expand Down
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@
<jettison.version>1.5.4</jettison.version>
<xstream.core.version>1.4.21</xstream.core.version>
<woodstox.version>6.4.0</woodstox.version>
<classgraph.version>4.8.112</classgraph.version>
<kafka-client.version>3.9.1</kafka-client.version>
<snakeyaml.version>2.0</snakeyaml.version>

Expand Down
Loading