Skip to content

Forward platform JWT and version User-Agent on the build-log-streamer…#3811

Merged
mitchell-as merged 1 commit into
version/0-48-1-RC2from
bring-in-build-log-streamer-fixes
Jun 15, 2026
Merged

Forward platform JWT and version User-Agent on the build-log-streamer…#3811
mitchell-as merged 1 commit into
version/0-48-1-RC2from
bring-in-build-log-streamer-fixes

Conversation

@mitchell-as

Copy link
Copy Markdown
Collaborator

… WebSocket

The build-log-streamer WebSocket previously opened with only an Origin header, so the server had no way to authorize the stream. When the caller is authenticated, offer the platform JWT via Sec-WebSocket-Protocol as 'bearer.' alongside the real 'build-log-streamer.activestate.com.v1' subprotocol the server echoes back (its allow-list contains only the real subprotocol, so the token never appears in the upgrade response). The browser WebSocket API can't set custom request headers, so the dashboard carries the JWT the same way -- both clients stay symmetric.

Also send the versioned State Tool User-Agent on the Upgrade so the server can see which client versions are connecting.

The token is threaded as a plain string from the runtime options into Connect, so pkg/runtime gains no authentication dependency; an empty token means anonymous (unchanged behavior). Includes a real-handshake test that asserts the offered subprotocols, the negotiated subprotocol, and the User-Agent the server receives.

… WebSocket

The build-log-streamer WebSocket previously opened with only an Origin header, so the server had no way to authorize the stream. When the caller is authenticated, offer the platform JWT via Sec-WebSocket-Protocol as 'bearer.<jwt>' alongside the real 'build-log-streamer.activestate.com.v1' subprotocol the server echoes back (its allow-list contains only the real subprotocol, so the token never appears in the upgrade response). The browser WebSocket API can't set custom request headers, so the dashboard carries the JWT the same way -- both clients stay symmetric.

Also send the versioned State Tool User-Agent on the Upgrade so the server can see which client versions are connecting.

The token is threaded as a plain string from the runtime options into Connect, so pkg/runtime gains no authentication dependency; an empty token means anonymous (unchanged behavior). Includes a real-handshake test that asserts the offered subprotocols, the negotiated subprotocol, and the User-Agent the server receives.
@mitchell-as mitchell-as merged commit f7a6c8b into version/0-48-1-RC2 Jun 15, 2026
9 of 19 checks passed
@mitchell-as mitchell-as deleted the bring-in-build-log-streamer-fixes branch June 15, 2026 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants