forked from kernelci/kernelci-api
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
As per the current user management scheme, there is no constraint for admin users to be a part of `admin` user group. Only `is_superuser=true` flag is required while creating admin users. Update documentation accordingly. Signed-off-by: Jeny Sadadia <[email protected]>
- Loading branch information
1 parent
663e823
commit ae87ef7
Showing
2 changed files
with
7 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,13 +68,14 @@ $ curl -X 'POST' | |
{'id': '615f30020eb7c3c6616e5ac3', 'email': '[email protected]', 'is_active':true, 'is_superuser':false, 'is_verified':false, 'username': 'test', 'groups': []} | ||
``` | ||
|
||
An user accout can be added to multiple user groups by providing user group names to request query parameter. All the admin users | ||
should be added to `admin` group by default. | ||
To create an admin user, provide username, email, password, `"groups": ["admin"]`, and `"is_superuser": 1` to request data dictionary. | ||
To create an admin user, provide username, email, password, and `"is_superuser": 1` to request data dictionary. | ||
A user account can be added to multiple user groups by providing a list of user group names to request dictionary. | ||
|
||
For example, the below command will create an admin user and add it to `kernelci` user group. | ||
|
||
``` | ||
$ curl -X 'POST' 'http://localhost:8001/latest/user/register' -H 'accept: application/json' -H 'Content-Type: application/json' -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ0ZXN0Iiwic2NvcGVzIjpbImFkbWluIiwidXNlciJdfQ.KhcIWfMRr3xTFSCLcr5L4KTUVSsfSsLeyRDEjgkQRBg' -d '{"username": "test_admin", "email": "[email protected]", "password": "admin", "groups": ["admin"], "is_superuser": 1}' | ||
{'_id': '615f30020eb7c3c6616e5ac6', 'username': 'test_admin', 'email': '[email protected]', 'is_active':true, 'is_superuser':true, 'is_verified':false, 'groups': [{'id':'648c07a70fccad400a122509','name':'admin'}]} | ||
$ curl -X 'POST' 'http://localhost:8001/latest/user/register' -H 'accept: application/json' -H 'Content-Type: application/json' -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ0ZXN0Iiwic2NvcGVzIjpbImFkbWluIiwidXNlciJdfQ.KhcIWfMRr3xTFSCLcr5L4KTUVSsfSsLeyRDEjgkQRBg' -d '{"username": "test_admin", "email": "[email protected]", "password": "admin", "is_superuser": 1, "groups": ["kernelci"]}' | ||
{'_id': '615f30020eb7c3c6616e5ac6', 'username': 'test_admin', 'email': '[email protected]', 'is_active':true, 'is_superuser':true, 'is_verified':false, 'groups': [{"id":"648ff894bd39930355ed16ad","name":"kernelci"}]} | ||
``` | ||
|
||
Another way of creating users is to use `kci user add` tool from kernelci-core. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -86,7 +86,6 @@ tool provided in the `kernelci-api` repository which has a wrapper script | |
``` | ||
$ ./scripts/setup_admin_user --email EMAIL | ||
Creating kernelci-api_api_run ... done | ||
Creating admin group... | ||
Password for user 'admin': | ||
Creating admin user... | ||
``` | ||
|
@@ -122,7 +121,7 @@ $ curl -X 'GET' \ | |
-H 'accept: application/json' \ | ||
-H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJib2IifQ.KHkILtsJaCmueOfFCj79HGr6kHamuZFdB1Yz_5GqcC4' | ||
{"id":"615f30020eb7c3c6616e5ac3", "email": "[email protected]", "is_active":true, "is_superuser":true, "is_verified":true, | ||
"groups": [{"id":"648c07a70fccad400a122509","name":"admin"}], "username":"admin"} | ||
"groups": [], "username":"admin"} | ||
``` | ||
|
||
### Setup SSH keys | ||
|