summaryrefslogtreecommitdiff
path: root/internal/processing/processor.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2021-10-14 14:26:04 +0200
committerLibravatar GitHub <noreply@github.com>2021-10-14 14:26:04 +0200
commit107685e22e809123a31e6518249d14888767f0fe (patch)
tree3a46ca8a095f7ec1a0ee65845364b498099b6954 /internal/processing/processor.go
parentgo fmt (#278) (diff)
downloadgotosocial-107685e22e809123a31e6518249d14888767f0fe.tar.xz
User password change (#280)
* start passwordChangeHandler * add user scope * add user module / api path * add password change request * make comment clearer * add user to processor * required true * add processor call to handler * don't pass tc or channel * change password func + tests * add some first docs about password management * update swagger docs * add api tests * go fmt * test fixes
Diffstat (limited to 'internal/processing/processor.go')
-rw-r--r--internal/processing/processor.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/internal/processing/processor.go b/internal/processing/processor.go
index 5732ad092..e61661dc9 100644
--- a/internal/processing/processor.go
+++ b/internal/processing/processor.go
@@ -39,6 +39,7 @@ import (
mediaProcessor "github.com/superseriousbusiness/gotosocial/internal/processing/media"
"github.com/superseriousbusiness/gotosocial/internal/processing/status"
"github.com/superseriousbusiness/gotosocial/internal/processing/streaming"
+ "github.com/superseriousbusiness/gotosocial/internal/processing/user"
"github.com/superseriousbusiness/gotosocial/internal/stream"
"github.com/superseriousbusiness/gotosocial/internal/timeline"
"github.com/superseriousbusiness/gotosocial/internal/typeutils"
@@ -173,6 +174,9 @@ type Processor interface {
// OpenStreamForAccount opens a new stream for the given account, with the given stream type.
OpenStreamForAccount(ctx context.Context, account *gtsmodel.Account, streamType string) (*stream.Stream, gtserror.WithCode)
+ // UserChangePassword changes the password for the given user, with the given form.
+ UserChangePassword(ctx context.Context, authed *oauth.Auth, form *apimodel.PasswordChangeRequest) gtserror.WithCode
+
/*
FEDERATION API-FACING PROCESSING FUNCTIONS
These functions are intended to be called when the federating client needs an immediate (ie., synchronous) reply
@@ -247,6 +251,7 @@ type processor struct {
statusProcessor status.Processor
streamingProcessor streaming.Processor
mediaProcessor mediaProcessor.Processor
+ userProcessor user.Processor
}
// NewProcessor returns a new Processor that uses the given federator
@@ -259,6 +264,7 @@ func NewProcessor(config *config.Config, tc typeutils.TypeConverter, federator f
accountProcessor := account.New(db, tc, mediaHandler, oauthServer, fromClientAPI, federator, config)
adminProcessor := admin.New(db, tc, mediaHandler, fromClientAPI, config)
mediaProcessor := mediaProcessor.New(db, tc, mediaHandler, storage, config)
+ userProcessor := user.New(db, config)
return &processor{
fromClientAPI: fromClientAPI,
@@ -279,6 +285,7 @@ func NewProcessor(config *config.Config, tc typeutils.TypeConverter, federator f
statusProcessor: statusProcessor,
streamingProcessor: streamingProcessor,
mediaProcessor: mediaProcessor,
+ userProcessor: userProcessor,
}
}