valepakh commented on code in PR #7817:
URL: https://github.com/apache/ignite-3/pull/7817#discussion_r2959796703
##########
modules/eventlog/src/integrationTest/java/org/apache/ignite/internal/eventlog/ItEventLogTest.java:
##########
@@ -121,6 +153,32 @@ void logsToFile() throws Exception {
+ "}";
assertThat(readEventLog(),
hasItem(matchesRegex(expectedEventJsonPatternAfterInvalidAuth)));
+
+ // And the client handler log contains authentication failure details.
+ assertThat(clientLogInspector.events(), hasItem(allOf(
+ containsString("Client authentication failed"),
+ containsString("remoteAddress="),
+ containsString("identity=UNKNOWN]")
+ )));
+
+ // When try to authenticate with invalid credentials via REST API.
+ HttpClient httpClient = HttpClient.newBuilder().build();
+ String endpoint = "/management/v1/configuration/cluster/";
+ HttpRequest request = HttpRequest.newBuilder(URI.create(NODE_URL +
endpoint))
+ .header("Authorization", basicAuthHeader("UNKNOWN", "SECRET"))
+ .build();
+
+ assertThat(httpClient.send(request, BodyHandlers.ofString()),
hasStatusCode(401));
+
+ // Then the REST log contains authentication failure details.
+ assertThat(restLogInspector.events(), hasItem(allOf(
+ containsString("REST authentication failed [uri=" + endpoint +
", remoteAddress="),
+ containsString("identity=UNKNOWN]")
+ )));
Review Comment:
- Client handler: LOG.info() fires synchronously → appender adds to list →
then handshakeError() sends response to client → client receives error →
assertThrows completes. Log is already captured.
- REST: logAuthenticationFailure() fires synchronously → appender adds to
list → then emitter.error() → Micronaut sends 401 → httpClient.send() returns.
Log is already captured.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]