Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
briskt committed Nov 26, 2024
1 parent d0edd9f commit 26fc9b5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions docker-compose.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ x-common-variables: &test-variables
COOKIE_NAME: _proxy
TOKEN_SECRET: Rm9yIEdvZCBzbyBsb3ZlZCB0aGUgd29ybGQgdGhhdCBoZSBnYXZlIGhpcyBvbmUgYW5kIG9ubHkgU29uLCB0aGF0IHdob2V2ZXIgYmVsaWV2ZXMgaW4gaGltIHNoYWxsIG5vdCBwZXJpc2ggYnV0IGhhdmUgZXRlcm5hbCBsaWZlLiAtIEpvaG4gMzoxNg==
SITES: one:server1:80,two:server2:80,three:server3:80
DEFAULT_SITE: server1:80
MANAGEMENT_API: http://fakemanagementapi:80

services:
Expand Down
9 changes: 5 additions & 4 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ func Test_AuthProxy(t *testing.T) {
CookieName: cookieName,
Secret: tokenSecret,
Sites: authURLs,
DefaultSite: "default.example.com",
log: zap.L(),
ManagementAPI: managementAPI,
TokenPath: tokenPath,
Expand Down Expand Up @@ -59,10 +60,10 @@ func Test_AuthProxy(t *testing.T) {
wantRedirectURL: ptr(managementAPI + tokenPath + "?returnTo=%2F"),
},
{
name: "invalid level",
url: "/",
cookie: makeTestJWTCookie(cookieName, makeTestJWT(tokenSecret, "bad", validTime)),
wantErr: "not in sites",
name: "default site",
url: "/",
cookie: makeTestJWTCookie(cookieName, makeTestJWT(tokenSecret, "default", validTime)),
wantUpstream: ptr("default.example.com"),
},
{
name: "query valid -- redirect to set cookie",
Expand Down

0 comments on commit 26fc9b5

Please sign in to comment.