mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-10 23:57:34 +02:00
remove forward auth (#3628)
This commit is contained in:
parent
ba07afc245
commit
fa26587f19
68 changed files with 302 additions and 5072 deletions
|
@ -18,20 +18,12 @@ func TestAuthorization(t *testing.T) {
|
|||
accessType := []string{"direct", "api"}
|
||||
for _, at := range accessType {
|
||||
t.Run(at, func(t *testing.T) {
|
||||
var withAPI, withForwardAuth flows.AuthenticateOption
|
||||
var withAPI flows.AuthenticateOption
|
||||
|
||||
if at == "api" {
|
||||
if ClusterType == "traefik" || ClusterType == "nginx" {
|
||||
t.Skip()
|
||||
return
|
||||
}
|
||||
withAPI = flows.WithAPI()
|
||||
}
|
||||
|
||||
if ClusterType == "nginx" {
|
||||
withForwardAuth = flows.WithForwardAuth(true)
|
||||
}
|
||||
|
||||
t.Run("public", func(t *testing.T) {
|
||||
client := getClient()
|
||||
|
||||
|
@ -53,7 +45,7 @@ func TestAuthorization(t *testing.T) {
|
|||
t.Run("allowed", func(t *testing.T) {
|
||||
client := getClient()
|
||||
res, err := flows.Authenticate(ctx, client, mustParseURL("https://httpdetails.localhost.pomerium.io/by-domain"),
|
||||
withAPI, withForwardAuth, flows.WithEmail("user1@dogs.test"))
|
||||
withAPI, flows.WithEmail("user1@dogs.test"))
|
||||
if assert.NoError(t, err) {
|
||||
assert.Equal(t, http.StatusOK, res.StatusCode, "expected OK for dogs.test")
|
||||
}
|
||||
|
@ -61,7 +53,7 @@ func TestAuthorization(t *testing.T) {
|
|||
t.Run("not allowed", func(t *testing.T) {
|
||||
client := getClient()
|
||||
res, err := flows.Authenticate(ctx, client, mustParseURL("https://httpdetails.localhost.pomerium.io/by-domain"),
|
||||
withAPI, withForwardAuth, flows.WithEmail("user1@cats.test"))
|
||||
withAPI, flows.WithEmail("user1@cats.test"))
|
||||
if assert.NoError(t, err) {
|
||||
assertDeniedAccess(t, res, "expected Forbidden for cats.test, but got: %d", res.StatusCode)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue