diff options
| author | James Elliott <james-d-elliott@users.noreply.github.com> | 2020-04-05 09:28:09 +1000 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-05 09:28:09 +1000 | 
| commit | 9800421b88a07cc8287acee39ddf9c26ec38f9af (patch) | |
| tree | 0fe48fa1e558e03b9611917d9f30d4144ba4929d /internal/handlers/handler_configuration_test.go | |
| parent | a6308d72c37308caac64563816e876ef9177f9a0 (diff) | |
[FEATURE] Disable Reset Password (#823)
* [FEATURE] Disable Reset Password
* add configuration key to authentication_backend called disable_reset_password
* disable_reset_password prevents the API handler for the functionality and the UI element
* disable_reset_password is a boolean
* adjust RememberMeEnabled to be RememberMe instead as it's just unnecessary
* add docs for security measures and in the authentication docs
* updated config.template.yml
* add flexEnd style to align reset password when remember me disabled
* add todo items for ldap user/password validation relating to this
Diffstat (limited to 'internal/handlers/handler_configuration_test.go')
| -rw-r--r-- | internal/handlers/handler_configuration_test.go | 20 | 
1 files changed, 18 insertions, 2 deletions
diff --git a/internal/handlers/handler_configuration_test.go b/internal/handlers/handler_configuration_test.go index a5189241c..9c0a4cf45 100644 --- a/internal/handlers/handler_configuration_test.go +++ b/internal/handlers/handler_configuration_test.go @@ -29,7 +29,8 @@ func (s *ConfigurationSuite) TestShouldReturnConfiguredGATrackingID() {  	expectedBody := ConfigurationBody{  		GoogleAnalyticsTrackingID: GATrackingID, -		RememberMeEnabled:         true, +		RememberMe:                true, +		ResetPassword:             true,  	}  	ConfigurationGet(s.mock.Ctx) @@ -44,7 +45,22 @@ func (s *ConfigurationSuite) TestShouldDisableRememberMe() {  		s.mock.Ctx.Configuration.Session)  	expectedBody := ConfigurationBody{  		GoogleAnalyticsTrackingID: GATrackingID, -		RememberMeEnabled:         false, +		RememberMe:                false, +		ResetPassword:             true, +	} + +	ConfigurationGet(s.mock.Ctx) +	s.mock.Assert200OK(s.T(), expectedBody) +} + +func (s *ConfigurationSuite) TestShouldDisableResetPassword() { +	GATrackingID := "ABC" +	s.mock.Ctx.Configuration.GoogleAnalyticsTrackingID = GATrackingID +	s.mock.Ctx.Configuration.AuthenticationBackend.DisableResetPassword = true +	expectedBody := ConfigurationBody{ +		GoogleAnalyticsTrackingID: GATrackingID, +		RememberMe:                true, +		ResetPassword:             false,  	}  	ConfigurationGet(s.mock.Ctx)  | 
