Documentation ¶
Index ¶
- type Processor
- func (p *Processor) Create(ctx context.Context, app *gtsmodel.Application, ...) (*gtsmodel.User, gtserror.WithCode)
- func (p *Processor) DeleteSelf(ctx context.Context, account *gtsmodel.Account) gtserror.WithCode
- func (p *Processor) EmailChange(ctx context.Context, user *gtsmodel.User, password string, newEmail string) (*apimodel.User, gtserror.WithCode)
- func (p *Processor) EmailConfirm(ctx context.Context, token string) (*gtsmodel.User, gtserror.WithCode)
- func (p *Processor) EmailGetUserForConfirmToken(ctx context.Context, token string) (*gtsmodel.User, gtserror.WithCode)
- func (p *Processor) Get(ctx context.Context, user *gtsmodel.User) (*apimodel.User, gtserror.WithCode)
- func (p *Processor) PasswordChange(ctx context.Context, user *gtsmodel.User, oldPassword string, ...) gtserror.WithCode
- func (p *Processor) TokenForNewUser(ctx context.Context, appToken oauth2.TokenInfo, app *gtsmodel.Application, ...) (*apimodel.Token, gtserror.WithCode)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Processor ¶
type Processor struct {
// contains filtered or unexported fields
}
func New ¶
func New( state *state.State, converter *typeutils.Converter, oauthServer oauth.Server, emailSender email.Sender, ) Processor
New returns a new user processor.
func (*Processor) Create ¶ added in v0.16.0
func (p *Processor) Create( ctx context.Context, app *gtsmodel.Application, form *apimodel.AccountCreateRequest, ) (*gtsmodel.User, gtserror.WithCode)
Create processes the given form for creating a new user+account.
App should be the app used to create the user+account. If nil, the instance app will be used.
Precondition: the form's fields should have already been validated and normalized by the caller.
func (*Processor) DeleteSelf ¶ added in v0.16.0
DeleteSelf is like Account.Delete, but specifically for local user+accounts deleting themselves.
Calling DeleteSelf results in a delete message being enqueued in the processor, which causes side effects to occur: delete will be federated out to other instances, and the above Delete function will be called afterwards from the processor, to clear out the account's bits and bobs, and stubbify it.
func (*Processor) EmailChange ¶ added in v0.16.0
func (p *Processor) EmailChange( ctx context.Context, user *gtsmodel.User, password string, newEmail string, ) (*apimodel.User, gtserror.WithCode)
EmailChange processes an email address change request for the given user.
func (*Processor) EmailConfirm ¶ added in v0.8.0
func (p *Processor) EmailConfirm(ctx context.Context, token string) (*gtsmodel.User, gtserror.WithCode)
EmailConfirm processes an email confirmation request, usually initiated as a result of clicking on a link in a 'confirm your email address' type email.
func (*Processor) EmailGetUserForConfirmToken ¶ added in v0.16.0
func (p *Processor) EmailGetUserForConfirmToken(ctx context.Context, token string) (*gtsmodel.User, gtserror.WithCode)
EmailGetUserForConfirmToken retrieves the user (with account) from the database for the given "confirm your email" token string.
func (*Processor) Get ¶ added in v0.16.0
func (p *Processor) Get(ctx context.Context, user *gtsmodel.User) (*apimodel.User, gtserror.WithCode)
Get returns the API model of the given user. Should only be served if user == the user doing the request.
func (*Processor) PasswordChange ¶ added in v0.8.0
func (p *Processor) PasswordChange(ctx context.Context, user *gtsmodel.User, oldPassword string, newPassword string) gtserror.WithCode
PasswordChange processes a password change request for the given user.
func (*Processor) TokenForNewUser ¶ added in v0.16.0
func (p *Processor) TokenForNewUser( ctx context.Context, appToken oauth2.TokenInfo, app *gtsmodel.Application, user *gtsmodel.User, ) (*apimodel.Token, gtserror.WithCode)
TokenForNewUser generates an OAuth Bearer token for a new user (with account) created by Create().