This repository has been archived by the owner on Nov 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Add user login/logout endpoints. Login provides a token with all scopes (for now) that can be used to help you authenticate requests. Hitting the logout endpoint with this same token will delete the client all together.
- Loading branch information
Showing
7 changed files
with
303 additions
and
8 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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Admin UI | ||
|
||
We include some user-related endpoints for the Fidesops Admin UI. In this section, we'll cover: | ||
|
||
- I need permissions to be able to create a user. So how do I create the first user? | ||
- How do I create other users? | ||
- How do I log in and log out? | ||
|
||
|
||
|
||
## Creating the first user | ||
|
||
To create the first user, run the following `make` command: | ||
|
||
`make user` | ||
|
||
After supplying a name and suitable password, this will create an Admin Root UI User that you can use to login and create other users. | ||
|
||
|
||
## Logging in | ||
|
||
`POST api/v1/login` with your username and password in the request, and you will be issued a token with all scopes (for now) | ||
that can be used to make subsequent requests. | ||
|
||
```json | ||
{ | ||
"username": "test_username", | ||
"password": "Suitablylongwithnumber8andsymbol$" | ||
} | ||
``` | ||
|
||
|
||
## Logging out | ||
|
||
`POST api/v1/logout` with the user token as your Bearer Token. This token will be invalidated (by deleting the associated client). | ||
|
||
|
||
## Creating users | ||
|
||
`POST api/v1/user` with a token that has `user:create` scope, with your username and password in the request body. | ||
|
||
```json | ||
{ | ||
"username": "test_username", | ||
"password": "Suitablylongwithnumber8andsymbol$" | ||
} | ||
``` | ||
|
||
## Deleting users | ||
|
||
`DELETE api/v1/user/<user_id>` with a token that has `user:delete` scope. Additionally, you must either be the Admin Root UI User | ||
or the user you're trying to delete. |
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
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
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
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 |
---|---|---|
|
@@ -74,3 +74,7 @@ | |
# User URLs | ||
USERS = "/user" | ||
USER_DETAIL = "/user/{user_id}" | ||
|
||
# Login URLs | ||
LOGIN = "/login" | ||
LOGOUT = "/logout" |
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
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