is it possible to grab parameters in dagit from th...
# ask-community
f
is it possible to grab parameters in dagit from the cookies? Just thinking how I could handle a request coming through dagit and pass cookie information forward to the job execution
j
hey @Fabio Picchi can the information only be found in the cookies? usually information is passed to a job using configuration https://docs.dagster.io/concepts/configuration/config-schema
f
yep, unfortunately it is only in the cookies. We put a login system in front of our dagster setup and the information I'm looking for is the user's token to talk with our internal API
the user can always copy paste it, but it would be nice to be able to read it from cookies. I was looking into these Launchers. I saw an example in the docs, but didn't figure out how the information can be set to a job configuration or how it can be passed forward 🤔
j
another option could be to write a resource that can get the login info from the cookies and pass it along when the internal api is called https://docs.dagster.io/concepts/resources
f
ok! Nice 🙂 Thanks for the tip. I'll investigate further on how to get the cookies to a custom Resource
@jamie could you point me in the right direction for doing this? I am a bit lost as to how that information would reachable by a resource. I actually don't know the details of how Dagit communicates with the backend and triggers runs. I understand it happens through an API call and I assume some gRPC communication happens in the background, but then the cookies are lost at this point
j
ah ok, I misunderstood the crux of the original question. I’m not 100% sure how that would work so let me chat with some other engineers and see if anyone has ideas.
d
I don't think we have an easy or straightforward way to do this, but a complex way to do it would be to write a custom run coordinator that pulls information from the cookies and adds it as a tag on the run, like the example here: https://docs.dagster.io/guides/dagster/run-attribution#custom-run-coordinator