Skip to content

fix(zapier/omi-zap): send bearer token alongside uid for gated endpoints - #14471

Merged
Git-on-my-level merged 2 commits into
BasedHardware:mainfrom
hridaya423:fix/zapier-app-token
Sep 27, 2026
Merged

Git-on-my-level merged 2 commits into
BasedHardware:mainfrom
hridaya423:fix/zapier-app-token

Conversation

@hridaya423

@hridaya423 hridaya423 commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Companion to #14429. Once ZAPIER_WEBHOOK_SECRET is configured, the gated /zapier/* data-plane routes require a shared-secret bearer token, and the published Zapier app (omi-zap) would 401 on every call since it only sends the uid.

Adds an optional Integration Token auth field in authentication.js, sent as Authorization: Bearer <token> on the connection test and, via requestTemplate, on every trigger/create request (trigger/subscribe, action/memories, me, etc.). performSubscribe/performUnsubscribe inherit the template header as well.

Left required: false so existing installs keep working until the secret rollout lands; the token can be provisioned next to the Secret Key in the app's Integration Instructions. Ship order: publish the app update first (harmless no-op while no secret is set), then set ZAPIER_WEBHOOK_SECRET.

Refs #14429, per the review note that the rollout needs a client-side companion.

Failure-Class: none

