Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Commit

Permalink
lint fixes
Browse files Browse the repository at this point in the history
Signed-off-by: pmahindrakar-oss <[email protected]>
  • Loading branch information
pmahindrakar-oss committed Aug 10, 2023
1 parent 97d2bcd commit b7e0174
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
6 changes: 2 additions & 4 deletions auth/handlers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,7 @@ func TestGetCallbackHandler(t *testing.T) {
t.Run("successful callback with redirect and successful preredirect hook call", func(t *testing.T) {
mockAuthCtx := setupMockedAuthContextAtEndpoint(localServer.URL)
r := plugins.NewRegistry()
var redirectFunc PreRedirectHookFunc
redirectFunc = func(redirectContext context.Context, authCtx interfaces.AuthenticationContext, request *http.Request, responseWriter http.ResponseWriter) *PreRedirectHookError {
var redirectFunc PreRedirectHookFunc = func(redirectContext context.Context, authCtx interfaces.AuthenticationContext, request *http.Request, responseWriter http.ResponseWriter) *PreRedirectHookError {
return nil
}

Expand Down Expand Up @@ -208,8 +207,7 @@ func TestGetCallbackHandler(t *testing.T) {
t.Run("successful callback with pre-redirecthook failure", func(t *testing.T) {
mockAuthCtx := setupMockedAuthContextAtEndpoint(localServer.URL)
r := plugins.NewRegistry()
var redirectFunc PreRedirectHookFunc
redirectFunc = func(redirectContext context.Context, authCtx interfaces.AuthenticationContext, request *http.Request, responseWriter http.ResponseWriter) *PreRedirectHookError {
var redirectFunc PreRedirectHookFunc = func(redirectContext context.Context, authCtx interfaces.AuthenticationContext, request *http.Request, responseWriter http.ResponseWriter) *PreRedirectHookError {
return &PreRedirectHookError{
Code: http.StatusPreconditionFailed,
Message: "precondition error",
Expand Down
3 changes: 1 addition & 2 deletions plugins/registry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ func TestRedirectHook(t *testing.T) {
ar := NewAtomicRegistry(nil)
r := NewRegistry()

var redirectHookfn PreRedirectHookFunc
redirectHookfn = func(ctx context.Context) error {
var redirectHookfn PreRedirectHookFunc = func(ctx context.Context) error {
return fmt.Errorf("redirect hook error")
}
err := r.Register(PluginIDPreRedirectHook, redirectHookfn)
Expand Down

0 comments on commit b7e0174

Please sign in to comment.