Add pre/post interceptor hooks to grpcserver.New
New Options parameter with PreInterceptors and PostInterceptors allows services to inject custom interceptors into the chain: [pre-interceptors] → logging → auth → [post-interceptors] → handler This enables services like metacrypt to add seal-check (pre-auth) and audit-logging (post-auth) interceptors while using the shared auth and logging infrastructure. Pass nil for the default chain (logging + auth only). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -216,7 +216,7 @@ func TestNewWithoutTLS(t *testing.T) {
|
||||
defer srv.Close()
|
||||
a := testAuth(t, srv.URL)
|
||||
|
||||
s, err := New("", "", a, testMethods, slog.Default())
|
||||
s, err := New("", "", a, testMethods, slog.Default(), nil)
|
||||
if err != nil {
|
||||
t.Fatalf("New: %v", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user