Skip to content

Commit

Permalink
add minio auth plugin --skip-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
OriHoch committed Feb 3, 2024
1 parent f91cee1 commit c9e343e
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions cwm_worker_operator/minio_auth_plugin/app.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
from fastapi import FastAPI, Request
from fastapi import FastAPI, Request, APIRouter

app = FastAPI()
router = APIRouter()


@app.post("/")
async def root(request: Request):
body = await request.json()
print(body)
return {"result": True}
@router.api_route("/{full_path:path}", methods=["GET", "POST", "PUT", "DELETE", "OPTIONS", "HEAD", "PATCH", "TRACE"])
async def catch_all(request: Request, full_path: str):
try:
body = await request.body()
except:
body = None
print(f'method: {request.method}, path: /{full_path}, body: {body}')
return {}


app.include_router(router)

0 comments on commit c9e343e

Please sign in to comment.