register with optional role in the post request
This commit is contained in:
37
server/src/auth/docs/role_added.txt
Normal file
37
server/src/auth/docs/role_added.txt
Normal file
@@ -0,0 +1,37 @@
|
||||
❯ grpcurl -plaintext -d '{
|
||||
"username": "testuser_default_role",
|
||||
"email": "default@example.com",
|
||||
"password": "password",
|
||||
"password_confirmation": "password"
|
||||
}' localhost:50051 multieko2.auth.AuthService/Register
|
||||
{
|
||||
"id": "73017288-af41-49d8-b4cb-2ac2109b38a1",
|
||||
"username": "testuser_default_role",
|
||||
"email": "default@example.com",
|
||||
"role": "accountant"
|
||||
}
|
||||
❯ grpcurl -plaintext -d '{
|
||||
"username": "testuser_admin_role",
|
||||
"email": "admin@example.com",
|
||||
"password": "password",
|
||||
"password_confirmation": "password",
|
||||
"role": "admin"
|
||||
}' localhost:50051 multieko2.auth.AuthService/Register
|
||||
{
|
||||
"id": "9437e318-818b-4c34-822d-c2d6601b835e",
|
||||
"username": "testuser_admin_role",
|
||||
"email": "admin@example.com",
|
||||
"role": "admin"
|
||||
}
|
||||
❯ grpcurl -plaintext -d '{
|
||||
"username": "testuser_invalid_role",
|
||||
"email": "invalid@example.com",
|
||||
"password": "password",
|
||||
"password_confirmation": "password",
|
||||
"role": "invalid_role_name"
|
||||
}' localhost:50051 multieko2.auth.AuthService/Register
|
||||
ERROR:
|
||||
Code: InvalidArgument
|
||||
Message: Invalid role specified: 'invalid_role_name'
|
||||
╭─ ~/Doc/pr/multieko2/server main +3 !1
|
||||
╰─
|
||||
Reference in New Issue
Block a user