Skip to content

Latest commit

 

History

History
100 lines (69 loc) · 2.61 KB

README.md

File metadata and controls

100 lines (69 loc) · 2.61 KB

License

AUTH API

BC Registries authentication and authorization services.

Development Environment

Follow the instructions of the Development Readme to setup your local development environment.

Technology Stack Used

  • Python, Flask
  • Postgres - SQLAlchemy, psycopg2-binary & alembic

setup

Fork the repo and submitted a PR with accompanning tests.

Set to use the local repo for the virtual environment

poetry config virtualenvs.in-project true

Install the dependencies

poetry install

Configure the .env

manage the DB

poetry shell
flask db upgrade
flask db migrate

Running the Auth Database on localhost

To prepare your local database:

  1. In the root project folder: docker-compose up -d
  2. In your environment: poetry run flask db upgrade or flask db upgrade

Note:

[Windows Users] If using WSL, may need to change the host from localhost -> .local EX. in config.py and .env.

[Mac Users] : You might get an error regarding the SSL certificate verification failed. follow the steps to resolve that issue:

  1. Open the terminal window, and run python3 -v command to check the version of python.
  2. run the following command:
pip install certifi /Applications/Python\ <version of your python>/Install\ Certificates.command

eg: if your python version is 3.7, then, run

pip install certifi /Applications/Python\ 3.7/Install\ Certificates.command

Running AUTH-API

  1. Start the flask server with (poetry run flask run)
  2. View the OpenAPI Docs.

Running Liniting

  1. Run make flake8 or flake8 src/auth_api tests.
  2. Run make pylint or pylint --rcfile=setup.cfg --disable=C0301,W0511 src/auth_api test

Running Unit Tests

  1. Tests are run from the Status bar at the bottom of the workbench in VS Code or pytest command.
  2. Next run make coverage to generate the coverage report, which appears in the htmlcov directory.

Running Integration (postman) Tests

  1. Start your local application(s).
  2. Open postman applicaiton.
  3. Import the Integration tests environment configrations and fill the values to match your applicaiton.
  4. Import the integration tests collection.
  5. Run the collection.

Openshift Environment

View the document.

Github Actions