Skip to content

Commit d5ff7e9

Browse files
committed
fix lint issues
Signed-off-by: Ivan Zvyagintsev <ivan.zvyagintsev@flant.com>
1 parent 3e1228a commit d5ff7e9

3 files changed

Lines changed: 11 additions & 4 deletions

File tree

connector/ldap/kerberos.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
"os"
1313
"strings"
1414

15+
"github.com/go-ldap/ldap/v3"
1516
"github.com/jcmturner/gofork/encoding/asn1"
1617
"github.com/jcmturner/gokrb5/v8/credentials"
1718
"github.com/jcmturner/gokrb5/v8/gssapi"
@@ -21,7 +22,6 @@ import (
2122
"github.com/jcmturner/gokrb5/v8/types"
2223

2324
"github.com/dexidp/dex/connector"
24-
"github.com/go-ldap/ldap/v3"
2525
)
2626

2727
// KerberosValidator abstracts SPNEGO validation for unit-testing.

connector/ldap/kerberos_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ import (
88
"strings"
99
"testing"
1010

11-
"github.com/dexidp/dex/connector"
1211
ldaplib "github.com/go-ldap/ldap/v3"
12+
13+
"github.com/dexidp/dex/connector"
1314
)
1415

1516
type mockKrbValidator struct {

server/handlers_test.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1031,11 +1031,14 @@ func TestHandlePasswordLogin_SPNEGOShortCircuit(t *testing.T) {
10311031
// to simulate successful SPNEGO authentication on GET.
10321032
type spnegoShortCircuit struct{ Identity connector.Identity }
10331033

1034-
func (s spnegoShortCircuit) Close() error { return nil }
1034+
func (s spnegoShortCircuit) Close() error { return nil }
1035+
10351036
func (s spnegoShortCircuit) Prompt() string { return "" }
1037+
10361038
func (s spnegoShortCircuit) Login(ctx context.Context, sc connector.Scopes, u, p string) (connector.Identity, bool, error) {
10371039
return connector.Identity{}, false, nil
10381040
}
1041+
10391042
func (s spnegoShortCircuit) TrySPNEGO(ctx context.Context, sc connector.Scopes, w http.ResponseWriter, r *http.Request) (*connector.Identity, connector.Handled, error) {
10401043
id := s.Identity
10411044
return &id, true, nil
@@ -1045,11 +1048,14 @@ func (s spnegoShortCircuit) TrySPNEGO(ctx context.Context, sc connector.Scopes,
10451048
// to simulate SPNEGO authentication that fails with an error (e.g., LDAP lookup failed).
10461049
type spnegoError struct{ Err error }
10471050

1048-
func (s spnegoError) Close() error { return nil }
1051+
func (s spnegoError) Close() error { return nil }
1052+
10491053
func (s spnegoError) Prompt() string { return "" }
1054+
10501055
func (s spnegoError) Login(ctx context.Context, sc connector.Scopes, u, p string) (connector.Identity, bool, error) {
10511056
return connector.Identity{}, false, nil
10521057
}
1058+
10531059
func (s spnegoError) TrySPNEGO(ctx context.Context, sc connector.Scopes, w http.ResponseWriter, r *http.Request) (*connector.Identity, connector.Handled, error) {
10541060
return nil, true, s.Err
10551061
}

0 commit comments

Comments
 (0)