diff options
author | santhoshivan23 <47689668+santhoshivan23@users.noreply.github.com> | 2023-06-22 22:07:21 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-22 16:37:21 +0000 |
commit | 45082d4dcefadceada1b4374f3876365887cfd4a (patch) | |
tree | 899fda990a71f16eb05073098196a2a1a1218bd3 /userapi/storage/interface.go | |
parent | a734b112c6577a23b87c6b54c50fb2e9a629cf2b (diff) |
feat: admin APIs for token authenticated registration (#3101)
### Pull Request Checklist
<!-- Please read
https://matrix-org.github.io/dendrite/development/contributing before
submitting your pull request -->
* [x] I have added Go unit tests or [Complement integration
tests](https://github.com/matrix-org/complement) for this PR _or_ I have
justified why this PR doesn't need tests
* [x] Pull request includes a [sign off below using a legally
identifiable
name](https://matrix-org.github.io/dendrite/development/contributing#sign-off)
_or_ I have already signed off privately
Signed-off-by: `Santhoshivan Amudhan santhoshivan23@gmail.com`
Diffstat (limited to 'userapi/storage/interface.go')
-rw-r--r-- | userapi/storage/interface.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/userapi/storage/interface.go b/userapi/storage/interface.go index 4f5e99a8..125b3158 100644 --- a/userapi/storage/interface.go +++ b/userapi/storage/interface.go @@ -23,6 +23,7 @@ import ( "github.com/matrix-org/gomatrixserverlib/fclient" "github.com/matrix-org/gomatrixserverlib/spec" + clientapi "github.com/matrix-org/dendrite/clientapi/api" "github.com/matrix-org/dendrite/clientapi/auth/authtypes" "github.com/matrix-org/dendrite/internal/pushrules" "github.com/matrix-org/dendrite/userapi/api" @@ -30,6 +31,15 @@ import ( "github.com/matrix-org/dendrite/userapi/types" ) +type RegistrationTokens interface { + RegistrationTokenExists(ctx context.Context, token string) (bool, error) + InsertRegistrationToken(ctx context.Context, registrationToken *clientapi.RegistrationToken) (bool, error) + ListRegistrationTokens(ctx context.Context, returnAll bool, valid bool) ([]clientapi.RegistrationToken, error) + GetRegistrationToken(ctx context.Context, tokenString string) (*clientapi.RegistrationToken, error) + DeleteRegistrationToken(ctx context.Context, tokenString string) error + UpdateRegistrationToken(ctx context.Context, tokenString string, newAttributes map[string]interface{}) (*clientapi.RegistrationToken, error) +} + type Profile interface { GetProfileByLocalpart(ctx context.Context, localpart string, serverName spec.ServerName) (*authtypes.Profile, error) SearchProfiles(ctx context.Context, searchString string, limit int) ([]authtypes.Profile, error) @@ -144,6 +154,7 @@ type UserDatabase interface { Pusher Statistics ThreePID + RegistrationTokens } type KeyChangeDatabase interface { |