aboutsummaryrefslogtreecommitdiff
path: root/internal/db/backup_test.go
diff options
context:
space:
mode:
authorᴜɴᴋɴᴡᴏɴ <u@gogs.io>2020-09-20 11:19:02 +0800
committerGitHub <noreply@github.com>2020-09-20 11:19:02 +0800
commit3af91d7cfdb334e602d312743a89e64cd2d369ee (patch)
treec04a148917cdd9be878ca0e5fbcd552825c18df7 /internal/db/backup_test.go
parentb836a56e6e823eecbce2dd99121a340418f1d5b7 (diff)
auth: decouple types and functions from db (#6320)
Diffstat (limited to 'internal/db/backup_test.go')
-rw-r--r--internal/db/backup_test.go15
1 files changed, 9 insertions, 6 deletions
diff --git a/internal/db/backup_test.go b/internal/db/backup_test.go
index a65e6944..27688889 100644
--- a/internal/db/backup_test.go
+++ b/internal/db/backup_test.go
@@ -14,6 +14,9 @@ import (
"github.com/pkg/errors"
"gorm.io/gorm"
+ "gogs.io/gogs/internal/auth"
+ "gogs.io/gogs/internal/auth/github"
+ "gogs.io/gogs/internal/auth/pam"
"gogs.io/gogs/internal/cryptoutil"
"gogs.io/gogs/internal/lfsutil"
"gogs.io/gogs/internal/testutil"
@@ -79,22 +82,22 @@ func setupDBToDump(t *testing.T, db *gorm.DB) {
},
&LoginSource{
- Type: LoginPAM,
+ Type: auth.PAM,
Name: "My PAM",
IsActived: true,
- Config: &PAMConfig{
+ Provider: pam.NewProvider(&pam.Config{
ServiceName: "PAM service",
- },
+ }),
CreatedUnix: 1588568886,
UpdatedUnix: 1588572486, // 1 hour later
},
&LoginSource{
- Type: LoginGitHub,
+ Type: auth.GitHub,
Name: "GitHub.com",
IsActived: true,
- Config: &GitHubConfig{
+ Provider: github.NewProvider(&github.Config{
APIEndpoint: "https://api.github.com",
- },
+ }),
CreatedUnix: 1588568886,
},
}