fix(connect): handle v1 GraphService format and B5 digests for buf 1.69.0#29
Merged
Conversation
…igests
Buf 1.69.0 uses DigestTypeB5 by default, routing calls through v1 APIs
instead of v1beta1. Three issues fixed:
1. v1 GetGraphRequest uses ResourceRef directly (no wrapper) —
added parseGetGraphResourceRefsV1 for the v1 parser path.
2. v1 Graph.commits expects repeated Commit directly, not wrapped
in Graph_Commit { Commit, Registry } — added conditional response
format based on path.
3. v1 DigestType has no B4 (only B5=1). B5 wraps the B4 hash:
SHA3-Shake256('shake256:' + hex(b4_hash)) — added toB5Digest()
helper applied to all v1 handler paths.
Fixes the nil pointer crash and digest verification failure when
running 'buf dep update' with buf 1.69.0.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
502e1ad to
f3f9a2c
Compare
ZergsLaw
approved these changes
Jun 1, 2026
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.
Summary
Fixes
buf dep updatecrash when using the proxy with buf 1.69.0+.Buf 1.69.0 uses DigestTypeB5 as the default, which routes module API calls through v1 paths instead of v1beta1. The proxy had three issues handling v1 requests, causing a nil pointer crash, invalid UTF-8 errors, and digest verification failures.
Changes
Request format fix
ServeGraphused the v1beta1 request parser for all paths. v1GetGraphRequestusesResourceRefdirectly in field 1, while v1beta1 wraps each inGetGraphRequest_ResourceRef { ResourceRef, Registry }. AddedparseGetGraphResourceRefsV1and path-based parser selection.Key files:
internal/connect/commits_helpers.go,internal/connect/commits.goResponse format fix
v1
Graph.commitsexpectsrepeated Commitdirectly (no wrapper), while v1beta1 usesGraph_Commit { Commit, Registry }. Added conditional response format based on path.Key files:
internal/connect/commits.goB5 digest computation
The v1
DigestTypeenum has no B4 type (onlyDIGEST_TYPE_B5 = 1). B5 wraps the B4 hash differently:SHA3-Shake256("shake256:" + hex(b4_hash)). AddedtoB5Digest()helper applied to all v1 handler paths.Key files:
internal/connect/commits.goVerification
buf dep updateincyp-hardware-manager/api/protoexits with code 0buf.lockcontains all 4 deps with correct B5 digestsKey Decisions