From 2062bcd3150ca2ba41f183eb1b34c4c28170776f Mon Sep 17 00:00:00 2001 From: Markus Ongyerth Date: Tue, 23 Sep 2025 14:55:57 +0000 Subject: [PATCH 1/3] credentials: Allow net.Pipe with credentials/local net.Pipe is a go standard library abstraction to create in-process an in-process connected pair of net.Conn. Using a specialized net.Listener and WithContextDialier this allows to create an in-process grpc Server/Client pair without an OS based roundtrip. RELEASE NOTES: * credentials: Allow using net.Pipe basec connections with credentials/local authorization. --- credentials/local/local.go | 3 +++ credentials/local/local_test.go | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/credentials/local/local.go b/credentials/local/local.go index 2fe0215d0cc9..bf59875911aa 100644 --- a/credentials/local/local.go +++ b/credentials/local/local.go @@ -74,6 +74,9 @@ func getSecurityLevel(network, addr string) (credentials.SecurityLevel, error) { // Windows named pipe connection case network == "pipe" && strings.HasPrefix(addr, `\\.\pipe\`): return credentials.NoSecurity, nil + // Go net.Pipe connection + case network == "pipe" && addr == "pip" + return credentials.NoSecurity, nil // UDS connection case network == "unix": return credentials.PrivacyAndIntegrity, nil diff --git a/credentials/local/local_test.go b/credentials/local/local_test.go index 47f8dbb4ec85..4e8730ce105e 100644 --- a/credentials/local/local_test.go +++ b/credentials/local/local_test.go @@ -57,6 +57,11 @@ func (s) TestGetSecurityLevel(t *testing.T) { testAddr: "[::1]:10000", want: credentials.NoSecurity, }, + { + testNetwork: "pipe", + testAddr: "pipe", + want: credentials.NoSecurity, + }, { testNetwork: "unix", testAddr: "/tmp/grpc_fullstack_test", From 97dd7f8ae05bead636345e87eb74908871f19d24 Mon Sep 17 00:00:00 2001 From: Markus Ongyerth Date: Tue, 23 Sep 2025 15:06:19 +0000 Subject: [PATCH 2/3] fix typo --- credentials/local/local.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/credentials/local/local.go b/credentials/local/local.go index bf59875911aa..662283387c9b 100644 --- a/credentials/local/local.go +++ b/credentials/local/local.go @@ -75,7 +75,7 @@ func getSecurityLevel(network, addr string) (credentials.SecurityLevel, error) { case network == "pipe" && strings.HasPrefix(addr, `\\.\pipe\`): return credentials.NoSecurity, nil // Go net.Pipe connection - case network == "pipe" && addr == "pip" + case network == "pipe" && addr == "pipe": return credentials.NoSecurity, nil // UDS connection case network == "unix": From 58a2a60ae4e431c749a1a1b4f9222bfa908d8c90 Mon Sep 17 00:00:00 2001 From: Markus Ongyerth Date: Thu, 25 Sep 2025 22:08:45 +0200 Subject: [PATCH 3/3] Add windows test --- credentials/local/local_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/credentials/local/local_test.go b/credentials/local/local_test.go index 4e8730ce105e..4e88208be544 100644 --- a/credentials/local/local_test.go +++ b/credentials/local/local_test.go @@ -57,6 +57,11 @@ func (s) TestGetSecurityLevel(t *testing.T) { testAddr: "[::1]:10000", want: credentials.NoSecurity, }, + { + testNetwork: "pipe", + testAddr: `\\.\pipe\foo`, + want: credentials.NoSecurity, + }, { testNetwork: "pipe", testAddr: "pipe",