summaryrefslogtreecommitdiff
path: root/internal/handlers/handler_firstfactor_test.go
diff options
context:
space:
mode:
authorAmir Zarrinkafsh <nightah@me.com>2020-04-09 11:05:17 +1000
committerGitHub <noreply@github.com>2020-04-09 11:05:17 +1000
commitde2c5836fd8a2b99260b555173fcd3023292da0f (patch)
tree6af2c37c31a8d439dbb0432ec54b8cb7f7978bd9 /internal/handlers/handler_firstfactor_test.go
parent2fed503e5e538cbbdcdc09ff52a1ddad94218400 (diff)
[Buildkite] Introduce CI linting with golangci-lint and reviewdog (#832)
* [Buildkite] Introduce CI linting with golangci-lint and reviewdog * Initial pass of golangci-lint * Add gosimple (megacheck) recommendations * Add golint recommendations * [BUGFIX] Migrate authentication traces from v3 mongodb * Add deadcode recommendations * [BUGFIX] Fix ShortTimeouts suite when run in dev workflow * Add unused recommendations * Add unparam recommendations * Disable linting on unfixable errors instead of skipping files * Adjust nolint notation for unparam * Fix ineffectual assignment to err raised by linter. * Export environment variable in agent hook * Add ineffassign recommendations * Add staticcheck recommendations * Add gocyclo recommendations * Adjust ineffassign recommendations Co-authored-by: Clement Michaud <clement.michaud34@gmail.com>
Diffstat (limited to 'internal/handlers/handler_firstfactor_test.go')
-rw-r--r--internal/handlers/handler_firstfactor_test.go14
1 files changed, 3 insertions, 11 deletions
diff --git a/internal/handlers/handler_firstfactor_test.go b/internal/handlers/handler_firstfactor_test.go
index e15bf13b3..7d8901716 100644
--- a/internal/handlers/handler_firstfactor_test.go
+++ b/internal/handlers/handler_firstfactor_test.go
@@ -10,7 +10,6 @@ import (
"github.com/authelia/authelia/internal/models"
"github.com/golang/mock/gomock"
- "github.com/sirupsen/logrus"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/suite"
@@ -31,13 +30,6 @@ func (s *FirstFactorSuite) TearDownTest() {
s.mock.Close()
}
-func (s *FirstFactorSuite) assertError500(err string) {
- assert.Equal(s.T(), 500, s.mock.Ctx.Response.StatusCode())
- assert.Equal(s.T(), []byte(InternalError), s.mock.Ctx.Response.Body())
- assert.Equal(s.T(), err, s.mock.Hook.LastEntry().Message)
- assert.Equal(s.T(), logrus.ErrorLevel, s.mock.Hook.LastEntry().Level)
-}
-
func (s *FirstFactorSuite) TestShouldFailIfBodyIsNil() {
FirstFactorPost(s.mock.Ctx)
@@ -288,7 +280,7 @@ func (s *FirstFactorRedirectionSuite) SetupTest() {
s.mock.Ctx.Configuration.DefaultRedirectionURL = "https://default.local"
s.mock.Ctx.Configuration.AccessControl.DefaultPolicy = "bypass"
s.mock.Ctx.Configuration.AccessControl.Rules = []schema.ACLRule{
- schema.ACLRule{
+ {
Domain: "default.local",
Policy: "one_factor",
},
@@ -384,11 +376,11 @@ func (s *FirstFactorRedirectionSuite) TestShouldReply200WhenUnsafeTargetURLProvi
s.mock.Ctx.Providers.Authorizer = authorization.NewAuthorizer(schema.AccessControlConfiguration{
DefaultPolicy: "one_factor",
Rules: []schema.ACLRule{
- schema.ACLRule{
+ {
Domain: "test.example.com",
Policy: "one_factor",
},
- schema.ACLRule{
+ {
Domain: "example.com",
Policy: "two_factor",
},