Skip to main content

A simple flask library for building microservices with RBAC JWT security, OpenAPI client and SQLAlchemy database support.

Project description

Build PyPI Codecov pre-commit

A simple flask library for building microservices with RBAC JWT security, OpenAPI client and SQLAlchemy database support.

Developer Quick Start Guide

Follow the instructions below to get a development environment up and running quickly!

Prerequisites

Getting Help with Make Tasks

Execute the following command to get a full list of make targets:

$ make help

Setup Python Development Environment

  1. Create a Python virtual environment:

    $ mkvirtualenv -p py310 flask-ligand
  2. Setup develop environment:

    $ make develop-venv
  3. Setup git pre-commit hooks:

    $ make setup-pre-commit
  4. Verify that environment is ready for development:

    $ make test-tox

Configuration Settings

The following environment variables are available to configure behavior of services that use this library when utilizing the built-in ‘local’ and ‘dev’ and ‘prod’ Flask environments. (See flask_environments.rst for more details about the available built-in Flask environments)

(Note: this project does support the use of ‘.env’ files for loading environment variables)

Environment Variable Settings

ENV

Default Value for ‘local’ Flask Environment

Description

SERVICE_PUBLIC_URL

http://localhost:5000

The public URL for this service. (Also used for generating OpenAPI clients)

SERVICE_PRIVATE_URL

http://localhost:5000

The private URL for this service. (Also used for generating OpenAPI clients)

ALLOWED_ROLES

user,admin

A comma separated list of user roles that are allowed for endpoint protection. (e.g. ‘user,admin’)

OIDC_ISSUER_URL

Not set (must be provided)

The OpenID Connect IAM URL to use for authentication.

OIDC_REALM

Not set (must be provided)

The OpenID Connect IAM realm to use for authentication.

SQLALCHEMY_DATABASE_URI

sqlite:///:memory:

The URI for a PostgreSQL database to use for persistent storage. (See database_configuration.rst for more information)

OPENAPI_GEN_SERVER_URL

http://api.openapi-generator.tech

The OpenAPI online generator server URL to use for creating clients.

Integration Testing

See integration_testing.rst for more details on how to setup and run the integration tests for the flask-ligand project.

Contributing

See CONTRIBUTING.rst for more details on developing for the flask-ligand project.

Release Process

See release_process.rst for information on the release process for the flask-ligand project.

Python Black IDE Integration

This repo utilizes Python Black for automatic code formatting using the make format task. However, this is not very convenient to use on a regular basis and instead it is recommended to integrate Python Black into your IDE workflow. Checkout these editor integration guides for integrating Python Black with popular IDEs and text editors.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flask-ligand-0.2.0.tar.gz (60.7 kB view details)

Uploaded Source

Built Distribution

flask_ligand-0.2.0-py2.py3-none-any.whl (17.8 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file flask-ligand-0.2.0.tar.gz.

File metadata

  • Download URL: flask-ligand-0.2.0.tar.gz
  • Upload date:
  • Size: 60.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/37.0 requests/2.28.1 requests-toolbelt/0.9.1 urllib3/1.26.12 tqdm/4.64.0 importlib-metadata/4.12.0 keyring/23.8.2 rfc3986/2.0.0 colorama/0.4.5 CPython/3.9.13

File hashes

Hashes for flask-ligand-0.2.0.tar.gz
Algorithm Hash digest
SHA256 35d030bf93b52d344633b15af9cbd231712af2aa3873d9f44417fe7ba1369b6f
MD5 ff475933def092032d8c1d7a7e680e36
BLAKE2b-256 f9e6ff43343ffeda96fdd7e0b7a29bcacb51687438878f5abc3dc120a3289570

See more details on using hashes here.

File details

Details for the file flask_ligand-0.2.0-py2.py3-none-any.whl.

File metadata

  • Download URL: flask_ligand-0.2.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 17.8 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/37.0 requests/2.28.1 requests-toolbelt/0.9.1 urllib3/1.26.12 tqdm/4.64.0 importlib-metadata/4.12.0 keyring/23.8.2 rfc3986/2.0.0 colorama/0.4.5 CPython/3.9.13

File hashes

Hashes for flask_ligand-0.2.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 c17b50e66db0f7203bef5a960ffe67849bbac36f1fbe49d2c998aed236314bf4
MD5 2aed82e7ee96ec2bed290f6e6aa7b07e
BLAKE2b-256 9ece90f4dfc85296862807c5b65bb8348d562c2d09abb8edc66f9fb258a285de

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page