Skip to content

Commit

Permalink
OrderbookSnapshotsService handles now empty orderbooks. RestUserFilte…
Browse files Browse the repository at this point in the history
…r: log message improved.
  • Loading branch information
kreinhard committed Jan 17, 2025
1 parent 88be164 commit 505ecf6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,9 @@ class OrderbookSnapshotsService {
readSnapshot(incrementalBasedOn, orderbook)
}
val serialized = entry.serializedOrderBook ?: return
if (serialized.isEmpty()) {
return
}
readSnapshot(serialized, orderbook)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit 505ecf6

Please sign in to comment.