grim/hgkeeper

dc46af0b583b
Parents 4c0055e85914
Children a85cd09a6ba0
Spit out a warning if we find a duplicated key.

We're going to continue the existing behavior of overwriting the keys to not
break potential set ups for the time being.

Fixes HGKEEPER-22
--- a/access/users.go Tue Jun 21 17:00:43 2022 -0500
+++ b/access/users.go Tue Jun 21 22:34:16 2022 -0500
@@ -75,6 +75,14 @@
}
fingerprint := ssh.FingerprintSHA256(pubkey)
+ if duppedname, found := usernames[fingerprint]; found {
+ log.Warnf(
+ "duplicate key found for user %s. existing key was for %s.",
+ username,
+ duppedname,
+ )
+ }
+
usernames[fingerprint] = username
keys[fingerprint] = pubkey
counter++