Skip to content

test+docs: follow-ups to #108 — FME transport coverage, redaction toggle test, env-var docs#113

Open
thisrohangupta wants to merge 2 commits intophase1-p1-p7-p8from
cursor/pr-108-followups-426e
Open

test+docs: follow-ups to #108 — FME transport coverage, redaction toggle test, env-var docs#113
thisrohangupta wants to merge 2 commits intophase1-p1-p7-p8from
cursor/pr-108-followups-426e

Conversation

@thisrohangupta
Copy link
Copy Markdown
Collaborator

Stacked on #108. Closes the must-fix gaps from review.

What's here

1. FME transport test coverage (tests/client/harness-client.test.ts)

PR #108 added product === "fme" branches in harness-client.ts that suppress both the Harness-Account header and the accountIdentifier query param (so Harness-specific scope metadata never leaks to the Split.io API). Those branches had no assertions, meaning a regression to either would silently start leaking account scope.

Three new tests:

  • omits accountIdentifier query param for product='fme' — also asserts no accountID (log-service variant) is set.
  • omits Harness-Account header for product='fme' (Split.io API)
  • still injects accountIdentifier for non-fme product (default Harness) — positive control so we don't accidentally regress the default path.

2. HARNESS_LOG_UNSAFE_BODIES integration test

PR #108's tests/utils/redact.test.ts exercises the redaction utility in isolation. The new debug log redaction (HARNESS_LOG_UNSAFE_BODIES toggle) describe block closes the loop on the wiring inside HarnessClient:

  • Default (false) redacts request body sensitive fields, preserves non-sensitive ones.
  • Default (false) redacts response body sensitive fields.
  • HARNESS_LOG_UNSAFE_BODIES=true logs raw body — verifies the escape hatch actually bypasses redaction.

Spies on console.error (logger output goes to stderr via console.error) and filters for the Request body / Response body log entries.

3. Documentation (.env.example, README.md)

Both env vars introduced in #108 were missing from docs:

  • HARNESS_FME_BASE_URL — added to .env.example and the env-var table; HTTPS Enforcement section now mentions both URLs; new troubleshooting row for the FME HTTPS startup error.
  • HARNESS_LOG_UNSAFE_BODIES — added to .env.example and the env-var table with a "local debugging only — never in shared environments" warning to discourage misuse.

Test plan

Merge order

Merge #108 first, then this. Branch is based on phase1-p1-p7-p8 so it'll auto-target main once #108 lands.

Open in Web Open in Cursor 

cursoragent and others added 2 commits May 3, 2026 16:28
Closes follow-up gaps identified in #108 review:

- FME transport: assert that product='fme' requests omit the
  Harness-Account header and the accountIdentifier query param so
  Harness-specific scope metadata never leaks to the Split.io API.
  Adds a positive control that non-fme requests still inject
  accountIdentifier as before.

- HARNESS_LOG_UNSAFE_BODIES toggle: integration test that the
  flag actually flows from config through HarnessClient to the
  debug log call sites — by default sensitive fields are redacted
  in both request and response bodies; when set to true the raw
  body is logged.

These complement the unit tests in tests/utils/redact.test.ts which
exercise the redaction utility in isolation; the new tests close the
loop on its wiring inside HarnessClient.

Co-authored-by: Rohan Gupta <thisrohangupta@users.noreply.github.com>
Both env vars were introduced in #108 but missed the docs update:

- HARNESS_FME_BASE_URL: override for self-managed/staging FME
  (Split.io) backends; defaults to https://api.split.io and is
  subject to the same HTTPS guard as HARNESS_BASE_URL.

- HARNESS_LOG_UNSAFE_BODIES: debug-only escape hatch to disable
  sensitive-field redaction in request/response body logs. Defaults
  to false. Documented as 'local debugging only — never in shared
  environments' to discourage misuse.

Updates .env.example, the env-var table in README.md, the HTTPS
Enforcement section (now mentions FME), and adds a troubleshooting
row for the FME HTTPS startup error.

Co-authored-by: Rohan Gupta <thisrohangupta@users.noreply.github.com>
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@thisrohangupta thisrohangupta marked this pull request as ready for review May 3, 2026 16:30
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.

3 participants