move oauth models into gtsmodel

This commit is contained in:
tsmethurst 2021-09-01 11:45:01 +02:00
commit 684bd56528
39 changed files with 1060 additions and 96 deletions

View file

@ -9,7 +9,6 @@ import (
"github.com/superseriousbusiness/gotosocial/internal/db"
"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"
)
@ -27,8 +26,8 @@ type AccountStandardTestSuite struct {
processor processing.Processor
// standard suite models
testTokens map[string]*oauth.Token
testClients map[string]*oauth.Client
testTokens map[string]*gtsmodel.Token
testClients map[string]*gtsmodel.Client
testApplications map[string]*gtsmodel.Application
testUsers map[string]*gtsmodel.User
testAccounts map[string]*gtsmodel.Account

View file

@ -41,7 +41,7 @@ type AuthTestSuite struct {
testAccount *gtsmodel.Account
testApplication *gtsmodel.Application
testUser *gtsmodel.User
testClient *oauth.Client
testClient *gtsmodel.Client
config *config.Config
}
@ -83,7 +83,7 @@ func (suite *AuthTestSuite) SetupSuite() {
Email: "user@example.org",
AccountID: acctID,
}
suite.testClient = &oauth.Client{
suite.testClient = &gtsmodel.Client{
ID: "a-known-client-id",
Secret: "some-secret",
Domain: fmt.Sprintf("%s://%s", c.Protocol, c.Host),
@ -112,8 +112,8 @@ func (suite *AuthTestSuite) SetupTest() {
suite.db = db
models := []interface{}{
&oauth.Client{},
&oauth.Token{},
&gtsmodel.Client{},
&gtsmodel.Token{},
&gtsmodel.User{},
&gtsmodel.Account{},
&gtsmodel.Application{},
@ -145,8 +145,8 @@ func (suite *AuthTestSuite) SetupTest() {
// TearDownTest drops the oauth_clients table and closes the pg connection after each test
func (suite *AuthTestSuite) TearDownTest() {
models := []interface{}{
&oauth.Client{},
&oauth.Token{},
&gtsmodel.Client{},
&gtsmodel.Token{},
&gtsmodel.User{},
&gtsmodel.Account{},
&gtsmodel.Application{},

View file

@ -57,8 +57,8 @@ type ServeFileTestSuite struct {
oauthServer oauth.Server
// standard suite models
testTokens map[string]*oauth.Token
testClients map[string]*oauth.Client
testTokens map[string]*gtsmodel.Token
testClients map[string]*gtsmodel.Client
testApplications map[string]*gtsmodel.Application
testUsers map[string]*gtsmodel.User
testAccounts map[string]*gtsmodel.Account

View file

@ -60,8 +60,8 @@ type MediaCreateTestSuite struct {
processor processing.Processor
// standard suite models
testTokens map[string]*oauth.Token
testClients map[string]*oauth.Client
testTokens map[string]*gtsmodel.Token
testClients map[string]*gtsmodel.Client
testApplications map[string]*gtsmodel.Application
testUsers map[string]*gtsmodel.User
testAccounts map[string]*gtsmodel.Account

View file

@ -27,7 +27,6 @@ import (
"github.com/superseriousbusiness/gotosocial/internal/db"
"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"
)
@ -45,8 +44,8 @@ type StatusStandardTestSuite struct {
storage blob.Storage
// standard suite models
testTokens map[string]*oauth.Token
testClients map[string]*oauth.Client
testTokens map[string]*gtsmodel.Token
testClients map[string]*gtsmodel.Client
testApplications map[string]*gtsmodel.Application
testUsers map[string]*gtsmodel.User
testAccounts map[string]*gtsmodel.Account