add support for partial authentication

Multi-step authentication is activated disabling all single-step
auth methods for a given user
This commit is contained in:
Nicola Murino
2020-04-09 23:32:42 +02:00
parent a0fe4cf5e4
commit b1c7317cf6
20 changed files with 498 additions and 75 deletions

View File

@@ -44,7 +44,7 @@ func sqlCommonValidateUserAndPass(username string, password string, dbHandle *sq
return checkUserAndPass(user, password)
}
func sqlCommonValidateUserAndPubKey(username string, pubKey string, dbHandle *sql.DB) (User, string, error) {
func sqlCommonValidateUserAndPubKey(username string, pubKey []byte, dbHandle *sql.DB) (User, string, error) {
var user User
if len(pubKey) == 0 {
return user, "", errors.New("Credentials cannot be null or empty")