loginsrv

Unnamed repository; edit this file 'description' to name the repository.
git clone git@jamesshield.xyz:repos/loginsrv.git
Log | Files | Refs | README | LICENSE

commit 3daa252707bab5b8d7b0dc43d6fd6a7ee3bfca49
parent 3915364b9cdc64c7d764c466a7e9df507f5cbd8b
Author: Gregor Weckbecker <gregor.weckbecker@snabble.io>
Date:   Thu, 12 Mar 2020 17:51:42 +0100

Merge pull request #73 from magikstm/Issue-39

Remove undocumented "files" parameter for htpasswd and enhance doc
Diffstat:
MREADME.md | 2+-
Mhtpasswd/backend.go | 6------
Mhtpasswd/backend_test.go | 24------------------------
3 files changed, 1 insertion(+), 31 deletions(-)

diff --git a/README.md b/README.md @@ -262,7 +262,7 @@ Parameters for the provider: | Parameter-Name | Description | | ------------------|----------------------------| -| file | Path to the password file | +| file | Path to the password file (multiple files can be used by separating them with ';') | Example: ``` diff --git a/htpasswd/backend.go b/htpasswd/backend.go @@ -23,12 +23,6 @@ func init() { func BackendFactory(config map[string]string) (login.Backend, error) { var files []string - if f, exist := config["files"]; exist { - for _, file := range strings.Split(f, ";") { - files = append(files, file) - } - } - if f, exist := config["file"]; exist { for _, file := range strings.Split(f, ";") { files = append(files, file) diff --git a/htpasswd/backend_test.go b/htpasswd/backend_test.go @@ -46,30 +46,6 @@ func TestSetupTwoFiles(t *testing.T) { backend.(*Backend).auth.filenames) } -func TestSetupTwoConfigs(t *testing.T) { - p, exist := login.GetProvider(ProviderName) - True(t, exist) - NotNil(t, p) - - configFiles := writeTmpfile(testfile, testfile) - configFile := writeTmpfile(testfile, testfile) - - var morphed []File - for _, curFile := range append(configFiles, configFile...) { - morphed = append(morphed, File{curFile, modTime(curFile)}) - } - - backend, err := p(map[string]string{ - "files": strings.Join(configFiles, ";"), - "file": strings.Join(configFile, ";"), - }) - - NoError(t, err) - Equal(t, - morphed, - backend.(*Backend).auth.filenames) -} - func TestSetup_Error(t *testing.T) { p, exist := login.GetProvider(ProviderName) True(t, exist)