From 68c805c8ad6353f71fa973bb2386655f2e6800f0 Mon Sep 17 00:00:00 2001 From: Christian Rocha Date: Wed, 6 Oct 2021 11:42:12 -0400 Subject: [PATCH] Change allow-no-keys to allow-keyless in config --- config/config.go | 16 ++++++++-------- config/defaults.go | 2 +- config/git.go | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/config/config.go b/config/config.go index 168ba4c56d4187238a0d05cc45b1b9229f548fc2..028e173fa76c5bc21894f353af32ae930edbbf44 100644 --- a/config/config.go +++ b/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 { diff --git a/config/defaults.go b/config/defaults.go index 0eaceb131042bda44378cdacd11bdc670361f4a6..85499246ae7f34649d6d0969fa30358b9f9bc5b7 100644 --- a/config/defaults.go +++ b/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: diff --git a/config/git.go b/config/git.go index bd7372a8b0eee0c657f1e6a022f44c9e581f5c61..c2569b20f1b6b06f54faac2319dd116840d1f7d1 100644 --- a/config/git.go +++ b/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 {