diff options
| author | James Elliott <james-d-elliott@users.noreply.github.com> | 2021-03-05 15:18:31 +1100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-03-05 15:18:31 +1100 |
| commit | 4dce8f94962d3bd0099bbb202f76696a551d099b (patch) | |
| tree | fdc3bba51d8f23b6866ddbbbd9e9feb50e9fb293 /internal/configuration/validator/authentication_test.go | |
| parent | 455b8590477f0ec7841e6766294937cecb94640f (diff) | |
perf(authorizer): preload access control lists (#1640)
* adjust session refresh to always occur (for disabled users)
* feat: adds filtering option for Request Method in ACL's
* simplify flow of internal/authorization/authorizer.go's methods
* implement query string checking
* utilize authorizer.Object fully
* make matchers uniform
* add tests
* add missing request methods
* add frontend enhancements to handle request method
* add request method to 1FA Handler Suite
* add internal ACL representations (preparsing)
* expand on access_control next
* add docs
* remove unnecessary slice for network names and instead just use a plain string
* add warning for ineffectual bypass policy (due to subjects)
* add user/group wildcard support
* fix(authorization): allow subject rules to match anonymous users
* feat(api): add new params
* docs(api): wording adjustments
* test: add request method into testing and proxy docs
* test: add several checks and refactor schema validation for ACL
* test: add integration test for methods acl
* refactor: apply suggestions from code review
* docs(authorization): update description
Diffstat (limited to 'internal/configuration/validator/authentication_test.go')
| -rw-r--r-- | internal/configuration/validator/authentication_test.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/internal/configuration/validator/authentication_test.go b/internal/configuration/validator/authentication_test.go index cf01525f7..574a5b041 100644 --- a/internal/configuration/validator/authentication_test.go +++ b/internal/configuration/validator/authentication_test.go @@ -214,6 +214,18 @@ func (suite *LdapAuthenticationBackendSuite) TestShouldValidateCompleteConfigura suite.Assert().False(suite.validator.HasErrors()) } +func (suite *LdapAuthenticationBackendSuite) TestShouldValidateDefaultImplementationAndUsernameAttribute() { + suite.configuration.Ldap.Implementation = "" + suite.configuration.Ldap.UsernameAttribute = "" + ValidateAuthenticationBackend(&suite.configuration, suite.validator) + + suite.Assert().Equal(schema.LDAPImplementationCustom, suite.configuration.Ldap.Implementation) + + suite.Assert().Equal(suite.configuration.Ldap.UsernameAttribute, schema.DefaultLDAPAuthenticationBackendConfiguration.UsernameAttribute) + suite.Assert().False(suite.validator.HasWarnings()) + suite.Assert().False(suite.validator.HasErrors()) +} + func (suite *LdapAuthenticationBackendSuite) TestShouldRaiseErrorWhenImplementationIsInvalidMSAD() { suite.configuration.Ldap.Implementation = "masd" |
