summaryrefslogtreecommitdiff
path: root/internal/handlers/handler_firstfactor_test.go
diff options
context:
space:
mode:
authorJames Elliott <james-d-elliott@users.noreply.github.com>2021-11-23 20:45:38 +1100
committerGitHub <noreply@github.com>2021-11-23 20:45:38 +1100
commit3695aa8140eb91fd54a4cd849e1340ad4c36d987 (patch)
treee2cbb84db06b8058dc89ba9c616f016a223e6e67 /internal/handlers/handler_firstfactor_test.go
parent884dc99083ba280d1a93103c4e16d4446ff7fdcc (diff)
feat(storage): primary key for all tables and general qol refactoring (#2431)
This is a massive overhaul to the SQL Storage for Authelia. It facilitates a whole heap of utility commands to help manage the database, primary keys, ensures all database requests use a context for cancellations, and paves the way for a few other PR's which improve the database. Fixes #1337
Diffstat (limited to 'internal/handlers/handler_firstfactor_test.go')
-rw-r--r--internal/handlers/handler_firstfactor_test.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/internal/handlers/handler_firstfactor_test.go b/internal/handlers/handler_firstfactor_test.go
index 4902ebbbc..bcfc5f34a 100644
--- a/internal/handlers/handler_firstfactor_test.go
+++ b/internal/handlers/handler_firstfactor_test.go
@@ -58,7 +58,7 @@ func (s *FirstFactorSuite) TestShouldFailIfUserProviderCheckPasswordFail() {
s.mock.StorageProviderMock.
EXPECT().
- AppendAuthenticationLog(gomock.Eq(models.AuthenticationAttempt{
+ AppendAuthenticationLog(s.mock.Ctx, gomock.Eq(models.AuthenticationAttempt{
Username: "test",
Successful: false,
Time: s.mock.Clock.Now(),
@@ -83,7 +83,7 @@ func (s *FirstFactorSuite) TestShouldCheckAuthenticationIsMarkedWhenInvalidCrede
s.mock.StorageProviderMock.
EXPECT().
- AppendAuthenticationLog(gomock.Eq(models.AuthenticationAttempt{
+ AppendAuthenticationLog(s.mock.Ctx, gomock.Eq(models.AuthenticationAttempt{
Username: "test",
Successful: false,
Time: s.mock.Clock.Now(),
@@ -106,7 +106,7 @@ func (s *FirstFactorSuite) TestShouldFailIfUserProviderGetDetailsFail() {
s.mock.StorageProviderMock.
EXPECT().
- AppendAuthenticationLog(gomock.Any()).
+ AppendAuthenticationLog(s.mock.Ctx, gomock.Any()).
Return(nil)
s.mock.UserProviderMock.
@@ -133,7 +133,7 @@ func (s *FirstFactorSuite) TestShouldFailIfAuthenticationMarkFail() {
s.mock.StorageProviderMock.
EXPECT().
- AppendAuthenticationLog(gomock.Any()).
+ AppendAuthenticationLog(s.mock.Ctx, gomock.Any()).
Return(fmt.Errorf("failed"))
s.mock.Ctx.Request.SetBodyString(`{
@@ -164,7 +164,7 @@ func (s *FirstFactorSuite) TestShouldAuthenticateUserWithRememberMeChecked() {
s.mock.StorageProviderMock.
EXPECT().
- AppendAuthenticationLog(gomock.Any()).
+ AppendAuthenticationLog(s.mock.Ctx, gomock.Any()).
Return(nil)
s.mock.Ctx.Request.SetBodyString(`{
@@ -204,7 +204,7 @@ func (s *FirstFactorSuite) TestShouldAuthenticateUserWithRememberMeUnchecked() {
s.mock.StorageProviderMock.
EXPECT().
- AppendAuthenticationLog(gomock.Any()).
+ AppendAuthenticationLog(s.mock.Ctx, gomock.Any()).
Return(nil)
s.mock.Ctx.Request.SetBodyString(`{
@@ -248,7 +248,7 @@ func (s *FirstFactorSuite) TestShouldSaveUsernameFromAuthenticationBackendInSess
s.mock.StorageProviderMock.
EXPECT().
- AppendAuthenticationLog(gomock.Any()).
+ AppendAuthenticationLog(s.mock.Ctx, gomock.Any()).
Return(nil)
s.mock.Ctx.Request.SetBodyString(`{
@@ -306,7 +306,7 @@ func (s *FirstFactorRedirectionSuite) SetupTest() {
s.mock.StorageProviderMock.
EXPECT().
- AppendAuthenticationLog(gomock.Any()).
+ AppendAuthenticationLog(s.mock.Ctx, gomock.Any()).
Return(nil)
}