goth
goth copied to clipboard
Cannot use Base64 Encoded Env Var for generating Signed URLs
Hi,
we base64 encode our GOOGLE_APPLICATION_CREDENTIALS_JSON
before passing it to Goth.
Our named Goth process is configured correctly, but when attempting to use url/4
:
url({file_name, upload}, :original, signed: true)
the process crashes because decode_json
reads the env var directly and attempts to Jason.decode!
it, which fails because the env var is b46 encoded.
Patching the lib with:
defp decode_json(json) do
json
# adding this line lets it work
|> Base.decode64!()
|> Jason.decode!()
|> set_token_source
end
allows it to work. Is there any way we can configure Goth.Config
to either read the configured dependency config at runtime or otherwise tell it that the env var is encoded?