Skip to content

chore(typescript): update ts-sdk seed#14705

Merged
fern-support merged 1 commit into
mainfrom
update-ts-sdk-seed
Apr 7, 2026
Merged

chore(typescript): update ts-sdk seed#14705
fern-support merged 1 commit into
mainfrom
update-ts-sdk-seed

Conversation

@fern-support
Copy link
Copy Markdown
Collaborator

Auto-generated PR, triggered by GitHub event: push from branch: main.
GitHub workflow run: https://github.com/fern-api/fern/actions/runs/24081027448

@fern-support fern-support added language/typescript seed Updates to seed tests labels Apr 7, 2026
Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

@fern-support fern-support enabled auto-merge (squash) April 7, 2026 12:38
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 7, 2026

🌱 Seed Test Selector

Select languages to run seed tests for:

  • Python
  • TypeScript
  • Java
  • Go
  • Ruby
  • C#
  • PHP
  • Swift
  • Rust
  • OpenAPI

How to use: Click the ⋯ menu above → "Edit" → check the boxes you want → click "Update comment". Tests will run automatically and snapshots will be committed to this PR.

const fetchFn = clientOptions.fetch ?? (await getFetchFn());

if (logger.isDebug()) {
logger.debug("Making passthrough HTTP request", {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Passthrough request logs raw URL without redaction, exposing sensitive query-parameter credentials

In makePassthroughRequest.ts (lines 155–161 and 180–187) the full fullUrl is written to the debug log without calling redactUrl(). By contrast, fetcherImpl in Fetcher.ts always calls redactUrl(url) before logging (line 266) and its behavior is verified by the extensive redacting.test.ts suite.

If a caller passes a URL that embeds credentials in the query string — e.g. client.fetch("https://api.example.com/data?api_key=s3cr3t&token=abc") — and debug logging is active ({ level: "debug", silent: false }), the key and token appear in plaintext in the log output. The same omission applies to URL userinfo credentials (user:pass@host). The mergedHeaders (which contain auth tokens) are not logged, but the URL is — and URL-embedded secrets are a common bearer-token pattern that the regular fetcher specifically protects against.

Prompt To Fix With AI
Import `redactUrl` from `Fetcher.ts` (or move it to a shared utility) and apply it to `fullUrl` before logging in both debug blocks inside `makePassthroughRequest`:

```ts
// line ~156
logger.debug("Making passthrough HTTP request", {
    method,
    url: redactUrl(fullUrl),   // was: fullUrl
    hasBody: body != null,
});

// line ~181
logger.debug("Passthrough HTTP request completed", {
    method,
    url: redactUrl(fullUrl),   // was: fullUrl
    statusCode: response.status,
});
```

Add a corresponding test in `makePassthroughRequest.test.ts` that enables debug logging and asserts `api_key`, `token`, and `user:pass@host` patterns are replaced with `[REDACTED]`, mirroring the existing tests in `redacting.test.ts`.

Severity: low | Confidence: 95%

@fern-support fern-support merged commit d415016 into main Apr 7, 2026
60 checks passed
@fern-support fern-support deleted the update-ts-sdk-seed branch April 7, 2026 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

language/typescript seed Updates to seed tests

Development

Successfully merging this pull request may close these issues.

3 participants