[gax] Set max_body_size on DecompressResponse for Tesla 1.21 compatibility - #1
Open
smn wants to merge 2 commits into
Open
[gax] Set max_body_size on DecompressResponse for Tesla 1.21 compatibility#1smn wants to merge 2 commits into
smn wants to merge 2 commits into
Conversation
Tesla 1.21 made :max_body_size mandatory on the compression middleware (a decompression-bomb CVE fix). Upstream elixir-google-api was archived before adopting it, so pin :infinity to preserve pre-1.21 behaviour and unblock the Tesla upgrade in turnhub/engage. Temporary until we migrate off this library. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
benonymus
previously approved these changes
Aug 20, 2026
Author
|
leaving this open as the mix.exs in engage references it, I hope this is the only fix we need while we work our way off of the Google libs. |
Tesla 1.21 validates multipart field names with assert_quoted_string_safe!/2, which only accepts binaries. build_body/3 passed the :metadata atom and keyword-list body/file param keys straight through, so every multipart upload (e.g. GCS storage_objects_insert_simple) crashed with FunctionClauseError. The wire format is unchanged: atoms were already interpolated into the Content-Disposition name before. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Tesla 1.21 made
:max_body_sizea required option onTesla.Middleware.Compression/DecompressResponse(a decompression-bomb CVE fix, no global-config or opt-out).GoogleApi.Gax.Connection's__using__macro hardcodesplug(Tesla.Middleware.DecompressResponse, []), so every generatedGoogleApi.*.ConnectionraisesArgumentErrorat request time under Tesla 1.21+.Upstream
googleapis/elixir-google-apiwas archived (2026-06-30) — reportedly because of this exact Tesla change — so no upstream fix will land. This is a minimal fork patch soturnhub/engagecan upgrade to Tesla 1.21.1.Changes
clients/gax:plug(Tesla.Middleware.DecompressResponse, max_body_size: :infinity)—:infinitypreserves the pre-1.21 behaviour (no cap), which is appropriate for these trusted Google endpoints that legitimately return large payloads.clients/gax/mix.exs: loosen:mimeto~> 1.0 or ~> 2.0so it resolves alongside modern deps (engage is on mime 2.0.7).Note
Temporary.
turnhub/engagewill migrate offelixir-google-apito Req + Goth; this fork can be retired once that lands.