Skip to main content

ASF Quart Framework

Project description

asfquart - a Quart framework for the ASF

PyPI PyPI - Python Versions Unit Tests Apache License

This is a Quart framework for ASF web applications.

On top of Quart, this package layers a lot of functionality, much of which is specific to the ASF and its infrastructure and preferred approaches for website application development.

asfquart adds the following items to basic quart:

  • simple construction of the APP
  • default config.yaml
  • watching the .py and config for changes, to cause a restart/reload
  • watch SIGINT to halt and SIGUSR2 to restart/reload
  • template watching and rendering for EZT templates
  • URL path routing for pages and API endpoints
  • Oauth with our ASF provider for authn
  • LDAP group testing for authz
  • long-running tasks and their lifecycle management

Current (known, public) users of asfquart:

Future users of asfquart:

  • Apache STeVe
  • Identity management (replaces the old id.a.o)
  • Gitbox UI
  • ??

Primer

See the documentation page for more information.

import asfquart
from asfquart.auth import Requirements as R

def my_app():
    # Construct the quart service. By default, the oauth gateway is enabled at /oauth.
    app = asfquart.construct("my_app_service")

    @app.route("/")
    async def homepage():
        return "Hello!"

    @app.route("/secret")
    @asfquart.auth.require(R.committer)
    async def secret_page():
      return "Secret stuff!"
    
    asfquart.APP.run(port=8000)


if __name__ == "__main__":
    my_app()

Installation

Create and activate a virtual environment and then install asfquart using pip:

$ pip install "asfquart"

Note: Adding the [aioldap] extra will install optional dependencies for LDAP support that will require additional system dependencies:

$ pip install "asfquart[aioldap]"

Building asfquart package

Prerequisites:

  • poetry: install e.g. with pipx pipx install poetry

Building the package:

$ poetry build

Running the tests:

$ poetry run pytest

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

asfquart-0.1.10.tar.gz (22.2 kB view details)

Uploaded Source

Built Distribution

asfquart-0.1.10-py3-none-any.whl (24.0 kB view details)

Uploaded Python 3

File details

Details for the file asfquart-0.1.10.tar.gz.

File metadata

  • Download URL: asfquart-0.1.10.tar.gz
  • Upload date:
  • Size: 22.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.7 Linux/6.11.0-21-generic

File hashes

Hashes for asfquart-0.1.10.tar.gz
Algorithm Hash digest
SHA256 052d549ca1ddeec5d27275589c73f2193cf3d89449962f252df2776a45d67aec
MD5 2c201eb357e713506bee739844c4d44c
BLAKE2b-256 3f074a3e8249a5ddbadcb9c71094852440dec2e8e116b5a212b5051e5134a6d7

See more details on using hashes here.

File details

Details for the file asfquart-0.1.10-py3-none-any.whl.

File metadata

  • Download URL: asfquart-0.1.10-py3-none-any.whl
  • Upload date:
  • Size: 24.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.7 Linux/6.11.0-21-generic

File hashes

Hashes for asfquart-0.1.10-py3-none-any.whl
Algorithm Hash digest
SHA256 ac49dc435b761009e006a08eb5266dd53f30f8f778b436b825997f6d5bcd0741
MD5 f26273bafcc018787f71869797263527
BLAKE2b-256 451555fef5a1046c976b234088cf94c1b372b986b08a5d415d69cbaba1e2af42

See more details on using hashes here.

Supported by

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