I have my graphql URL behind traefik and am using ...
# prefect-community
t
I have my graphql URL behind traefik and am using auth with it. I'd like to be able to register a flow by just passing the auth headers to the register() method the same way that I can pass it to the graphql queries. Should I make a PR for this or is there another option to register the flow? Is the serialize + graphql option I've seen the correct solution here?
j
Hi @Thomas La Piana I think this would be a suitable enhancement! 🙂 Currently you could accomplish by using some of the code the register client command currently uses and adjusting the
client.graphql
call to attach your headers https://github.com/PrefectHQ/prefect/blob/master/src/prefect/client/client.py#L570
t
@josh it looks like the best way is to just pass the an optional headers dict to each of the graphql calls in the register method right? just want to make sure I'm not missing some extra bit of complexity because it seems like an easy fix to me to knock out otherwise
j
@Thomas La Piana Yep that would be it!
t
awesome, i'll get on that
j
@Thomas La Piana apologies, I actually might have steered you the wrong way. Instead of adding this kwarg to client functions for this specific use case you can already accomplish it with something like this:
Copy code
c = Client()
c.attach_headers({my: auth})

c.register(my_flow, ...)
t
ohhhh interesting, that is actually exactly what I'm looking for! i looked at the source and somehow missed that I could do that too. Thanks!