Skip to content

@uppy/companion: harden remote provider credential fetches - #6733

Open
mifi wants to merge 2 commits into
transloadit:mainfrom
mifi:claude/companion-harden-credentials-fetch
Open

mifi wants to merge 2 commits into
transloadit:mainfrom
mifi:claude/companion-harden-credentials-fetch

Conversation

@mifi

@mifi mifi commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

fetchKeys (remote OAuth credentials via credentialsURL) had no timeout and followed redirects. A slow endpoint could hold the OAuth request open indefinitely, and a redirecting one would have the credential request parameters re-POSTed to another host.

Changes

  • Time out the credentials request after 10 seconds.
  • Don't follow redirects from the configured credentialsURL; it's operator configuration, so a redirect is treated as a failure. This matches how the native Transloadit Storage provider calls Transloadit's API.
  • Regression test: a redirecting credentials endpoint is not followed (fails without the fix).
  • Patch changeset for @uppy/companion.

Not changed

No stricter response validation: fields are already type-checked where they're used (origins, transloadit_gateway), and a strict schema risks rejecting real-world responses (e.g. the empty-string gateway case).

🤖 Generated with Claude Code

https://claude.ai/code/session_01HFpWnyhntvDRifoVg51hVB

fetchKeys had no timeout and followed redirects, so a slow or redirecting
credentialsURL could hold an OAuth request open or send the credential
request parameters to another host. Time out after 10s and don't follow
redirects, matching the native Storage API calls.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HFpWnyhntvDRifoVg51hVB
Co-authored-by: Mikael Finstad <finstaden@gmail.com>
@changeset-bot

changeset-bot Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 13fefde

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@uppy/companion Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

With followRedirect off, got treats a 3xx as success, so a redirect surfaced as a confusing 'Received no remote credentials' or JSON parse error. Throw an error naming the redirect target instead, assert it in the test, and tell operators in the changeset to configure the final URL.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HFpWnyhntvDRifoVg51hVB
Co-authored-by: Mikael Finstad <finstaden@gmail.com>
@mifi
mifi requested a review from qxprakash October 16, 2026 06:16

This branch has not been deployed

No deployments
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

Successfully merging this pull request may close these issues.

2 participants