MCPcopy
hub / github.com/kopia/kopia / TestCombineAuthenticators

Function TestCombineAuthenticators

internal/auth/authn_test.go:26–36  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

24}
25
26func TestCombineAuthenticators(t *testing.T) {
27 a1 := auth.AuthenticateSingleUser("user1", "password1")
28 a2 := auth.AuthenticateSingleUser("user2", "password2")
29 a3 := auth.AuthenticateSingleUser("user3", "password3")
30
31 a := auth.CombineAuthenticators(a1, a2, a3)
32 verifyAuthenticator(t, a, "user1", "password1", true)
33 verifyAuthenticator(t, a, "user2", "password2", true)
34 verifyAuthenticator(t, a, "user3", "password3", true)
35 verifyAuthenticator(t, a, "user1", "password2", false)
36}
37
38func verifyAuthenticator(t *testing.T, a auth.Authenticator, username, password string, want bool) {
39 t.Helper()

Callers

nothing calls this directly

Calls 3

AuthenticateSingleUserFunction · 0.92
CombineAuthenticatorsFunction · 0.92
verifyAuthenticatorFunction · 0.85

Tested by

no test coverage detected