Renamed bridge to general users and keep bridge only for bridge stuff

This commit is contained in:
Michal Horejsek
2020-05-21 14:37:15 +02:00
parent 4e2ab9b389
commit 4d2baa6b85
30 changed files with 720 additions and 661 deletions

View File

@ -20,6 +20,7 @@ package context
import (
"github.com/ProtonMail/proton-bridge/internal/bridge"
"github.com/ProtonMail/proton-bridge/internal/preferences"
"github.com/ProtonMail/proton-bridge/internal/users"
"github.com/ProtonMail/proton-bridge/pkg/listener"
)
@ -57,9 +58,9 @@ func (ctx *TestContext) RestartBridge() error {
func newBridgeInstance(
t *bddT,
cfg *fakeConfig,
credStore bridge.CredentialsStorer,
credStore users.CredentialsStorer,
eventListener listener.Listener,
clientManager bridge.ClientManager,
clientManager users.ClientManager,
) *bridge.Bridge {
panicHandler := &panicHandler{t: t}
pref := preferences.New(cfg)

View File

@ -23,8 +23,8 @@ import (
"path/filepath"
"time"
"github.com/ProtonMail/proton-bridge/internal/bridge"
"github.com/ProtonMail/proton-bridge/internal/store"
"github.com/ProtonMail/proton-bridge/internal/users"
"github.com/ProtonMail/proton-bridge/pkg/srp"
"github.com/pkg/errors"
"github.com/stretchr/testify/assert"
@ -56,7 +56,7 @@ func (ctx *TestContext) LoginUser(username, password, mailboxPassword string) (e
}
// GetUser retrieves the bridge user matching the given query string.
func (ctx *TestContext) GetUser(username string) (*bridge.User, error) {
func (ctx *TestContext) GetUser(username string) (*users.User, error) {
return ctx.bridge.GetUser(username)
}

View File

@ -20,6 +20,7 @@ package context
import (
"github.com/ProtonMail/proton-bridge/internal/bridge"
"github.com/ProtonMail/proton-bridge/internal/users"
"github.com/ProtonMail/proton-bridge/pkg/listener"
"github.com/ProtonMail/proton-bridge/pkg/pmapi"
"github.com/ProtonMail/proton-bridge/test/accounts"
@ -48,7 +49,7 @@ type TestContext struct {
// Bridge core related variables.
bridge *bridge.Bridge
bridgeLastError error
credStore bridge.CredentialsStorer
credStore users.CredentialsStorer
// IMAP related variables.
imapAddr string

View File

@ -20,7 +20,7 @@ package context
import (
"strings"
"github.com/ProtonMail/proton-bridge/internal/bridge/credentials"
"github.com/ProtonMail/proton-bridge/internal/users/credentials"
)
// bridgePassword is password to be used for IMAP or SMTP under tests.