Function restapi::requests::user::create_user::create_user
source · [−]pub async fn create_user(
tracking_label: &str,
config: &CoreConfig,
db_pool: &Pool<PostgresConnectionManager<MakeTlsConnector>>,
kafka_pool: &KafkaPublisher,
bytes: &[u8]
) -> Result<Response<Body>, Infallible>
Expand description
create_user
Create a new user from the deserialized
ApiReqUserCreate
json values from the bytes
argument.
Also create a new user jwt and email verification record (if enabled).
Arguments
tracking_label
-&str
- caller logging labelconfig
-CoreConfig
db_pool
-Pool
- postgres client db threadpool with required tls encryptionkafka_pool
-KafkaPublisher
for asynchronously publishing messages to the connected kafka clusterbytes
-&[u8]
- received bytes from the hyperRequest
’sBody
Returns
create_user on Success Returns
The new user record from the db and a jwt for auto-auth.
(token created by
create_user_token
)
hyper Response
containing a json-serialized
ApiResUserCreate
dictionary within the
Body
and a
201
HTTP status code
Ok(Response
)
Errors
create_user on Failure Returns
All errors return as a
hyper Response
containing a json-serialized
ApiResUserCreate
dictionary with a
non-201
HTTP status code
Err(Response
)