auth+proxy: extend Authenticator methods with target service name

The target service name remains unused in its current form, but will be
required in order to verify that an incoming request with an LSAT
attached is authorized to access the service being attempted. We can
derive this from the request's host field, but we choose to extend the
methods with the additional parameter in order to prevent parsing the
host field again to determine which service is being accessed.
This commit is contained in:
Wilmer Paulino
2019-11-21 17:02:01 -08:00
parent 7b676b8b91
commit 95c405b0c7
5 changed files with 22 additions and 14 deletions

View File

@@ -141,7 +141,7 @@ func TestLsatAuthenticator(t *testing.T) {
}
for _, testCase := range headerTests {
result := a.Accept(testCase.header)
result := a.Accept(testCase.header, "test")
if result != testCase.result {
t.Fatalf("test case %s failed. got %v expected %v",
testCase.id, result, testCase.result)