@@ -1031,11 +1031,14 @@ func TestHandlePasswordLogin_SPNEGOShortCircuit(t *testing.T) {
10311031// to simulate successful SPNEGO authentication on GET.
10321032type spnegoShortCircuit struct { Identity connector.Identity }
10331033
1034- func (s spnegoShortCircuit ) Close () error { return nil }
1034+ func (s spnegoShortCircuit ) Close () error { return nil }
1035+
10351036func (s spnegoShortCircuit ) Prompt () string { return "" }
1037+
10361038func (s spnegoShortCircuit ) Login (ctx context.Context , sc connector.Scopes , u , p string ) (connector.Identity , bool , error ) {
10371039 return connector.Identity {}, false , nil
10381040}
1041+
10391042func (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).
10461049type spnegoError struct { Err error }
10471050
1048- func (s spnegoError ) Close () error { return nil }
1051+ func (s spnegoError ) Close () error { return nil }
1052+
10491053func (s spnegoError ) Prompt () string { return "" }
1054+
10501055func (s spnegoError ) Login (ctx context.Context , sc connector.Scopes , u , p string ) (connector.Identity , bool , error ) {
10511056 return connector.Identity {}, false , nil
10521057}
1058+
10531059func (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