Change allow-no-keys to allow-keyless in config

Christian Rocha created

Change summary

config/config.go   | 16 ++++++++--------
config/defaults.go |  2 +-
config/git.go      |  2 +-
3 files changed, 10 insertions(+), 10 deletions(-)

Detailed changes

config/config.go 🔗

@@ -13,14 +13,14 @@ import (
 )
 
 type Config struct {
-	Name        string `yaml:"name"`
-	Host        string `yaml:"host"`
-	Port        int    `yaml:"port"`
-	AnonAccess  string `yaml:"anon-access"`
-	AllowNoKeys bool   `yaml:"allow-no-keys"`
-	Users       []User `yaml:"users"`
-	Repos       []Repo `yaml:"repos"`
-	Source      *git.RepoSource
+	Name         string `yaml:"name"`
+	Host         string `yaml:"host"`
+	Port         int    `yaml:"port"`
+	AnonAccess   string `yaml:"anon-access"`
+	AllowKeyless bool   `yaml:"allow-keyless"`
+	Users        []User `yaml:"users"`
+	Repos        []Repo `yaml:"repos"`
+	Source       *git.RepoSource
 }
 
 type User struct {

config/defaults.go 🔗

@@ -10,7 +10,7 @@ port: %d
 anon-access: %s
 
 # Allow users with no private keys read-only access. Any password is accepted.
-allow-no-keys: false
+allow-keyless: false
 
 # Customize repo display in menu
 repos:

config/git.go 🔗

@@ -24,7 +24,7 @@ func (cfg *Config) AuthRepo(repo string, pk ssh.PublicKey) gm.AccessLevel {
 }
 
 func (cfg *Config) PasswordHandler(ctx ssh.Context, password string) bool {
-	return (cfg.AnonAccess != "no-access") && cfg.AllowNoKeys
+	return (cfg.AnonAccess != "no-access") && cfg.AllowKeyless
 }
 
 func (cfg *Config) PublicKeyHandler(ctx ssh.Context, pk ssh.PublicKey) bool {