grim/hgkeeper

8098dd6d3587
Parents 68855a21fd28
Children 7dd7f9cf8e7b
move KeysDir to a private variable in users.go
--- a/access/access.go Sun Sep 08 04:55:34 2019 -0500
+++ b/access/access.go Sun Sep 08 05:11:49 2019 -0500
@@ -14,9 +14,6 @@
const (
// AccessFile is the base name of an access control file.
AccessFile = "access.yml"
-
- // KeysDir is the base name of directory holding public keys
- KeysDir = "keys"
)
const (
--- a/access/users.go Sun Sep 08 04:55:34 2019 -0500
+++ b/access/users.go Sun Sep 08 05:11:49 2019 -0500
@@ -10,10 +10,14 @@
"golang.org/x/crypto/ssh"
)
+const (
+ keysDir = "keys"
+)
+
func (a *Access) loadSshKeys(users []string) error {
USERS:
for _, username := range users {
- keyfile := filepath.Join(a.repoPath, "keys", username)
+ keyfile := filepath.Join(a.repoPath, keysDir, username)
if _, err := os.Stat(keyfile); os.IsNotExist(err) {
log.Warnf("no keys found for user %s", username)
continue