This repository has been archived by the owner on Apr 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Documentation About Authentication Module
This documentation added initial information about the module the authentication.
- Loading branch information
1 parent
6ab4619
commit ba2ffaa
Showing
4 changed files
with
164 additions
and
59 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,92 @@ | ||
****************** | ||
Auth Documentation | ||
****************** | ||
|
||
The authentication module (kytos.core.authentication) is a resource under | ||
development that provides a means of protection for REST endpoints. | ||
By using this resource, endpoints that are public by default, | ||
now require an authorization token to be accessed. | ||
|
||
All the authentication, token generation and configuration process is handled | ||
through the REST endpoints that are made available by default on | ||
kytos installation: | ||
|
||
This endpoint creates new users: | ||
|
||
.. code-block:: shell | ||
POST http://127.0.0.1:8181/api/kytos/auth/users/ | ||
$ curl -X POST \ | ||
-H 'Content-Type: application/json' \ | ||
-d '{"username":"kytos", | ||
"password":"your_password", | ||
"email": "babel42@email.com"}' \ | ||
URL | ||
This endpoint verifies a user and returns a valid token if authentication | ||
is correct: | ||
|
||
.. code-block:: shell | ||
GET http://127.0.0.1:8181/api/kytos/auth/login/ | ||
$ curl -X GET \ | ||
-H 'Accept:application/json' \ | ||
-H 'Authorization:Basic username:password' \ | ||
URL | ||
This endpoint lists the registered users: | ||
|
||
.. code-block:: shell | ||
GET http://127.0.0.1:8181/api/kytos/auth/v1/users/ | ||
$ curl -X GET \ | ||
-H 'Accept:application/json' \ | ||
-H 'Authorization: Bearer ${TOKEN}' \ | ||
URL | ||
This endpoint gets details about a specific user: | ||
|
||
.. code-block:: shell | ||
GET http://127.0.0.1:8181/api/kytos/auth/users/<user_id>/ | ||
$ curl -X GET \ | ||
-H 'Content-type: application/json' \ | ||
-H 'Accept: application/json' \ | ||
-H 'Authorization: Bearer ${TOKEN}' \ | ||
-d '{"user_id": "001"}' \ | ||
URL | ||
This endpoint deletes a specific user. | ||
|
||
.. code-block:: shell | ||
DELETE http://127.0.0.1:8181/api/kytos/auth/v1/users/<user_id>/ | ||
$ curl -X DELETE \ | ||
-H 'Content-type: application/json' \ | ||
-H 'Accept: application/json' \ | ||
-H 'Authorization: Bearer ${TOKEN}' \ | ||
-d '{"user_id": "001"}' \ | ||
URL | ||
This endpoint update a specific user: | ||
|
||
.. code-block:: shell | ||
PATCH http://127.0.0.1:8181/api/kytos/auth/v1/users/<user_id>/ | ||
$ curl -X PATCH \ | ||
-H 'Content-Type: application/json' \ | ||
-H 'Authorization: Bearer ${TOKEN}' \ | ||
-d '{"user_id": "001"}' \ | ||
URL | ||
The process to protect an endpoint is found in session `How to protect a NApp | ||
REST endpoint <https://docs.kytos.io/developer/creating_a_napp/>`_ | ||
. |
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