summaryrefslogtreecommitdiff
path: root/internal/api/s2s/user/user_test.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2021-11-27 14:53:34 +0100
committerLibravatar GitHub <noreply@github.com>2021-11-27 14:53:34 +0100
commitce22e03f9deaf424aa21c5cc0ef85e58992a7882 (patch)
tree48711826e97c1590ae514791f5a6e910b98cfae8 /internal/api/s2s/user/user_test.go
parentrun sqlite tests in parallel (#331) (diff)
downloadgotosocial-ce22e03f9deaf424aa21c5cc0ef85e58992a7882.tar.xz
Require confirmed email when checking oauth token (#332)
* move token checker to security package * update tests with new security package * add oauth token checking to security package * check if user email confirmed when parsing token
Diffstat (limited to 'internal/api/s2s/user/user_test.go')
-rw-r--r--internal/api/s2s/user/user_test.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/internal/api/s2s/user/user_test.go b/internal/api/s2s/user/user_test.go
index 3d4697b36..da305488f 100644
--- a/internal/api/s2s/user/user_test.go
+++ b/internal/api/s2s/user/user_test.go
@@ -28,6 +28,7 @@ import (
"github.com/superseriousbusiness/gotosocial/internal/email"
"github.com/superseriousbusiness/gotosocial/internal/federation"
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
+ "github.com/superseriousbusiness/gotosocial/internal/oauth"
"github.com/superseriousbusiness/gotosocial/internal/processing"
"github.com/superseriousbusiness/gotosocial/internal/typeutils"
"github.com/superseriousbusiness/gotosocial/testrig"
@@ -43,6 +44,7 @@ type UserStandardTestSuite struct {
emailSender email.Sender
processor processing.Processor
storage *kv.KVStore
+ oauthServer oauth.Server
securityModule *security.Module
// standard suite models
@@ -80,7 +82,8 @@ func (suite *UserStandardTestSuite) SetupTest() {
suite.emailSender = testrig.NewEmailSender("../../../../web/template/", nil)
suite.processor = testrig.NewTestProcessor(suite.db, suite.storage, suite.federator, suite.emailSender)
suite.userModule = user.New(suite.config, suite.processor).(*user.Module)
- suite.securityModule = security.New(suite.config, suite.db).(*security.Module)
+ suite.oauthServer = testrig.NewTestOauthServer(suite.db)
+ suite.securityModule = security.New(suite.config, suite.db, suite.oauthServer).(*security.Module)
testrig.StandardDBSetup(suite.db, suite.testAccounts)
testrig.StandardStorageSetup(suite.storage, "../../../../testrig/media")
}