diff --git a/server/config.go b/server/config.go index 18be85caa..fd50b019d 100644 --- a/server/config.go +++ b/server/config.go @@ -633,7 +633,7 @@ func (c *Config) ValidateAuth() ([]error, error) { if name == "HashKey" || name == "BlockKey" { if len(value) != 64 { - errors = append(errors, fmt.Errorf("invalid key length for %s", name)) + errors = append(errors, fmt.Errorf("invalid key length for %s. exp %d, got %d", name, 64, len(value))) } } diff --git a/server/config_internal_test.go b/server/config_internal_test.go index 6a3c7c1a3..50332d51f 100644 --- a/server/config_internal_test.go +++ b/server/config_internal_test.go @@ -283,6 +283,7 @@ func TestConfig_validateAuth(t *testing.T) { validTestURL := "https://url.com/" validClientID := "clientid" validClientSecret := "clientSecret" + validKey := "3db6665be8b860af422155acf2346d4fcb46678fca42e60d934abe0b7ce43600" notValidURL := "not-a-url" emptyString := "" validStringSlice := []string{"https://graph.microsoft.com/.default", "offline_access"} @@ -465,7 +466,7 @@ func TestConfig_validateAuth(t *testing.T) { GroupEndpointURL: notValidURL, Scopes: validStringSlice, HashKey: emptyString, - BlockKey: validString, + BlockKey: validKey, }, }, { @@ -479,8 +480,8 @@ func TestConfig_validateAuth(t *testing.T) { TokenURL: validTestURL, GroupEndpointURL: validTestURL, Scopes: validStringSlice, - HashKey: validString, - BlockKey: validString, + HashKey: validKey, + BlockKey: validKey, }, }, { @@ -494,8 +495,8 @@ func TestConfig_validateAuth(t *testing.T) { TokenURL: validString, GroupEndpointURL: validString, Scopes: validStringSlice, - HashKey: validString, - BlockKey: validString, + HashKey: validKey, + BlockKey: validKey, }, }, }