Skip to content

jcrowley3/magic_signon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Magic_ Signon is Yet Another Magical Single Sign-on

Reference Documents

Requirements

  • Python 3.11 or higher
  • Docker Desktop

Installation

  • Clone the repo
  • Run ./run.sh to build the docker containers and start the app
  • or, Run debug mode: run ./debug.sh or the Debug Docker debug configuration in VSCode

Running Locally

After the repo has been cloned, either of the following methods can be used to build the project locally. Both methods will start the app and database docker containers. On startup, db migrations are run and the db is seeded with mock data. The app will be started with the --reload flag, which will watch for changes to the code and restart the app when changes are detected.

1. Using run.sh

Script will build the docker containers and start the app. From the root of the project run:

./run.sh

2. Using debug.sh

Script will build the docker containers and start the app in debug mode. From the root of the project run:

./debug.sh

In VSCode, you can then attach to the running app by selecting the Attach_Debugger debug configuration.

3. Using Debug Docker launch configuration (VSCode Only)

In VSCode, select the Debug Docker launch configuration and start the debugger. This will build the docker containers and attaches debugger to the app container.

Note

Detaching the debugger will stop and remove the containers.

Running Tests

pytest

To run the unit and integration tests in the containers:

./run-pytests.sh

Postman

To run the Postman tests in the containers:

./run-postman.sh

Job Queue

To test various job queue scenarios:

python app/producer.py

The jobs will be added to the queue and processed by the app worker, logging the results of the jobs to the console.

Note

  • Some jobs require the tressure_vault_api and/or magic_signon_api containers to be running for the jobs to be processed.
  • In producer.py, use ctrl+c to stop the script or any long running tasks.

Migrations

On startup the app will check for any pending migrations and run them. If you need to create a new migration, run the following command:

./migrate.sh --make "<migration_name>"

Additional migrate.sh options:

  • --up - Run all pending migrations
  • --down - Rollback the last migration
  • --down <number> - Rollback the last <number> of migrations

Note

  • The app must be running for migrations to be run.
  • After using --make, inspect generated migration files to confirm accurate changes.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published