Skip to content

feat!: connect-go v2 — module becomes github.com/pitabwire/frame/v3 - #705

Merged
pitabwire merged 3 commits into
mainfrom
feat/connect-v2
Oct 13, 2026
Merged

pitabwire merged 3 commits into
mainfrom
feat/connect-v2

Conversation

@pitabwire

Copy link
Copy Markdown
Owner

What

This PR moves frame to connect-go v2 (connectrpc.com/connect/v2 v2.0.0, released 2026-10-07).

Breaking: the module path becomes github.com/pitabwire/frame/v3. Frame's public API exposes Connect interceptor and error types. Those types change shape in connect v2, so under Go semver this is a new major version. It is meant to ship as v3.0.0.

Why

Services can't move to connect v2 until frame provides v2 interceptors and errors. If a service migrates today, it loses frame's authentication, authorization, validation and tenancy interceptor chain. connect v1 and v2 can coexist in one module, but frame's helpers had to choose one.

Changes

  • Interceptors. Each Connect interceptor is now a connect.ServerInterceptor: NewAuthInterceptor, NewValidationInterceptor, NewTenancyAccessInterceptor, NewFunctionAccessInterceptor, tenancy.NewClaimsInterceptor[WithBinder] and localization/interceptors/connect.NewLanguageInterceptor. A single function wraps unary and streaming RPCs alike, and the enriched context now reaches streaming handlers as well. This fixes the language interceptor, which never propagated to streaming handlers.
  • New: NewValidationClientInterceptor provides client-side validation. The v1 interceptor served both sides.
  • Default chain. DefaultList, DefaultListWithBinder and Service.ConnectDefaultInterceptors now return []connect.ServerInterceptor, ready for connect.NewServer(...). The order is unchanged: otel → validation → auth → claims → extras.
  • Errors. data.ErrorConvertToAPI and authorizer.ToConnectError now return connect v2 *connect.Error. The codes and wire messages are unchanged. The original error is attached with WithCause.
  • otelconnect. Upgraded to v0.12.0 and uses NewServerInterceptor. Frame doesn't import validate, grpchealth, grpcreflect or authn. connect v1 remains only as an indirect dependency of otelconnect v0.12.0, which supports both majors in one package.
  • Generated code. The frametests ping service is regenerated with protoc-gen-connect-go v2.0.0. Tests use connectinprocess and real connect.Server chains.
  • Dependencies. Every dependency is upgraded to its latest stable release: OpenTelemetry 1.47, grpc 1.84, pgx 5.11, protovalidate 1.4, x/net 0.61 and more. The toolchain is go1.26.9.
  • Fix in security/openid. The JWK struct declared the crv and x JSON tags twice, so encoding/json dropped both and EC and OKP JWKS keys never decoded. go vet flagged this. The fix removes the duplicate fields and re-enables the EC and Ed25519 authentication tests, which had been skipped.
  • Deprecations from the upgrade. The HTTP server drops x/net/http2.ConfigureServer and relies on http.Server.Protocols. Telemetry uses otel.SetLoggerProvider.
  • Docs. New migration guide for services: docs/migrating-v3.md. It covers import paths, a signature table, before/after code, connect v2 call sites, the new 4 MiB default read limit, and testing. It is also in the mkdocs nav and linked from the README.

Gates (local)

  • go build ./... and go vet ./...: clean.
  • golangci-lint run: 0 issues.
  • go test ./... -count=1 -p 2: all packages pass, including the testcontainers suites.
  • govulncheck ./... on go1.26.9: 0 reachable vulnerabilities. One module-level advisory has no fix: GO-2026-5932, x/crypto/openpgp, which frame doesn't call.

…e/frame/v3

Frame's public API exposes Connect interceptor and error types, so moving to
connectrpc.com/connect/v2 is a breaking change and the module path moves to /v3.

- Every Connect interceptor (auth, validation, tenancy access, function access,
  tenancy claims, language) is now a connect.ServerInterceptor that covers unary
  and streaming RPCs alike; add NewValidationClientInterceptor.
- DefaultList, DefaultListWithBinder and Service.ConnectDefaultInterceptors
  return []connect.ServerInterceptor for connect.NewServer.
- data.ErrorConvertToAPI and authorizer.ToConnectError return connect v2 errors,
  keeping wire messages and attaching the original error as the cause.
- otelconnect v0.12.0 (server interceptor); regenerate the ping test service with
  protoc-gen-connect-go v2.0.0; tests use connectinprocess.
- Upgrade all dependencies to their latest stable releases; toolchain go1.26.9.
- Fix duplicate crv/x JSON tags in openid.JWK that stopped EC and OKP JWKS keys
  from decoding; drop deprecated http2.ConfigureServer and otel/log/global.
- Add docs/migrating-v3.md, the v2 -> v3 migration guide for services.
The duplicate crv/x JSON tags that made these keys undecodable are fixed, so
the skipped tests now pass.
@pitabwire pitabwire added enhancement New feature or request major Breaking change: major version bump (release-drafter) labels Oct 13, 2026
saadmk11/changelog-ci@v1.2.0 cannot build its image (its Debian archive
returns 404) and has failed every PR since 2026-09-14. Its job is named
build, which the main ruleset requires, so it blocks every merge.
release-drafter already writes the changelog.
@pitabwire
pitabwire merged commit 82bdcb8 into main Oct 13, 2026
3 checks passed
@pitabwire
pitabwire deleted the feat/connect-v2 branch October 13, 2026 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request major Breaking change: major version bump (release-drafter)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant