Skip to content

feat(http): gate v2 auth on authenticationEnabled - #5769

Merged
shekhar-rudder merged 9 commits into
developfrom
harness/INT-7519-feat-http-use-linked-delivery-a-6d64fa9e
Nov 10, 2026
Merged

shekhar-rudder merged 9 commits into
developfrom
harness/INT-7519-feat-http-use-linked-delivery-a-6d64fa9e

Conversation

@rudder-devbox

@rudder-devbox rudder-devbox Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

What are the changes introduced in this PR?

HTTP v2 replaces the inline auth selector with authenticationEnabled (rudder-integrations-config#2891). Config-backend inlines a linked non-OAuth account's fields (username/password, bearerToken, apiKeyName/apiKeyValue) into the destination config, so the transformer keeps reading credentials from Config. Only the selector changes: auth headers are built when authenticationEnabled is true, and the header type is picked from the account type's required field.

What is the related Linear task?

Resolves INT-7519

Please explain the objectives of your changes below

Without this, makeAuthHeaders switches on Config.auth, which v2 configs no longer carry, so every v2 destination with authentication enabled would send no auth header.

Any changes to existing capabilities/behaviour, mention the reason & what are the changes ?

HTTP v2 only: auth is replaced by authenticationEnabled. Validation requires apiKeyValue with apiKeyName, and at least one credential when authentication is enabled. HTTP v1 is unchanged.

Any new dependencies introduced with this change?

N/A

Any new generic utility introduced or modified. Please explain the changes.

N/A

Any technical or performance related pointers to consider with the change?

The secret-path manifest is unchanged (HTTP already masks all headers).

Validation

  • npx tsc --noEmit -p tsconfig.test.json, eslint on changed files: pass.
  • HTTP unit tests: 28 passed. npm run test:ts -- component --destination=http: 18 passed.
  • npm run check:secret-paths against integrations-config main: manifest matches.

Developer checklist

  • My code follows the style guidelines of this project
  • No breaking changes are being introduced. HTTP v2 (gated off) changes its auth configuration.
  • All related docs linked with the PR?
  • All changes manually tested?
  • Any documentation changes needed with this change?
  • Is the PR limited to 10 file changes?
  • Is the PR limited to one linear task?
  • Are relevant unit and component test-cases added in new readability format?

Reviewer checklist

  • Is the type of change in the PR title appropriate as per the changes?
  • Verified that there are no credentials or confidential data exposed with the changes.

🔭 Live preview

Resumable while this task is open.

@coderabbitai

coderabbitai Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 87c00d3a-40bc-48d3-82a2-762597a50d0f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@rudder-devbox

rudder-devbox Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

👋 I'm rudder-devbox. I opened this PR from task INT-7519.

Mention @devbox or @rudder-devbox and I'll act on it — on a top-level PR comment,
in a review summary, or on an inline comment on the diff. Without a mention I won't see it.

@rudder-devbox

rudder-devbox Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

Sandbox became unreachable (its file API was unavailable too long).

2 similar comments
@rudder-devbox

rudder-devbox Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

Sandbox became unreachable (its file API was unavailable too long).

@rudder-devbox

rudder-devbox Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

Sandbox became unreachable (its file API was unavailable too long).

shekhar-rudder and others added 4 commits November 10, 2026 13:12
- Revert the HTTP-specific secret-path generator branch: the manifest
  already masks all of HTTP `headers`, and the check derives the same
  manifest without it.
- Resolve auth headers inline instead of caching them per instance.
- Drop router cases that duplicate the unit tests for each account type;
  the v2 bearer case now reuses the existing masked secret.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@rudder-devbox

rudder-devbox Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor Author

CI failed during npm run build:ci with TS18047 at src/v0/destinations/http/utils.ts:71: account.secret may be null. I fixed the Basic Auth password check by reading the optional value once before validating it, preserving empty-password behavior.

Validation: npm run build:ci, 33 HTTP router tests, ESLint, and Prettier passed. The full local build reached its copy step, then stopped because cpio is unavailable here. Live mini verification was skipped because transformer runs from a SHA-pinned stock image that cannot exercise this source change.

2b030a5

@rudder-devbox

rudder-devbox Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor Author

Knowledge distillation completed

@rudder-devbox

rudder-devbox Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor Author

The Code Coverage run used commit cb95e6d and failed first at src/v0/destinations/http/utils.ts:71 with TS18047: account.secret may be null. Because npm run build:ci stopped there, tests did not run; the missing LCOV files and Sonar report error were downstream effects.

I already pushed the source fix in the newer commit below. On that commit, npm run build:ci and all 33 focused HTTP router tests pass. No additional change was needed for this older run.

2b030a5

@rudder-devbox

rudder-devbox Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor Author

Both Docker image builds used the older commit cb95e6d and stopped at the same TypeScript error: src/v0/destinations/http/utils.ts:71 reported TS18047 because account.secret may be null. I already pushed the fix that reads the optional Basic Auth password once before validation.

On the newer commit, the exact Docker compile step, npm run build:ci -- --sourceMap false, passes. No additional source change was needed for these older image-build failures.

2b030a5

@codecov

codecov Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.85714% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 92.45%. Comparing base (f4d5d8d) to head (f5f126d).

Files with missing lines Patch % Lines
src/v0/destinations/http/utils.ts 88.88% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #5769      +/-   ##
===========================================
- Coverage    92.45%   92.45%   -0.01%     
===========================================
  Files          741      741              
  Lines        41174    41172       -2     
  Branches      9610     9610              
===========================================
- Hits         38068    38065       -3     
- Misses        2923     2924       +1     
  Partials       183      183              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@rudder-devbox

rudder-devbox Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor Author

This run checked older commit 674a62b and failed during npm run build with TS18047 at src/v0/destinations/http/utils.ts:71: account.secret may be null. I already pushed the fix, which reads the optional Basic Auth password once before validating it. npm run build:ci passes on the current branch head; no further edit was needed for this run.

2b030a5

@rudder-devbox

rudder-devbox Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor Author

Both amd64 image builds used older commit 674a62b and failed in npm run build:ci -- --sourceMap false with TS18047 at src/v0/destinations/http/utils.ts:71: account.secret may be null. I already pushed the source fix. The exact compile command passed on the current branch head, so no additional change was needed for these runs.

2b030a5

@rudder-devbox

rudder-devbox Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor Author

This coverage run checked older commit 674a62b and first failed at src/v0/destinations/http/utils.ts:71 with TS18047: account.secret may be null. The build stopped before tests, so the missing LCOV files and Sonar report error are downstream effects.

I already pushed the source fix. npm run build:ci passes on the current branch head; no additional edit was needed for this run.

2b030a5

@rudder-devbox

rudder-devbox Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor Author

The run checked older commit 860b316 and failed during npm run build with TS18047 at src/v0/destinations/http/utils.ts:71: account.secret may be null. I already pushed the source fix, and npm run build:ci passes on the current branch head. No further change was needed for this older run.

2b030a5

@rudder-devbox

rudder-devbox Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor Author

This run checked older commit 860b316. npm run build:ci failed first with TS18047 at src/v0/destinations/http/utils.ts:71 because account.secret may be null. Tests then did not run, leaving LCOV files missing and the Sonar report unusable.

I already pushed the source fix, and npm run build:ci passes on the current branch head. No additional edit was needed for this run.

2b030a5

@rudder-devbox

rudder-devbox Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor Author

Both image builds checked older commit 860b316 and failed in npm run build:ci -- --sourceMap false with TS18047 at src/v0/destinations/http/utils.ts:71: account.secret may be null. I already pushed the source fix. The exact Docker compile command passes on the current branch head, so no additional edit was needed for these runs.

2b030a5

@rudder-devbox

rudder-devbox Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor Author

This run checked older commit e18400b and failed during npm run build with TS18047 at src/v0/destinations/http/utils.ts:71: account.secret may be null. I already pushed the source fix, and npm run build:ci passes on the current branch head. No further edit was needed for this run.

2b030a5

@rudder-devbox

rudder-devbox Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor Author

This coverage run checked older commit e18400b. npm run build:ci failed first with TS18047 at src/v0/destinations/http/utils.ts:71 because account.secret may be null. Tests did not run, leaving LCOV files missing and the Sonar report unusable.

I already pushed the source fix, and npm run build:ci passes on the current branch head. No additional edit was needed for this run.

2b030a5

@rudder-devbox

rudder-devbox Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor Author

The live test everflow-track-conversion › deliver conversion failed because Everflow returned status 204 for its expected-valid conversion. The log shows proxy HTTP 200, then Everflow rejected the conversion (status 204); no error detail returned; the separate random-transaction rejection test passed.

This branch has no Everflow changes. The expected-valid transaction ID comes from the external live-test secret, and Everflow supplied no rejection detail. I could not correct that partner/test-account state from this workspace without a valid transaction ID or the Everflow conversion report. No source change was made, and I did not weaken the test.

shekhar-rudder and others added 2 commits November 10, 2026 14:20
Config-backend inlines non-OAuth linked-account fields into the
destination config, so v2 needs no deliveryAccount handling. Only the
removed `auth` selector needs replacing: gate on authenticationEnabled
and pick the header from the account type's required field.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@shekhar-rudder shekhar-rudder changed the title feat(http): use linked delivery accounts for v2 authentication feat(http): gate v2 auth on authenticationEnabled Nov 10, 2026
Validation now checks username, then bearerToken, then apiKeyName, matching
makeAuthHeaders, so a config that sends Basic auth is no longer rejected for a
missing API key value. Drops the dead auth field from the v2 controller fixture.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
shekhar-rudder
shekhar-rudder previously approved these changes Nov 10, 2026
@rudder-devbox

rudder-devbox Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor Author

The live test everflow-track-conversion › deliver conversion failed again: the proxy returned HTTP 200, but Everflow returned status 204 and no rejection detail. The random-transaction rejection test passed. This same failure occurred on the prior commit; the intervening changes contain no Everflow runtime edit.

The expected-valid transaction ID is supplied by the external live-test secret. I cannot determine or repair Everflow's rejection from this workspace without its conversion report or a valid test transaction. I made no source change and did not weaken the assertion.

@shekhar-rudder
shekhar-rudder marked this pull request as ready for review November 10, 2026 09:09
@shekhar-rudder
shekhar-rudder requested review from a team as code owners November 10, 2026 09:09
Copilot AI balanced review requested due to automatic review settings November 10, 2026 09:09

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues remain for the HTTP v2 authentication configuration update.

No open issues 🎉

What changed in this PR

Updates HTTP v2 authentication to use authenticationEnabled instead of the removed auth selector, matching the new destination configuration. Credentials remain sourced from Config; HTTP v1 behavior is unchanged.

Changes:

  • Gate generated authentication headers on authenticationEnabled and infer the authentication type from available credentials.
  • Require credentials when authentication is enabled and an API key value when API key authentication is selected.
  • Update fixtures and tests for authentication validation, credential precedence, and disabled authentication.
File Description
test/​integrations/​destinations/​http/​common.ts Migrates the v2 fixture to authenticationEnabled.
src/​v0/​destinations/​http/​utils.ts Gates authentication headers and selects their type from credentials.
src/​v0/​destinations/​http/​types.ts Replaces the selector and updates credential validation.
src/​v0/​destinations/​http/​routerTransform.test.ts Tests the new authentication configuration and behavior.
src/​controllers/​__tests__/​destination.test.ts Removes the obsolete v2 noAuth setting.

Review effort: Balanced

# Conflicts:
#	src/v0/destinations/http/routerTransform.test.ts
Copilot AI balanced review requested due to automatic review settings November 10, 2026 09:29

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues were identified for the HTTP v2 authentication configuration update.

No open issues 🎉

Review effort: Balanced

@rudder-devbox

rudder-devbox Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor Author

The live test everflow-track-conversion › deliver conversion failed again: proxy HTTP 200 carried Everflow's status 204, and the delivery verdict says Everflow rejected the conversion ... no error detail returned. The random-transaction rejection test passed. The latest merge changed no Everflow fixture, live-test, or delivery file, and the same rejection occurred on prior commits.

The expected-valid transaction ID comes from the external live-test secret. A valid test transaction or Everflow conversion report is needed to identify and correct the partner-side rejection. I made no source change and did not weaken the assertion.

@sonarqubecloud

Copy link
Copy Markdown

@rudder-devbox

rudder-devbox Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor Author

The user-transformer image build failed before source compilation. Its apt-get upgrade step exited 100 because security.ubuntu.com returned 404 for perl-base_5.34.0-3ubuntu1.10_amd64.deb after apt-get update. This is an Ubuntu package-mirror availability issue, so I made no repository change. The image build needs a retry after the mirror metadata and package files are consistent.

@shekhar-rudder
shekhar-rudder merged commit 71ce3c1 into develop Nov 10, 2026
82 of 86 checks passed
@shekhar-rudder
shekhar-rudder deleted the harness/INT-7519-feat-http-use-linked-delivery-a-6d64fa9e branch November 10, 2026 10:58
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