From f355a45ff38a6bb4e8fdeb34246abf0bc9435fd6 Mon Sep 17 00:00:00 2001 From: James Elliott Date: Tue, 28 Jun 2022 17:13:47 +1000 Subject: [PATCH] fix(configuration): storage encryption_key required log grammar issue (#3617) --- internal/configuration/validator/const.go | 2 +- internal/configuration/validator/storage_test.go | 2 +- internal/suites/suite_cli_test.go | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/configuration/validator/const.go b/internal/configuration/validator/const.go index 34d3286fd..8656ca0fd 100644 --- a/internal/configuration/validator/const.go +++ b/internal/configuration/validator/const.go @@ -116,7 +116,7 @@ const ( // Storage Error constants. const ( errStrStorage = "storage: configuration for a 'local', 'mysql' or 'postgres' database must be provided" - errStrStorageEncryptionKeyMustBeProvided = "storage: option 'encryption_key' must is required" + errStrStorageEncryptionKeyMustBeProvided = "storage: option 'encryption_key' is required" errStrStorageEncryptionKeyTooShort = "storage: option 'encryption_key' must be 20 characters or longer" errFmtStorageUserPassMustBeProvided = "storage: %s: option 'username' and 'password' are required" //nolint:gosec errFmtStorageOptionMustBeProvided = "storage: %s: option '%s' is required" diff --git a/internal/configuration/validator/storage_test.go b/internal/configuration/validator/storage_test.go index 2d1cd8e50..b892c60fb 100644 --- a/internal/configuration/validator/storage_test.go +++ b/internal/configuration/validator/storage_test.go @@ -196,7 +196,7 @@ func (suite *StorageSuite) TestShouldRaiseErrorOnNoEncryptionKey() { suite.Require().Len(suite.validator.Warnings(), 0) suite.Require().Len(suite.validator.Errors(), 1) - suite.Assert().EqualError(suite.validator.Errors()[0], "storage: option 'encryption_key' must is required") + suite.Assert().EqualError(suite.validator.Errors()[0], "storage: option 'encryption_key' is required") } func (suite *StorageSuite) TestShouldRaiseErrorOnShortEncryptionKey() { diff --git a/internal/suites/suite_cli_test.go b/internal/suites/suite_cli_test.go index b236e1dd9..0fd51c2cc 100644 --- a/internal/suites/suite_cli_test.go +++ b/internal/suites/suite_cli_test.go @@ -622,12 +622,12 @@ func (s *CLISuite) TestStorageShouldShowErrWithoutConfig() { output, err := s.Exec("authelia-backend", []string{"authelia", s.testArg, s.coverageArg, "storage", "schema-info"}) s.Assert().EqualError(err, "exit status 1") - s.Assert().Contains(output, "Error: storage: configuration for a 'local', 'mysql' or 'postgres' database must be provided, storage: option 'encryption_key' must is required\n") + s.Assert().Contains(output, "Error: storage: configuration for a 'local', 'mysql' or 'postgres' database must be provided, storage: option 'encryption_key' is required\n") output, err = s.Exec("authelia-backend", []string{"authelia", s.testArg, s.coverageArg, "storage", "migrate", "history"}) s.Assert().EqualError(err, "exit status 1") - s.Assert().Contains(output, "Error: storage: configuration for a 'local', 'mysql' or 'postgres' database must be provided, storage: option 'encryption_key' must is required\n") + s.Assert().Contains(output, "Error: storage: configuration for a 'local', 'mysql' or 'postgres' database must be provided, storage: option 'encryption_key' is required\n") } func (s *CLISuite) TestStorage00ShouldShowCorrectPreInitInformation() {