From 505ecf6676d9f61edb2a9825efd701efe5075ac4 Mon Sep 17 00:00:00 2001 From: Kai Reinhard Date: Fri, 17 Jan 2025 11:41:11 +0100 Subject: [PATCH] OrderbookSnapshotsService handles now empty orderbooks. RestUserFilter: log message improved. --- .../fibu/orderbooksnapshots/OrderbookSnapshotsService.kt | 3 +++ .../main/kotlin/org/projectforge/web/rest/RestUserFilter.kt | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/projectforge-business/src/main/kotlin/org/projectforge/business/fibu/orderbooksnapshots/OrderbookSnapshotsService.kt b/projectforge-business/src/main/kotlin/org/projectforge/business/fibu/orderbooksnapshots/OrderbookSnapshotsService.kt index bbc5eb1dd9..05bbab4f03 100644 --- a/projectforge-business/src/main/kotlin/org/projectforge/business/fibu/orderbooksnapshots/OrderbookSnapshotsService.kt +++ b/projectforge-business/src/main/kotlin/org/projectforge/business/fibu/orderbooksnapshots/OrderbookSnapshotsService.kt @@ -225,6 +225,9 @@ class OrderbookSnapshotsService { readSnapshot(incrementalBasedOn, orderbook) } val serialized = entry.serializedOrderBook ?: return + if (serialized.isEmpty()) { + return + } readSnapshot(serialized, orderbook) } diff --git a/projectforge-rest/src/main/kotlin/org/projectforge/web/rest/RestUserFilter.kt b/projectforge-rest/src/main/kotlin/org/projectforge/web/rest/RestUserFilter.kt index e37c2953e1..e8e57ae312 100644 --- a/projectforge-rest/src/main/kotlin/org/projectforge/web/rest/RestUserFilter.kt +++ b/projectforge-rest/src/main/kotlin/org/projectforge/web/rest/RestUserFilter.kt @@ -27,6 +27,7 @@ import mu.KotlinLogging import org.projectforge.business.user.UserTokenType import org.projectforge.login.LoginService import org.projectforge.rest.Authentication +import org.projectforge.rest.utils.RequestLog import org.projectforge.security.SecurityLogging import org.springframework.beans.factory.annotation.Autowired @@ -55,7 +56,7 @@ class RestUserFilter : AbstractRestUserFilter(UserTokenType.REST_CLIENT) { // Don't log error for userStatus (used by React client for checking weather the user is logged in or not). if (requestURI == null || requestURI != "/rs/userStatus") { val msg = - "Neither ${Authentication.AUTHENTICATION_USER_ID} nor ${Authentication.AUTHENTICATION_USERNAME}/${Authentication.AUTHENTICATION_TOKEN} is given for rest call: $requestURI. Rest call forbidden." + "Neither valid session-credentials (request.sessionId=${RequestLog.getTruncatedSessionId(authInfo.request)}), ${Authentication.AUTHENTICATION_USER_ID} nor ${Authentication.AUTHENTICATION_USERNAME}/${Authentication.AUTHENTICATION_TOKEN} is given for rest call: $requestURI. Rest call forbidden." log.error(msg) SecurityLogging.logSecurityWarn(authInfo.request, this::class.java, "REST AUTHENTICATION FAILED", msg) }