Skip to content

Commit

Permalink
Fix lint.
Browse files Browse the repository at this point in the history
  • Loading branch information
Joerger committed Oct 23, 2024
1 parent 60b4fe2 commit 15b110f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/auth/sso_mfa_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,11 @@ import (
"testing"

"github.com/google/uuid"
"github.com/gravitational/trace"
"github.com/jonboulle/clockwork"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/gravitational/trace"

"github.com/gravitational/teleport/api/client/proto"
"github.com/gravitational/teleport/api/constants"
mfav1 "github.com/gravitational/teleport/api/gen/proto/go/teleport/mfa/v1"
Expand Down Expand Up @@ -414,6 +413,7 @@ func TestSSOMFAChallenge_Validation(t *testing.T) {
ConnectorType: samlConnector.GetKind(),
},
})
require.NoError(t, err)

// Create a fake saml user with MFA disabled.
noMFASAMLUser, noMFASAMLRole, err := CreateUserAndRole(a, "saml-user-no-mfa", []string{"role"}, nil)
Expand Down Expand Up @@ -716,7 +716,6 @@ func TestSSOMFAChallenge_Validation(t *testing.T) {
}, tt.username, tt.requiredExtensions)
tt.assertValidation(t, data, err)
})

}
}

Expand All @@ -727,23 +726,27 @@ type fakeSSOService struct {
func (s *fakeSSOService) CreateSAMLAuthRequest(ctx context.Context, req types.SAMLAuthRequest) (*types.SAMLAuthRequest, error) {
return nil, nil // unused in these tests.
}

func (s *fakeSSOService) CreateSAMLAuthRequestForMFA(ctx context.Context, req types.SAMLAuthRequest) (*types.SAMLAuthRequest, error) {
req.ID = uuid.NewString()
req.RedirectURL = uuid.NewString()
return &req, s.a.Services.CreateSAMLAuthRequest(ctx, req, defaults.SAMLAuthRequestTTL)
}

func (s *fakeSSOService) ValidateSAMLResponse(ctx context.Context, samlResponse, connectorID, clientIP string) (*authclient.SAMLAuthResponse, error) {
return nil, nil // unused in these tests.
}

func (s *fakeSSOService) CreateOIDCAuthRequest(ctx context.Context, req types.OIDCAuthRequest) (*types.OIDCAuthRequest, error) {
return nil, nil // unused in these tests.
}

func (s *fakeSSOService) CreateOIDCAuthRequestForMFA(ctx context.Context, req types.OIDCAuthRequest) (*types.OIDCAuthRequest, error) {
req.StateToken = uuid.NewString()
req.RedirectURL = uuid.NewString()
return &req, s.a.Services.CreateOIDCAuthRequest(ctx, req, defaults.OIDCAuthRequestTTL)
}

func (s *fakeSSOService) ValidateOIDCAuthCallback(ctx context.Context, q url.Values) (*authclient.OIDCAuthResponse, error) {
return nil, nil // unused in these tests.
}

0 comments on commit 15b110f

Please sign in to comment.