Create new user
Motivation
Create(register) new user
Functional design
POST /api/v2/apps/{owner}/{app}/users
Headers
Key
Value
Content-Type
application/json
Body
JSON object:
{
"verifiedEmailToken": "{verified-email-token}",
"password": "{password}",
"displayName": "{display-name}"
}
Parameters
Parameter
Type
Description
Path
owner
string
name of a user who owns the application
app
string
name of an application
Body
password
string
password for the new user
display-name
string
display name for the new user
Result
Code
Description
Body
201
Created
Technical design
Components
pkg/registry
CreateEmailLogin
function:
TYPE CreateEmailLoginParams (
Email varchar VERIFIABLE,
AppName text NOT NULL,
SubjectKind int32 NOT NULL,
WSKindInitializationData text(1024) NOT NULL,
ProfileCluster int32 NOT NULL
);
COMMAND CreateEmailLogin (CreateEmailLoginParams, UNLOGGED CreateLoginUnloggedParams);
GRANT EXECUTE ON COMMAND CreateEmailLogin TO sys.Anonymous;
declaration in VSQL:
~cmp.registry.CreateEmailLogin.vsql~
✅the extension code:
~cmp.registry.CreateEmailLogin.go~
✅
CreateLogin
must only be allowed to system~cmp.registry.CreateLogin.vsql~
❓
pkg/router
URL path handler
~cmp.router.UsersCreatePathHandler~
✅:parses the request Body; calculates pseudo-wsid;
sends v2 request
c.registry.CreateLogin
to Command Processor
pkg/sys/it
integration test for /users
~it.TestUsersCreate~
✅
Last updated
Was this helpful?