Skip to main content

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

Metadata

Release files for asfquart 0.1.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for asfquart 0.1.10
File Size Uploaded Provenance Actions
asfquart-0.1.10.tar.gz 22.2 kB Without provenance Details for asfquart-0.1.10.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for asfquart 0.1.10
File Interpreter ABI Platform Actions
asfquart-0.1.10-py3-none-any.whl Python 3 none any Details for asfquart-0.1.10-py3-none-any.whl

Total release size: 46.1 kB

Release files / asfquart-0.1.10.tar.gz

Download URL asfquart-0.1.10.tar.gz
Size 22.2 kB
Tags Source
SHA-256 checksum
How to use checksums
052d549ca1ddeec5d27275589c73f2193cf3d89449962f252df2776a45d67aec
BLAKE2b-256 checksum
How to use checksums
3f074a3e8249a5ddbadcb9c71094852440dec2e8e116b5a212b5051e5134a6d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.12.7 Linux/6.11.0-21-generic

Release files / asfquart-0.1.10-py3-none-any.whl

Download URL asfquart-0.1.10-py3-none-any.whl
Size 24.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ac49dc435b761009e006a08eb5266dd53f30f8f778b436b825997f6d5bcd0741
BLAKE2b-256 checksum
How to use checksums
451555fef5a1046c976b234088cf94c1b372b986b08a5d415d69cbaba1e2af42
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.12.7 Linux/6.11.0-21-generic

Security for asfquart 0.1.10

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page