mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-01 02:22:24 -05:00
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
This commit is contained in:
parent
5ed03480e7
commit
ce22e03f9d
8 changed files with 57 additions and 30 deletions
|
|
@ -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")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,6 +33,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"
|
||||
|
|
@ -48,6 +49,7 @@ type WebfingerStandardTestSuite struct {
|
|||
emailSender email.Sender
|
||||
processor processing.Processor
|
||||
storage *kv.KVStore
|
||||
oauthServer oauth.Server
|
||||
securityModule *security.Module
|
||||
|
||||
// standard suite models
|
||||
|
|
@ -83,7 +85,8 @@ func (suite *WebfingerStandardTestSuite) SetupTest() {
|
|||
suite.emailSender = testrig.NewEmailSender("../../../../web/template/", nil)
|
||||
suite.processor = testrig.NewTestProcessor(suite.db, suite.storage, suite.federator, suite.emailSender)
|
||||
suite.webfingerModule = webfinger.New(suite.config, suite.processor).(*webfinger.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")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue