venkata91 commented on code in PR #57219:
URL: https://github.com/apache/spark/pull/57219#discussion_r3648906546
##########
sql/connect/server/src/main/scala/org/apache/spark/status/api/v1/connect/ConnectResource.scala:
##########
@@ -37,12 +37,27 @@ private[v1] class ConnectResource extends BaseAppResource {
sessions.map(prepareSessionData)
}
+ // A session is identified by the composite (userId, sessionId): two users
may share the same
+ // session UUID, so userId is required to resolve exactly one session.
userId is an opaque
+ // identifier passed as a base64url token so it survives the UI request
sanitization intact.
@GET
@Path("sessions/{sessionId}")
- def session(@PathParam("sessionId") sessionId: String): SessionData = withUI
{ ui =>
+ def session(
+ @PathParam("sessionId") sessionId: String,
+ @QueryParam("userId") userId: String): SessionData = withUI { ui =>
+ if (userId == null || userId.isEmpty) {
Review Comment:
good catch. sessions/{sessionId} now rejects only an absent userId
parameter; a present-but-empty token decodes to the empty user, so sessions
created with the protobuf-default empty user id are addressable again. Added a
test that seeds an empty-user session and asserts the detail endpoint resolves
it (and that an absent parameter still returns 400).
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]