Skip to content

fix(destination): authenticate Marketo bulk uploads with bearer token - #7505

Merged
maheshkutty merged 3 commits into
release/1.91.xfrom
harness/INT-7415-marketo-auth-release-1.91
Oct 20, 2026
Merged

maheshkutty merged 3 commits into
release/1.91.xfrom
harness/INT-7415-marketo-auth-release-1.91

Conversation

@rudder-devbox

@rudder-devbox rudder-devbox Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Backport of #7504 to release/1.91.x.

Description

Fixes MARKETO_BULK_UPLOAD lead imports returning Marketo 603 errors after form-field token authentication was removed.

The bulk import request now:

  • sends the OAuth token as Authorization: Bearer <token>;
  • omits access_token from the multipart form;
  • keeps the upload on its existing HTTP client (moving it to the shared client with a configurable timeout is a follow-up, since the shared client's 30s timeout would apply to uploads of up to 10MB);
  • preserves the CSV file, format=csv, and optional lookupField parts.

Request-level tests cover both configured and absent deduplication fields, the bearer header, token-field omission, and uploaded CSV contents.

Linear Ticket

INT-7415

Security

  • The code changed/added as part of this pull request won't create any security issues with how the software is being used.

Validation

  • make fmt — passed
  • Focused Marketo package tests — passed
  • go vet ./router/batchrouter/asyncdestinationmanager/marketo-bulk-upload/... — passed
  • go run github.com/golangci/golangci-lint/v2/cmd/[email protected] run ./router/batchrouter/asyncdestinationmanager/marketo-bulk-upload/... — passed (0 issues)

⚠️ Known Issues

go test -count=1 ./router/batchrouter/asyncdestinationmanager/marketo-bulk-upload/... encounters an unrelated pre-existing failure in TestReadJobsFromFile/No_read_permissions. The sandbox runs tests as root, so opening a chmod 000 file succeeds; the existing test then dereferences a nil error and panics. All other package tests, including the new request test, pass.

Limit the fix to the auth change. Passing the shared client put uploads
(up to 10MB) under its 30s timeout, which the previous client did not
have. Moving uploads onto the shared client with a configurable timeout
is left for a follow-up.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

🔒 Scanned for secrets using gitleaks 8.30.1
Co-Authored-By: Claude Opus 5.5 <[email protected]>

🔒 Scanned for secrets using gitleaks 8.30.1
@maheshkutty
maheshkutty marked this pull request as ready for review October 20, 2026 08:38
@codecov

codecov Bot commented Oct 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.15%. Comparing base (526602c) to head (cba2b08).

Additional details and impacted files
@@                Coverage Diff                 @@
##           release/1.91.x    #7505      +/-   ##
==================================================
+ Coverage           84.53%   85.15%   +0.62%     
==================================================
  Files                 632      632              
  Lines               62839    62839              
==================================================
+ Hits                53118    53511     +393     
+ Misses               9718     9325     -393     
  Partials                3        3              

☔ 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.

@maheshkutty
maheshkutty merged commit 72f1013 into release/1.91.x Oct 20, 2026
73 checks passed
@maheshkutty
maheshkutty deleted the harness/INT-7415-marketo-auth-release-1.91 branch October 20, 2026 09:13
@maheshkutty
maheshkutty restored the harness/INT-7415-marketo-auth-release-1.91 branch October 20, 2026 09:51
maheshkutty added a commit that referenced this pull request Oct 20, 2026
…#7510)

# Description

Fixes `MARKETO_BULK_UPLOAD` lead imports failing with Marketo error 603
(Access denied).

Adobe [removed
support](https://experienceleague.adobe.com/en/docs/marketo-developer/marketo/rest/authentication)
for passing `access_token` as a request parameter on 2026-08-31. The
bulk import request still sent it as a multipart form field, so every
import now fails. Poll and lead-status calls already use the header and
are unaffected.

The bulk import request now:
- sends the token as `Authorization: Bearer <token>`;
- no longer sends `access_token` in the multipart form;
- keeps the CSV file, `format=csv` and optional `lookupField` parts
unchanged.

The upload keeps its existing HTTP client on purpose. Moving it to the
shared client would put uploads of up to 10MB under that client's 30s
timeout, so that change is left for a follow-up with a configurable
timeout.

This is the `master` counterpart of #7505 (`release/1.91.x`).

## Linear Ticket

INT-7415

## Security

- [x] The code changed/added as part of this pull request won't create
any security issues with how the software is being used.

## Validation

- `TestSendHTTPRequest` covers the bearer header, the missing
`access_token` field, `format`, `lookupField` with and without a
deduplication field, and the uploaded CSV. It fails if the
`access_token` form field is put back.
- `go test
./router/batchrouter/asyncdestinationmanager/marketo-bulk-upload/...`
passes.
- `go vet` and `golangci-lint` v2.14.0 on the package: 0 issues.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
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.

4 participants