sshd: we don't need the user certificate

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino
2022-03-31 18:16:50 +02:00
parent e079444e8a
commit 5c114b28e3
10 changed files with 70 additions and 37 deletions

View File

@@ -1583,7 +1583,13 @@ func TestAddUserNoCredentials(t *testing.T) {
u := getTestUser()
u.Password = ""
u.PublicKeys = []string{}
_, _, err := httpdtest.AddUser(u, http.StatusBadRequest)
user, _, err := httpdtest.AddUser(u, http.StatusCreated)
assert.NoError(t, err)
// this user cannot login with an empty password but it still can use an SSH cert
_, err = getJWTAPITokenFromTestServer(defaultTokenAuthUser, "")
assert.Error(t, err)
_, err = httpdtest.RemoveUser(user, http.StatusOK)
assert.NoError(t, err)
}