mirror of
https://github.com/oauth2-proxy/oauth2-proxy.git
synced 2026-10-21 10:17:22 +02:00
Add support for unix socket as upstream (#1866)
* Add support for unix socket as upstream * Add CHANGELOG.md entry * Add Unix socket documentation * Don't export unixRoundTripper, switch from string prefix to Scheme match * Add basic unix server mock * Add some tests and comments
This commit is contained in:
@@ -98,6 +98,11 @@ var _ = Describe("Proxy Suite", func() {
|
||||
RewriteTarget: "/double-match/rewrite/$1",
|
||||
URI: serverAddr,
|
||||
},
|
||||
{
|
||||
ID: "unix-upstream",
|
||||
Path: "/unix/",
|
||||
URI: unixServerAddr,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -337,6 +342,27 @@ var _ = Describe("Proxy Suite", func() {
|
||||
},
|
||||
upstream: "",
|
||||
}),
|
||||
Entry("with a request to the UNIX socket backend", &proxyTableInput{
|
||||
target: "http://example.localhost/unix/file",
|
||||
response: testHTTPResponse{
|
||||
code: 200,
|
||||
header: map[string][]string{
|
||||
contentType: {applicationJSON},
|
||||
},
|
||||
request: testHTTPRequest{
|
||||
Method: "GET",
|
||||
URL: "http://example.localhost/unix/file",
|
||||
Header: map[string][]string{
|
||||
"Gap-Auth": {""},
|
||||
"Gap-Signature": {"sha256 4ux8esLj2fw9sTWZwgFhb00bGbw0Fnhed5Fm9jz5Blw="},
|
||||
},
|
||||
Body: []byte{},
|
||||
Host: "example.localhost",
|
||||
RequestURI: "http://example.localhost/unix/file",
|
||||
},
|
||||
},
|
||||
upstream: "unix-upstream",
|
||||
}),
|
||||
)
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user