mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[chore] Admin CLI + new account creation refactoring (#2008)
* set maxPasswordLength to 72 bytes, rename validate function * refactor NewSignup * refactor admin account CLI commands * refactor oidc create user * refactor processor create * tweak password change, check old != new password
This commit is contained in:
@@ -17,7 +17,10 @@
|
||||
|
||||
package gtsmodel
|
||||
|
||||
import "time"
|
||||
import (
|
||||
"net"
|
||||
"time"
|
||||
)
|
||||
|
||||
// AdminAccountAction models an action taken by an instance administrator on an account.
|
||||
type AdminAccountAction struct {
|
||||
@@ -45,3 +48,23 @@ const (
|
||||
// AdminActionSuspend -- the account or application etc has been deleted.
|
||||
AdminActionSuspend AdminActionType = "suspend"
|
||||
)
|
||||
|
||||
// NewSignup models parameters for the creation
|
||||
// of a new user + account on this instance.
|
||||
//
|
||||
// Aside from username, email, and password, it is
|
||||
// fine to use zero values on fields of this struct.
|
||||
type NewSignup struct {
|
||||
Username string // Username of the new account.
|
||||
Email string // Email address of the user.
|
||||
Password string // Plaintext (not yet hashed) password for the user.
|
||||
|
||||
Reason string // Reason given by the user when submitting a sign up request (optional).
|
||||
PreApproved bool // Mark the new user/account as preapproved (optional)
|
||||
SignUpIP net.IP // IP address from which the sign up request occurred (optional).
|
||||
Locale string // Locale code for the new account/user (optional).
|
||||
AppID string // ID of the application used to create this account (optional).
|
||||
EmailVerified bool // Mark submitted email address as already verified (optional).
|
||||
ExternalID string // ID of this user in external OIDC system (optional).
|
||||
Admin bool // Mark new user as an admin user (optional).
|
||||
}
|
||||
|
Reference in New Issue
Block a user