Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use Base64 Encoded Env Var for generating Signed URLs #172

Open
JohnnyCurran opened this issue Jun 26, 2024 · 0 comments
Open

Cannot use Base64 Encoded Env Var for generating Signed URLs #172

JohnnyCurran opened this issue Jun 26, 2024 · 0 comments

Comments

@JohnnyCurran
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant