Repository navigation
pkg/hubapi: add HTTP client and protocol types for syz-hub - #8214
Open
ramosian-glider wants to merge 1 commit into
Open
ramosian-glider wants to merge 1 commit into
ramosian-glider wants to merge 1 commit into
Conversation
This was referenced Nov 26, 2026
There was a problem hiding this comment.
Code Review
This pull request introduces the pkg/hubapi package, which defines the data structures and an HTTP client for communicating with syz-hub, along with a corresponding test suite. The review feedback highlights a critical testing issue in pkg/hubapi/hubapi_test.go where require.NoError is used inside an HTTP handler goroutine (both directly and within the decodeGzipJSON helper). Because require calls t.FailNow(), which invokes runtime.Goexit(), using it in a non-test goroutine will silently terminate the handler rather than failing the test. It is recommended to use t.Error and return early instead.
ramosian-glider
force-pushed
the
hub-http-pr1-hubapi
branch
from
November 26, 2026 11:08
cb441e9 to
a1faf0f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add the standalone
pkg/hubapipackage providing the HTTP client and JSON wire protocol types forsyz-hub. This PR is completely additive and independently mergeable.Migration stack for #8176
pkg/hubapiHTTP client and protocol typessyz-hub,syz-manager,tools/syz-hubtool, and docs/configs to HTTPpkg/rpctypepackageSummary
PathConnect = "/api/connect",PathSync = "/api/sync",HeaderClient = "X-Syz-Client",HeaderManager = "X-Syz-Manager", and JSON wire typesInput,ConnectReq,SyncReq,SyncResp.SyncReq.Add/Del(no longer sent bysyz-manager) andSyncResp.Progs(superseded byInputs []Input).Managerout of JSON (json:"-") and passes client/manager identity and bearer credentials in HTTP headers (Authorization: Bearer <token>,X-Syz-Client,X-Syz-Manager) sosyz-hubcan authenticate requests before reading or decompressing bodies.NewClient(client, addr, key, opts...)validateshttp://orhttps://scheme, non-empty host, no URL userinfo, and no query/fragment; rejects unexpected redirects; defaults to ambient GCE OAuth bearer tokens viapkg/auth.MakeCachewhenkey == ""(withWithHTTPClientapplying to both API and metadata calls).POSTrequests (Content-Type: application/json,Content-Encoding: gzip) and bounds decoded responses to 256 MiB (4 KiB for error bodies).Part of #8176