Hey guys, is there a way to dynamically inject `SE...
# ask-metaflow
t
Hey guys, is there a way to dynamically inject
SERVICE_HEADERS
values before running a flow? We have our metadata service behind an oauth proxy, and would like to make it easy for our users to submit flows without needing to do
METAFLOW_SERVICE_HEADERS=... python flow.py run
1
For example if we have
Copy code
if __name__ == "__main__":
    inject_jwt_header()
    FlowName()
is that doable? setting
os.environ["METAFLOW_SERVICE_HEADERS"]
didn't work
a
you can store
METAFLOW_SERVICE_HEADERS
in
~/.metaflowconfig/config.json
t
Yea but we generate the jwt via gcloud auth print-identity-token so should we write the value to the config at the start of the flow?
b
We use justfile for this. https://github.com/casey/just
t
David, that looks really neat. Do you end up with a stepwise process of 1. generate jwt 2. write header to config.json 3. invoke the flow?
python flow.py run
?
b
We use environmental variables that generate things at run time such as a kubernetes image name based on the branch you are on and then run the flow. Usually it's like a mini-bash script
among us party 1