Skip to content

Commit e1e59bc

Browse files
authored
[MINOR] Drop ticket value from WebSocket debug log statements
### What is this PR for? Removes the WebSocket auth ticket value from three `LOGGER.debug` call sites in `NotebookServer.onMessage`. The ticket is a per-session UUID and adds no debugging value beyond the principal that owns it; emitting the raw value makes it visible to anyone with access to log files or downstream log collectors. The three call sites and the change applied to each: - **RECEIVE block** — drops the `RECEIVE TICKET` column. The remaining `op` / `principal` / `roles` / `data` columns are sufficient to identify the message. - **"no ticket on file" branch** — logs the principal that has no entry instead of echoing back the rejected ticket. - **"ticket mismatch" branch** — logs the principal whose ticket did not match, rather than both raw values. `Message.toString()` does not include the ticket field, so the surrounding `LOGGER.trace("RECEIVE MSG = " + receivedMessage)` already does not leak it. ### What type of PR is it? Improvement ### What is the Jira issue? N/A — minor logging hygiene change, no behavioral or API change. ### How should this be tested? Diff is self-evident. The three changed sites stay on the existing branches; behavior (what is returned to the client, what is rejected) is unchanged. Existing `NotebookServerTest` continues to exercise these paths. ### Screenshots (if appropriate) N/A ### Questions: - Does the license files need to update? No - Is there breaking changes for older versions? No - Does this needs documentation? No Closes #5228 from jongyoul/ZEPPELIN-ws-ticket-log-redact. Signed-off-by: Jongyoul Lee <jongyoul@gmail.com>
1 parent cc01451 commit e1e59bc

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

zeppelin-server/src/main/java/org/apache/zeppelin/socket/NotebookServer.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,6 @@ public void onMessage(NotebookSocket conn, String msg) {
279279
if (receivedMessage.op != OP.PING) {
280280
LOGGER.debug("RECEIVE: " + receivedMessage.op +
281281
", RECEIVE PRINCIPAL: " + receivedMessage.principal +
282-
", RECEIVE TICKET: " + receivedMessage.ticket +
283282
", RECEIVE ROLES: " + receivedMessage.roles +
284283
", RECEIVE DATA: " + receivedMessage.data);
285284
}
@@ -289,12 +288,13 @@ public void onMessage(NotebookSocket conn, String msg) {
289288

290289
TicketContainer.Entry ticketEntry = TicketContainer.instance.getTicketEntry(receivedMessage.principal);
291290
if (ticketEntry == null || StringUtils.isEmpty(ticketEntry.getTicket())) {
292-
LOGGER.debug("{} message: invalid ticket {}", receivedMessage.op, receivedMessage.ticket);
291+
LOGGER.debug("{} message: no ticket on file for principal {}",
292+
receivedMessage.op, receivedMessage.principal);
293293
return;
294294
} else if (!ticketEntry.getTicket().equals(receivedMessage.ticket)) {
295295
/* not to pollute logs, log instead of exception */
296-
LOGGER.debug("{} message: invalid ticket {} != {}", receivedMessage.op, receivedMessage.ticket,
297-
ticketEntry.getTicket());
296+
LOGGER.debug("{} message: ticket mismatch for principal {}",
297+
receivedMessage.op, receivedMessage.principal);
298298
if (!receivedMessage.op.equals(OP.PING)) {
299299
conn.send(serializeMessage(new Message(OP.SESSION_LOGOUT).put("info",
300300
"Your ticket is invalid possibly due to server restart. Please login again.")));

0 commit comments

Comments
 (0)