summaryrefslogtreecommitdiff
path: root/internal/api
diff options
context:
space:
mode:
authorLibravatar tsmethurst <tobi.smethurst@protonmail.com>2021-09-01 11:45:01 +0200
committerLibravatar tsmethurst <tobi.smethurst@protonmail.com>2021-09-01 11:45:01 +0200
commit684bd56528c5ffa37af8340b8b141fe390dd05a4 (patch)
tree4a78d70c2ca7f15e47f8a2e6bc51d62c99b0f52d /internal/api
parentMerge branch 'struct_validation' of github.com:superseriousbusiness/gotosocia... (diff)
downloadgotosocial-684bd56528c5ffa37af8340b8b141fe390dd05a4.tar.xz
move oauth models into gtsmodel
Diffstat (limited to 'internal/api')
-rw-r--r--internal/api/client/account/account_test.go5
-rw-r--r--internal/api/client/auth/auth_test.go12
-rw-r--r--internal/api/client/fileserver/servefile_test.go4
-rw-r--r--internal/api/client/media/mediacreate_test.go4
-rw-r--r--internal/api/client/status/status_test.go5
-rw-r--r--internal/api/s2s/user/user_test.go5
6 files changed, 16 insertions, 19 deletions
diff --git a/internal/api/client/account/account_test.go b/internal/api/client/account/account_test.go
index 5e1959cc2..02817984b 100644
--- a/internal/api/client/account/account_test.go
+++ b/internal/api/client/account/account_test.go
@@ -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
diff --git a/internal/api/client/auth/auth_test.go b/internal/api/client/auth/auth_test.go
index 3d5170f31..9b778ad1d 100644
--- a/internal/api/client/auth/auth_test.go
+++ b/internal/api/client/auth/auth_test.go
@@ -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{},
diff --git a/internal/api/client/fileserver/servefile_test.go b/internal/api/client/fileserver/servefile_test.go
index 4eec3bae5..579bb9606 100644
--- a/internal/api/client/fileserver/servefile_test.go
+++ b/internal/api/client/fileserver/servefile_test.go
@@ -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
diff --git a/internal/api/client/media/mediacreate_test.go b/internal/api/client/media/mediacreate_test.go
index 8433786e4..1b2c84cf9 100644
--- a/internal/api/client/media/mediacreate_test.go
+++ b/internal/api/client/media/mediacreate_test.go
@@ -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
diff --git a/internal/api/client/status/status_test.go b/internal/api/client/status/status_test.go
index 563a23ce2..f9b4e3671 100644
--- a/internal/api/client/status/status_test.go
+++ b/internal/api/client/status/status_test.go
@@ -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
diff --git a/internal/api/s2s/user/user_test.go b/internal/api/s2s/user/user_test.go
index 71d4395eb..ecd5fadc8 100644
--- a/internal/api/s2s/user/user_test.go
+++ b/internal/api/s2s/user/user_test.go
@@ -10,7 +10,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"
)
@@ -29,8 +28,8 @@ type UserStandardTestSuite struct {
securityModule *security.Module
// 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