Skip to content

Instantly share code, notes, and snippets.

View AutumnSun1996's full-sized avatar

AutumnSun AutumnSun1996

  • China
View GitHub Profile
@AutumnSun1996
AutumnSun1996 / server.py
Created May 4, 2023 14:07
prefect server with apikey and basic auth
"""A simple wrapper for prefect server, with apikey and basic auth check.
usage:
```bash
# Allow prefect cli to access the server with same PREFECT_API_KEY.
PREFECT_API_KEY=XX
# base64 encoded `username:password`. Allow users to access the server with user:password.
PREFECT_BASIC_AUTH=XX
# start server
uvicorn --host $PREFECT_SERVER_API_HOST --port $PREFECT_SERVER_API_PORT --factory server:create_auth_app