Companion to the server-side uid-as-auth fix (BasedHardware#14429): once
ZAPIER_WEBHOOK_SECRET is set, /zapier/* data-plane routes require a
shared-secret bearer token, and the published Zapier app would 401 on
every call. Adds an optional "Integration Token" auth field whose value
is sent as Authorization: Bearer on the auth test and, via
requestTemplate, on every trigger/create request. Left optional so
existing installs keep working until the secret rollout lands.

Refs BasedHardware#14429

@Git-on-my-level Git-on-my-level left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @hridaya423 — this is the right companion to #14429, and the ship order you describe (publish the app update first, then set ZAPIER_WEBHOOK_SECRET) is correct.

I verified the mechanics against the Zapier platform's request-merge behavior:

  • plugins/zapier/omi-zap/index.js — adding Authorization: Bearer {{bundle.authData.token}} to requestTemplate.headers reaches every app-client call: create_memory's perform (POST /zapier/action/memories) declares no headers of its own, and performSubscribe/performUnsubscribe in triggers/on_memory_created.js set only Content-Type/Accept, which the platform merges case-insensitively without dropping the template header. The inheritance claim in the description checks out.
  • plugins/zapier/omi-zap/authentication.js — the connection test on /zapier/me now sends the same header, and the new optional token field (password type, required: false) keeps existing installs working during the rollout. Good call keeping it non-required.

Two things to sort out before the rollout, neither blocking the code:

  1. The token field's helpText says the Integration Token is "shown next to the Secret Key in the Omi App under Explore > Apps > Zapier > Integration Instructions" — but plugins/templates/setup_zapier.html currently displays only the Secret Key, and neither this PR nor #14429 provisions or displays a token anywhere. Could you soften the wording (e.g. "will be provisioned alongside the Secret Key") or coordinate so the display lands before the Zapier app update publishes? Otherwise users will go looking for a token that isn't there yet.
  2. Rollout gap for maintainers: once ZAPIER_WEBHOOK_SECRET is set, existing connections without the token will 401 on every call ({{bundle.authData.token}} renders empty, and removeMissingValuesFrom doesn't apply to headers), and there's no issuance path yet. Publish-first is still the right order — just noting the token provisioning/display piece needs to land in the same window before the secret is turned on.

Leaving for human maintainer review: the credential-issuance and rollout sequencing with #14429/#14428 need maintainer sign-off before the secret goes live.

— automated maintainer review, posted on David's behalf


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

@Git-on-my-level Git-on-my-level added security-review Touches auth, provider routing, secrets, or security-sensitive surfaces positive-signal Automation verified a genuine fix/quality contribution javascript JavaScript or TypeScript implementation work labels Sep 18, 2026
@hridaya423

Copy link
Copy Markdown
Contributor Author

Thanks — addressed item 1 in f53c37d: the token helpText now says the integration token is "provisioned alongside the Secret Key" rather than implying it is already displayed, so users will not go looking for a token that is not there yet.

Item 2 (token issuance/display + the secret rollout window) is maintainer-side as noted — publish-first ordering with #14429 stands, and the display piece needs to land in the same window before ZAPIER_WEBHOOK_SECRET is enabled.

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Small, low-risk client-side addition (optional Integration Token field on the Zapier connector, required:false). Not yet an active bug fix -- companion backend enforcement PR #14429 is still open/unmerged, so this is currently a no-op until that lands. Author hridaya423 has 0/17 merged history (part of the flagged auth-hardening PR volume); change itself is benign (no secret handling, no verification logic), approve-only per confidence gate (<4/5, preparatory not a live fix).

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Companion #14429 still open/BLOCKED, this remains a preparatory no-op -- approve-only, low confidence.

@aryanorastar

Copy link
Copy Markdown
Collaborator

Keeping this open on f53c37dff44e.

remaining-hole zapier bearer-alongside-uid companion to #14429; 0-CI no tests so not APPROVE.

kodjima APPROVE is the size gate, not maintainer merge.

I am not approving or merging this SHA.

@aryanorastar

Copy link
Copy Markdown
Collaborator

Keeping this open. Not approving f53c37dff44e. plugins/zapier/omi-zap/authentication.js on origin/main sends X-UID only. Bearer token is a real header add, but rollup has 0 checks (UNSTABLE). Not FTC-approvable.

— Astar, on behalf of @aryanorastar

@aryanorastar aryanorastar left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

On f53c37dff44e4a1052fd08612e825d1bf3cc5134, plugins/zapier/omi-zap/authentication.js Integration Token is required:false and no test pins a bearer gate. The hole is still on this head.

@Git-on-my-level

Copy link
Copy Markdown
Member

Re-reviewed at the maintainer's request, with execution evidence gathered fresh against head f53c37d:

Approach verified correct. The bearer-shared-secret-with-uid pattern mirrors the merged mentor_webhook_auth precedent (fail-closed, env secret), and requestTemplate header propagation reaches every trigger/create call including subscribe/unsubscribe. required:false keeps existing installs working, which is the right rollout order for the companion backend gate in #14429.

On the outstanding review points:

  1. helpText — resolved by the author in f53c37d (now reads "provisioned alongside the Secret Key … Required once the backend enables authenticated Zapier endpoints").
  2. Token display gap — real, but maintainer-side: plugins/templates/setup_zapier.html needs a token field before ZAPIER_WEBHOOK_SECRET is enabled. It does not block this client companion (the header is a harmless no-op until then). Tracked as a rollout step, not a PR blocker.
  3. "0 checks / no test" — the CI reading is stale: the latest run on f53c37d has 33 check-runs with the Backend Hermetic Merge Gate, source-closure, and Detect Changes all passing. The only reds (Hygiene, PR Metadata Preflight) traced to a missing Failure-Class declaration in the PR body — now added (Failure-Class: none), which should turn both green on the next run. On the header-pinning test: this directory's only existing test (on_memory_created.test.js) never asserts request headers, even for the pre-existing X-UID; we agree a pinned-header test is worth having but it's a new bar for this directory, not a regression this PR introduces — happy to take it as a fast-follow.

Remaining rollout coordination (post-merge, tracked elsewhere): publish the updated Zapier app before enabling the secret; token provisioning in setup_zapier.html; merge #14429 in the same window.

Verdict: approve-pending-green — with the body fix in, the next CI run should be clean; this is ready to merge once checks pass.

@Git-on-my-level
Git-on-my-level merged commit 41b9090 into BasedHardware:main Sep 27, 2026
35 of 37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

javascript JavaScript or TypeScript implementation work positive-signal Automation verified a genuine fix/quality contribution security-review Touches auth, provider routing, secrets, or security-sensitive surfaces

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants