launchflow / buildflow

BuildFlow, is an open source framework for building large scale systems using Python. All you need to do is describe where your input is coming from and where your output should be written, and BuildFlow handles the rest. No configuration outside of the code is required.
https://docs.launchflow.com/buildflow
Apache License 2.0
193 stars 7 forks source link

Add better support for processing headers and other components from an HTTP request #269

Open boetro opened 1 year ago

boetro commented 1 year ago

Is your feature request related to a problem? Please describe.

Need access to http headers inside of an endpoint or collector.

Right now the best / only way to do this is to have your endpoint processor take in a startlette Request then you get access to everything. This is needed to do things like auth checks and what not

Describe the solution you'd like

We use FastAPI as our container wrapper so ideally we could model it something like: https://fastapi.tiangolo.com/tutorial/header-params/

Describe alternatives you've considered

The best / only way to do this is to have your endpoint processor take in a startlette Request then you get access to everything.

Something like:

@app.endpoint(...)
def my_endpoint(request: startlette.Request):
  request.headers['content-type']

but with this approach you loose out on the automatic type checking for requests.