APIGuard is an API protection system developed to ensure secure access to your web services. Using token-based authentication, APIGuard allows developers to protect sensitive API endpoints in a simple and efficient way.
pip install -r requirements.txt
python3 manage.py cretate_database
python3 manage.py create_superuser
python3 main.py
>>> import requests
>>>
>>> TOKEN = 'f20e94eb-d573-444a-86fb-1dd1e359008b'
>>>
>>> url = 'http://127.0.0.1:5000/api/data'
>>> headers = {'Authorization': TOKEN}
>>> response = requests.get(url, headers=headers)
>>>
>>> print(response.json())
{'data': 'here is the protected data'}
>>>
>>> import requests
>>>
>>> TOKEN = 'f20e94eb-d573-44fsdfdsf6f56sdfdsfb'
>>>
>>> url = 'http://127.0.0.1:5000/api/data'
>>> headers = {'Authorization': TOKEN}
>>> response = requests.get(url, headers=headers)
>>>
>>> print(response.json())
{'message': 'Invalid token'}
>>>
gcloud init
gcloud run deploy --source .