aboutsummaryrefslogtreecommitdiff
path: root/userapi/storage
diff options
context:
space:
mode:
authorS7evinK <2353100+S7evinK@users.noreply.github.com>2022-03-24 22:45:44 +0100
committerGitHub <noreply@github.com>2022-03-24 22:45:44 +0100
commitf2e550efd832662e6c032bebfef4a68da0b4c8ee (patch)
treef46d0e82f85f0e30687fe568a26c0923e8f14a83 /userapi/storage
parent8e76523b04e3ebc9546f2b019e86dcd3b516be5a (diff)
Refactor appservice & client API to use userapi internal (#2290)
* Refactor user api internal * Refactor clientapi to use internal userapi * Use internal userapi instead of user DB directly * Remove AccountDB dependency * Fix linter issues Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
Diffstat (limited to 'userapi/storage')
-rw-r--r--userapi/storage/interface.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/userapi/storage/interface.go b/userapi/storage/interface.go
index 77706710..b15470dd 100644
--- a/userapi/storage/interface.go
+++ b/userapi/storage/interface.go
@@ -24,12 +24,17 @@ import (
"github.com/matrix-org/dendrite/userapi/storage/tables"
)
-type Database interface {
- GetAccountByPassword(ctx context.Context, localpart, plaintextPassword string) (*api.Account, error)
+type Profile interface {
GetProfileByLocalpart(ctx context.Context, localpart string) (*authtypes.Profile, error)
+ SearchProfiles(ctx context.Context, searchString string, limit int) ([]authtypes.Profile, error)
SetPassword(ctx context.Context, localpart string, plaintextPassword string) error
SetAvatarURL(ctx context.Context, localpart string, avatarURL string) error
SetDisplayName(ctx context.Context, localpart string, displayName string) error
+}
+
+type Database interface {
+ Profile
+ GetAccountByPassword(ctx context.Context, localpart, plaintextPassword string) (*api.Account, error)
// CreateAccount makes a new account with the given login name and password, and creates an empty profile
// for this account. If no password is supplied, the account will be a passwordless account. If the
// account already exists, it will return nil, ErrUserExists.
@@ -48,7 +53,6 @@ type Database interface {
GetThreePIDsForLocalpart(ctx context.Context, localpart string) (threepids []authtypes.ThreePID, err error)
CheckAccountAvailability(ctx context.Context, localpart string) (bool, error)
GetAccountByLocalpart(ctx context.Context, localpart string) (*api.Account, error)
- SearchProfiles(ctx context.Context, searchString string, limit int) ([]authtypes.Profile, error)
DeactivateAccount(ctx context.Context, localpart string) (err error)
CreateOpenIDToken(ctx context.Context, token, localpart string) (exp int64, err error)
GetOpenIDTokenAttributes(ctx context.Context, token string) (*api.OpenIDTokenAttributes, error)