Skip to content

Commit b28bbc3

Browse files
pjfanningclaude
andcommitted
Fix Scala compilation of linkis-module (#5482)
bb26ad3 (#5456) referenced LinkisModuleErrorCodeSummary.CRYPT_KEY_INSECURE without adding it to the enum, and 047ebde (#5457) used CommonVars in SecurityFilter without importing it. Both broke scala-compile-first on linkis-module, which cascades to every downstream module. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent bad400a commit b28bbc3

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

‎linkis-commons/linkis-module/src/main/java/org/apache/linkis/errorcode/LinkisModuleErrorCodeSummary.java‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ public enum LinkisModuleErrorCodeSummary implements LinkisErrorCode {
4141
"The receive queue for WebSocket is full, please try again later(WebSocket的接收队列已满,请稍后重试)!"),
4242
WEBSOCKET_STOPPED(
4343
11035,
44-
"WebSocket consumer has stopped, please contact the administrator to handle(WebSocket的消费器已停止,请联系管理员处理)!");
44+
"WebSocket consumer has stopped, please contact the administrator to handle(WebSocket的消费器已停止,请联系管理员处理)!"),
45+
CRYPT_KEY_INSECURE(
46+
11036,
47+
"The wds.linkis.crypt.key is missing or insecure, refusing to start(wds.linkis.crypt.key 缺失或不安全,拒绝启动)");
4548

4649
/** error code(错误码) */
4750
private final int errorCode;

‎linkis-commons/linkis-module/src/main/scala/org/apache/linkis/server/security/SecurityFilter.scala‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
package org.apache.linkis.server.security
1919

20-
import org.apache.linkis.common.conf.Configuration
20+
import org.apache.linkis.common.conf.{CommonVars, Configuration}
2121
import org.apache.linkis.common.utils.{Logging, RSAUtils, Utils}
2222
import org.apache.linkis.errorcode.LinkisModuleErrorCodeSummary.ILLEGAL_USER_TOKEN
2323
import org.apache.linkis.server.{Message, _}
@@ -196,14 +196,16 @@ object SecurityFilter {
196196
// peer). External clients cannot set this cookie to trigger the bypass.
197197
def isRequestIgnoreTimeout(req: HttpServletRequest): Boolean = {
198198
val hasCookie = Option(req.getCookies).exists(
199-
_.exists(c => c.getName == ALLOW_ACCESS_WITHOUT_TIMEOUT && c.getValue == "true"))
199+
_.exists(c => c.getName == ALLOW_ACCESS_WITHOUT_TIMEOUT && c.getValue == "true")
200+
)
200201
if (!hasCookie) return false
201202
if (!requireInternalIp) return true // escape hatch for legacy deployments
202203
val ip = getClientIp(req)
203204
if (!isTrustedInternal(ip)) {
204205
logger.warn(
205206
s"Ignore-timeout cookie present but client IP $ip is not in " +
206-
"linkis.security.trusted.internal.sources; rejecting as potential auth bypass")
207+
"linkis.security.trusted.internal.sources; rejecting as potential auth bypass"
208+
)
207209
return false
208210
}
209211
true

0 commit comments

Comments
 (0)