From 83f4387effdc2b4a6411d21be702a6952208f7c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yunier=20Rojas=20Garc=C3=ADa?= Date: Sun, 3 Mar 2024 15:50:47 +0100 Subject: [PATCH] chore(tests): Increase test coverage https://app.codecov.io/gh/ory/oathkeeper/pull/1153 --- pipeline/authn/authenticator_delegate.go | 8 ++------ proxy/proxy_test.go | 10 ---------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/pipeline/authn/authenticator_delegate.go b/pipeline/authn/authenticator_delegate.go index 405ff21a8c..271fd9d976 100644 --- a/pipeline/authn/authenticator_delegate.go +++ b/pipeline/authn/authenticator_delegate.go @@ -23,17 +23,13 @@ func (a *AuthenticatorDelegate) GetID() string { return "delegate" } -func (a *AuthenticatorDelegate) Validate(config json.RawMessage) error { +func (a *AuthenticatorDelegate) Validate(_ json.RawMessage) error { if !a.c.AuthenticatorIsEnabled(a.GetID()) { return NewErrAuthenticatorNotEnabled(a) } - - if err := a.c.AuthenticatorConfig(a.GetID(), config, nil); err != nil { - return NewErrAuthenticatorMisconfigured(a, err) - } return nil } -func (a *AuthenticatorDelegate) Authenticate(r *http.Request, session *AuthenticationSession, config json.RawMessage, _ pipeline.Rule) error { +func (a *AuthenticatorDelegate) Authenticate(r *http.Request, _ *AuthenticationSession, _ json.RawMessage, _ pipeline.Rule) error { return ErrAuthenticatorDelegate } diff --git a/proxy/proxy_test.go b/proxy/proxy_test.go index 5cc78e137c..f2b43f030b 100644 --- a/proxy/proxy_test.go +++ b/proxy/proxy_test.go @@ -437,12 +437,7 @@ func TestProxy(t *testing.T) { rulesRegexp: []rule.Rule{ruleDelegateAuthenticator}, rulesGlob: []rule.Rule{ruleDelegateAuthenticatorGlob}, code: http.StatusOK, - transform: func(r *http.Request) { - r.Header.Add("Authorization", "bearer token") - }, messages: []string{ - "authorization=bearer token", - "url=/authn-delegate/1234", "host=" + x.ParseURLOrPanic(backend.URL).Host, }, }, @@ -452,12 +447,7 @@ func TestProxy(t *testing.T) { rulesRegexp: []rule.Rule{ruleDelegateAuthenticatorModifyUpstream}, rulesGlob: []rule.Rule{ruleDelegateAuthenticatorModifyUpstreamGlob}, code: http.StatusOK, - transform: func(r *http.Request) { - r.Header.Add("Authorization", "bearer token") - }, messages: []string{ - "authorization=bearer token", - "url=/authn-delegate/1234", "host=" + x.ParseURLOrPanic(ts.URL).Host, }, },