Skip to main content

google cloud task queue

Project description

fastapi-authenticator

fastapi authenticator for google cloud tasks

Installation

server:

pip3 install fastapi-authenticator

client:

pip3 install gcp-taskqueue

Usage

server:

from fastapi import Depends, FastAPI
from fastapi_authenticator import GoogleCloudTask, google_cloud_task, google_cloud_auth

app = FastAPI()

@app.post("/task1")
def task_handler(
    claims: dict = Depends(google_cloud_auth),
    task: GoogleCloudTask: Depends(google_cloud_task)
):
    ...

client:

from gcp_taskqueue import TaskQueue

queue = TaskQueue(queue_id="your-queue-name")

queue.create_http_task("https://url", deadline=300)

Deployment

Service Account User Role is needed for the client to generate oidc token.

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

gcp-taskqueue-0.0.3.tar.gz (3.4 kB view hashes)

Uploaded Source

Built Distribution

gcp_taskqueue-0.0.3-py3-none-any.whl (5.2 kB view hashes)

Uploaded Python 3

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