fastapi-authenticator-0.1.1
توضیحات
fastapi authenticator for google cloud tasks
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | fastapi-authenticator-0.1.1 |
| نام | fastapi-authenticator |
| نسخه کتابخانه | 0.1.1 |
| نگهدارنده | ['Yingbo Gu'] |
| ایمیل نگهدارنده | ['tensiongyb@gmail.com'] |
| نویسنده | Yingbo Gu |
| ایمیل نویسنده | tensiongyb@gmail.com |
| آدرس صفحه اصلی | https://github.com/guyingbo/fastapi-authenticator |
| آدرس اینترنتی | https://pypi.org/project/fastapi-authenticator/ |
| مجوز | MIT |
# fastapi-authenticator
fastapi authenticator for google cloud tasks
## Installation
server:
~~~
pip3 install fastapi-authenticator
~~~
client:
~~~
pip3 install gcp-taskqueue
~~~
## Usage
server:
~~~python
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:
~~~python
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.
نیازمندی
| مقدار | نام |
|---|---|
| - | httpx |
| - | fastapi |
| - | python-jose |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.6 | Python |
نحوه نصب
نصب پکیج whl fastapi-authenticator-0.1.1:
pip install fastapi-authenticator-0.1.1.whl
نصب پکیج tar.gz fastapi-authenticator-0.1.1:
pip install fastapi-authenticator-0.1.1.tar.gz