Skip to content

Commit

Permalink
Fixup Test for ruleNoOpAuthenticatorWithMutator to with GLOB
Browse files Browse the repository at this point in the history
  • Loading branch information
mmellison authored and bplcensys committed Mar 23, 2024
1 parent 1c06375 commit 6d4184a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion api/decision_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,13 @@ func TestDecisionAPI(t *testing.T) {
Upstream: rule.Upstream{URL: "", StripPath: "/strip-path/", PreserveHost: true},
}

ruleNoOpAuthenticatorWithMutatorGLOB := rule.Rule{
Match: &rule.Match{Methods: []string{"GET"}, URL: ts.URL + "/authn-noop-mutator/<[0-9]*>"},

Check failure on line 78 in api/decision_test.go

View workflow job for this annotation

GitHub Actions / Run tests and lints

File is not `goimports`-ed (goimports)
Authenticators: []rule.Handler{{Handler: "noop"}},
Authorizer: rule.Handler{Handler: "allow"},
Mutators: []rule.Handler{{Handler: "id_token"}},
Upstream: rule.Upstream{URL: ""},
}
ruleNoOpAuthenticatorGLOB := rule.Rule{
Match: &rule.Match{Methods: []string{"GET"}, URL: ts.URL + "/authn-noop/<[0-9]*>"},
Authenticators: []rule.Handler{{Handler: "noop"}},
Expand Down Expand Up @@ -117,7 +124,7 @@ func TestDecisionAPI(t *testing.T) {
d: "should pass and skip mutator with noop authenticator",
url: ts.URL + "/decisions" + "/authn-noop-mutator/1234",
rulesRegexp: []rule.Rule{ruleNoOpAuthenticatorWithMutator},
rulesGlob: []rule.Rule{ruleNoOpAuthenticatorWithMutator},
rulesGlob: []rule.Rule{ruleNoOpAuthenticatorWithMutatorGLOB},
code: http.StatusOK,
transform: func(r *http.Request) {
r.Header.Add("Authorization", "basic user:pass")
Expand Down

0 comments on commit 6d4184a

Please sign in to comment.