https://github.com/genza999/api-security-and-best-practices
A set of projects demonstrating how to create secure and developer friendly Apis using python, SQLite and Flask
https://github.com/genza999/api-security-and-best-practices
Last synced: 9 months ago
JSON representation
A set of projects demonstrating how to create secure and developer friendly Apis using python, SQLite and Flask
- Host: GitHub
- URL: https://github.com/genza999/api-security-and-best-practices
- Owner: Genza999
- Created: 2018-10-25T20:25:28.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-02-02T06:14:44.000Z (over 3 years ago)
- Last Synced: 2025-03-16T09:41:29.393Z (over 1 year ago)
- Language: Python
- Homepage:
- Size: 21.5 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Api-security-and-Best-Practices
A set of projects from the Udacity Api coaurses demonstrating how to create secure and developer-friendly Apis using python, SQLite and Flask
### Technologies Used
* [Python](https://www.python.org)
* [Flask](http://flask.pocoo.org/)
* [sqlite](https://www.sqlite.org/)
* [itsdangerous](https://pythonhosted.org/itsdangerous/) - Cryptographically secure token generation and verification
* [Flask-HTTPAuth](https://github.com/miguelgrinberg/Flask-HTTPAuth) - Provide Basic and Digest HTTP authentication for Flask routes.
* [passlib](https://passlib.readthedocs.io/en/stable/) - password hashing library for Python 2 & 3
### First Use the command below to build a perfect replica of the virtual environment:
```
pip install -r requirements.txt
```
### The projects
* #### Puppies
This project shows the basic structure of Api endpoints in Flask.
Within the Puppies directory, Run the following command to start the local server.
```
python endpoints.py
```
Then in a new terminal, Run the following command to test the Api's.
```
python endpoints_tester.py
```
* #### MomandPopBagelShop project
This project shows how to use the flask httpauth to implement basic user authentication on Api routes.
Within the MomandPopBagelShop directory, Run the following command to start the local server.
```
python views.py
```
Then in a new terminal, Run the following command to test flask httpauth user authentication functionality imposed on the api routes.
```
python bagel_tester.py
```
* #### RegalTreeFoods
This project demonstrates using token-based authentication on login systems.
Within the RegalTreeFoods directory, Run the following command to start the local server.
```
python views.py
```
Then in a new terminal, Run the following command to test the token-based authentication functionality imposed on the api routes.
```
python fruit_tester.py
```
* #### BargainMart
This project demonstrates usage of rate limit on an Api endpoint such that after 60 requests per minute, the hungryclient.py is denied service and is made to wait before sending any more requests.
Within the BargainMart directory, Run the following command to start the local server.
```
python views.py
```
Then in a new terminal, Run the following command to test the Rate Limit imposed on the getcatalog route api.
```
python hungryclient.py
```
#### Enjoy