Improve error message when using a "K10" prefixed token (#4180)

* Add new error message with a K10 prefixed secret token

Signed-off-by: dereknola <derek.nola@suse.com>
pull/4193/head
Derek Nola 2021-10-11 10:00:22 -07:00 committed by GitHub
parent ac7a8d89c6
commit feec44572d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -201,7 +201,7 @@ func readTokenFromFile(serverToken, certs, dataDir string) (string, error) {
func normalizeToken(token string) (string, error) {
_, password, ok := clientaccess.ParseUsernamePassword(token)
if !ok {
return password, errors.New("failed to normalize token")
return password, errors.New("failed to normalize token; must be in format K10<CA-HASH>::<USERNAME>:<PASSWORD> or <PASSWORD>")
}
return password, nil