GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - Bondifuzz/api-gateway

BranchesTags
Open more actions menu

Latest commit

 

History

14 Commits
14 Commits

Folders and files

NameName
Last commit message
Last commit date
.vscode
.vscode
 
 
api_gateway
api_gateway
 
 
book
book
 
 
local
local
 
 
locales
locales
 
 
scripts
scripts
 
 
static
static
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
Dockerfile
Dockerfile
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
cspell.json
cspell.json
 
 
index.html
index.html
 
 
logging.yaml
logging.yaml
 
 
pytest.ini
pytest.ini
 
 
requirements-base.txt
requirements-base.txt
 
 
requirements-dev.txt
requirements-dev.txt
 
 
requirements-prod.txt
requirements-prod.txt
 
 
requirements-test.txt
requirements-test.txt
 
 

Repository files navigation

API Gateway

Deployment

Download repository

git clone https://github.com/Bondifuzz/api-gateway.git
cd api-gateway

Build docker image

docker build -t api-gateway .

Run container (locally)

docker run --net=host --rm -it --name=api-gateway --env-file=.env api-gateway bash

Local development

Install and run

Using python 3.7+

git clone https://github.com/Bondifuzz/api-gateway.git && cd api-gateway
pip3 install -r requirements-dev.txt

ln -s local/dotenv .env
ln -s local/docker-compose.yml docker-compose.yml
docker-compose -p api_gateway up -d

python3 -m uvicorn \
    --factory api_gateway.app.main:create_app \
    --host 127.0.0.1 \
    --port 8080 \
    --workers 1 \
    --log-config logging.yaml \
    --lifespan on

Generate API specification

python3 -m uvicorn --factory api_gateway.app.main:generate_api_spec

Code documentation

TODO

Running tests

Install dependencies:

pip3 install -r requirements-test.txt

Running unit tests:

pytest -vv api-gateway/tests/unit

Disable security to run tests

sed -i "s/COOKIE_MODE_SECURE=.*/COOKIE_MODE_SECURE=0/g" .env
sed -i "s/CSRF_PROTECTION_ENABLED=.*/CSRF_PROTECTION_ENABLED=0/g" .env
pytest -vv api_gateway/tests/integration --ignore=api_gateway/tests/integration/test_csrf_protection.py

If you want to run CSRF protection tests, enable security

sed -i "s/CSRF_PROTECTION_ENABLED=.*/CSRF_PROTECTION_ENABLED=1/g" .env
pytest -vv api_gateway/tests/integration/test_csrf_protection.py

Spell checking

Download cspell and run to check spell in all sources

sudo apt install nodejs npm
sudo npm install -g cspell
cspell "**/*.{py,md,txt}"

VSCode extensions

  • ms-python.python
  • ms-python.vscode-pylance
  • streetsidesoftware.code-spell-checker

About

No description, website, or topics provided.

Resources

Readme
Apache-2.0 license
Activity
Custom properties

Stars

0 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.