dashbitco / broadway_cloud_pub_sub

A Broadway producer for Google Cloud Pub/Sub
Apache License 2.0
70 stars 24 forks source link

Fix handling Goth token #32

Closed wojtekmach closed 5 years ago

wojtekmach commented 5 years ago

Our generator contract is {:ok, String.t()} but Goth.Token.for_scope/1 is returning {:ok, %{token: String.t(), ...}} so I added a wrapper function.

mcrumm commented 5 years ago

@wojtekmach It looks like the spec for Goth.Token.for_scope/1 changed in Goth v1.1.0, so maybe we should bump the version requirement?

wojtekmach commented 5 years ago

I think since the part we're interested in, {:ok, t()}, didn't change, I think it's ok not to bump the version requirement for now. We currently don't enforce that the generator returns {:error, any()} anyway and I don't think we necessarily need to, instead keep it more as a suggestion. I think we can keep things as is until there's a solid alternative to goth.