Browse Source

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 3 years ago committed by GitHub
parent
commit
feec44572d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      pkg/cluster/storage.go

2
pkg/cluster/storage.go

@ -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

Loading…
Cancel
Save