MCPcopy Index your code
hub / github.com/tailscale/tailscale / TestAuthMethodFallback

Function TestAuthMethodFallback

tempfork/sshtest/ssh/client_auth_test.go:185–207  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

183}
184
185func TestAuthMethodFallback(t *testing.T) {
186 var passwordCalled bool
187 config := &ClientConfig{
188 User: "testuser",
189 Auth: []AuthMethod{
190 PublicKeys(testSigners["rsa"]),
191 PasswordCallback(
192 func() (string, error) {
193 passwordCalled = true
194 return "WRONG", nil
195 }),
196 },
197 HostKeyCallback: InsecureIgnoreHostKey(),
198 }
199
200 if err := tryAuth(t, config); err != nil {
201 t.Fatalf("unable to dial remote side: %s", err)
202 }
203
204 if passwordCalled {
205 t.Errorf("password auth tried before public-key auth.")
206 }
207}
208
209func TestAuthMethodWrongPassword(t *testing.T) {
210 config := &ClientConfig{

Callers

nothing calls this directly

Calls 6

PublicKeysFunction · 0.85
PasswordCallbackFunction · 0.85
InsecureIgnoreHostKeyFunction · 0.85
tryAuthFunction · 0.85
FatalfMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…