Skip to content

Feature/connectrpc#33

Merged
euskadi31 merged 3 commits into
masterfrom
feature/connectrpc
May 21, 2026
Merged

Feature/connectrpc#33
euskadi31 merged 3 commits into
masterfrom
feature/connectrpc

Conversation

@euskadi31
Copy link
Copy Markdown
Contributor

No description provided.

euskadi31 added 3 commits May 21, 2026 15:48
Add a connectrpc/ module (package connectrpcsec) that adapts the
transport-agnostic security core to the ConnectRPC framework, mirroring
the gRPC adapter.

ConnectRPC has a single connect.Interceptor interface covering unary and
streaming RPCs, so the adapter exposes two interceptors instead of the
four gRPC-style constructors:

  - NewAuthenticationInterceptor runs the Engine against the request
    headers and enriches the context; client-side calls pass through.
  - NewAuthorizationInterceptor enforces an AccessDecisionManager.

It also ships a Carrier over http.Header, an ErrorMapper translating
security sentinels to connect.Code (Unauthenticated / PermissionDenied /
InvalidArgument), and OTel spans connectrpcsec.Authenticate /
connectrpcsec.Authorize.

Module tests pass with -race at 100% coverage; golangci-lint is clean.
Add a runnable ConnectRPC Bearer-token example mirroring grpc-bearer: it
serves the gRPC-style health service (connectrpc.com/grpchealth) behind
the connectrpcsec authentication and authorization interceptors, and
mints a demo JWT at start-up.

The end-to-end test serves the handler over httptest and asserts the
Connect protocol HTTP status mapping: a valid scoped token yields 200, a
missing or garbage token 401, and a token without the scope 403.
Add the connectrpc/ module to the workspace layout tables, the
dependency policy, the README module list, the CHANGELOG, and the OTel
span catalog (connectrpcsec.Authenticate / connectrpcsec.Authorize).

grpc/go.mod picks up the workspace-aligned google.golang.org/protobuf
v1.36.11 via go work sync.
@euskadi31 euskadi31 self-assigned this May 21, 2026
Copilot AI review requested due to automatic review settings May 21, 2026 14:05
@coveralls
Copy link
Copy Markdown

Coverage Report for CI Build 26231047040

Coverage increased (+0.3%) to 91.69%

Details

  • Coverage increased (+0.3%) from the base build.
  • Patch coverage: 140 of 140 lines across 5 files are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 4224
Covered Lines: 3873
Line Coverage: 91.69%
Coverage Strength: 12.26 hits per line

💛 - Coveralls

1 similar comment
@coveralls
Copy link
Copy Markdown

Coverage Report for CI Build 26231047040

Coverage increased (+0.3%) to 91.69%

Details

  • Coverage increased (+0.3%) from the base build.
  • Patch coverage: 140 of 140 lines across 5 files are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 4224
Covered Lines: 3873
Line Coverage: 91.69%
Coverage Strength: 12.26 hits per line

💛 - Coveralls

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new ConnectRPC transport adapter module (connectrpcsec) to the security toolkit, including interceptors for authentication/authorization, error mapping, and an example service demonstrating JWT + scope enforcement. It also updates repository docs and the Go workspace to include and describe the new module.

Changes:

  • Added connectrpc module implementing ConnectRPC interceptors (AuthenticationInterceptor, AuthorizationInterceptor), carrier, and error mapper.
  • Added a runnable + tested example (examples/connectrpc-bearer) demonstrating ConnectRPC authn/authz wiring.
  • Updated workspace wiring (go.work) and documentation (README, architecture, observability, migration, changelog) to include ConnectRPC support.

Reviewed changes

Copilot reviewed 26 out of 29 changed files in this pull request and generated no comments.

Show a summary per file
File Description
README.md Mentions ConnectRPC support and lists the new connectrpc module.
MIGRATION.md Documents the new module and updates the dependency boundary statement to include ConnectRPC.
grpc/go.sum Updates protobuf version checksum (but currently missing the corresponding .../go.mod sum entry).
grpc/go.mod Bumps google.golang.org/protobuf indirect version.
go.work.sum Adds ConnectRPC-related sums and updates workspace dependency sums.
go.work Adds ./connectrpc to the workspace modules.
examples/go.sum Adds ConnectRPC dependencies and updates protobuf sums.
examples/go.mod Adds connectrpc module replace/require and Connect dependencies.
examples/doc.go Lists the new connectrpc-bearer example.
examples/connectrpc-bearer/main.go New runnable ConnectRPC bearer-auth example server.
examples/connectrpc-bearer/main_test.go End-to-end test for the ConnectRPC bearer example over httptest.
docs/observability.md Adds ConnectRPC instrumentation scope and span catalog section.
docs/architecture.md Adds ConnectRPC to module list, dependencies, and transport adapter description.
connectrpc/testing_helpers_test.go Test helpers and fakes for ConnectRPC interceptor tests.
connectrpc/options.go New option/config plumbing shared by ConnectRPC interceptors.
connectrpc/interceptor.go Implements ConnectRPC authentication interceptor + header flushing.
connectrpc/interceptor_test.go Tests for authentication interceptor behavior (unary/streaming, fallback, header flush, mapper).
connectrpc/go.sum New module dependency lockfile for connectrpc.
connectrpc/go.mod New connectrpc module definition and dependencies.
connectrpc/example_test.go Package-level example covering default error mapping behavior.
connectrpc/error_mapper.go Implements default security-error → Connect-code mapping.
connectrpc/error_mapper_test.go Tests default error classification for ConnectRPC error mapping.
connectrpc/doc.go Package docs describing the ConnectRPC adapter and allowed dependencies.
connectrpc/carrier.go Implements security.Carrier over http.Header with staged response headers.
connectrpc/carrier_test.go Tests carrier read/write semantics and nil-header behavior.
connectrpc/authorize.go Implements ConnectRPC authorization interceptor (ADM enforcement).
connectrpc/authorize_test.go Tests authz interceptor behavior and chaining with authn.
CLAUDE.md Updates module list and conventions to include ConnectRPC adapter.
CHANGELOG.md Documents the new ConnectRPC adapter and observability scope update.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@euskadi31 euskadi31 merged commit c2d2cb6 into master May 21, 2026
3 checks passed
@euskadi31 euskadi31 deleted the feature/connectrpc branch May 21, 2026 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants