From 59cddcc2f7ebd8312a6ce3873abb800aa0a040ec Mon Sep 17 00:00:00 2001 From: Philip O Toole Date: Tue, 19 Apr 2016 21:31:45 -0700 Subject: [PATCH] Correctly indicate no auth enabled --- CHANGELOG.md | 3 +++ cmd/rqlited/main.go | 11 ++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b55ecc96..4e4b0828 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 2.2.1 (April 19th 2016) +- [PR #95](https://github.com/otoolep/rqlite/pull/95): Correctly enable HTTP authentication. + ## 2.2.0 (April 18th 2016) - [PR #84](https://github.com/otoolep/rqlite/pull/84): Encrypted API (HTTPS) now supported. - [PR #85](https://github.com/otoolep/rqlite/pull/85): BasicAuth support. diff --git a/cmd/rqlited/main.go b/cmd/rqlited/main.go index 93f2f09f..9fb41470 100644 --- a/cmd/rqlited/main.go +++ b/cmd/rqlited/main.go @@ -156,21 +156,22 @@ func main() { log.Println("successfully joined node at", joinAddr) } - // Load authentication information, if supplied. - var credentialStore *auth.CredentialsStore + // Create HTTP server and load authentication information, if supplied. + var s *httpd.Service if authFile != "" { f, err := os.Open(authFile) if err != nil { log.Fatalf("failed to open authentication file %s: %s", authFile, err.Error()) } - credentialStore = auth.NewCredentialsStore() + credentialStore := auth.NewCredentialsStore() if err := credentialStore.Load(f); err != nil { log.Fatalf("failed to load authentication file: %s", err.Error()) } + s = httpd.New(httpAddr, store, credentialStore) + } else { + s = httpd.New(httpAddr, store, nil) } - // Create the HTTP query server. - s := httpd.New(httpAddr, store, credentialStore) s.CertFile = x509Cert s.KeyFile = x509Key s.DisableRedirect = disRedirect