Skip to content

Commit a6a60f8

Browse files
committed
fix: return early after error in impersonateHandler
When the user or group lookup fails, the handler was logging/responding the error but then falling through to the impersonation logic. Adding an early return prevents the request from continuing with an empty or invalid identity. Signed-off-by: Cyril Jouve <jv.cyril@gmail.com>
1 parent e699800 commit a6a60f8

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

internal/webserver/webserver.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,8 @@ func (n *kubeFilter) impersonateHandler(writer http.ResponseWriter, request *htt
436436
} else {
437437
server.HandleError(writer, err, msg)
438438
}
439+
440+
return
439441
}
440442

441443
n.log.V(4).Info("impersonating for the current request", "username", username, "groups", groups, "uri", request.URL.Path)

0 commit comments

Comments
 (0)