Skip to content

[BUG] Bigin-only OAuth config silently arms the shared Zoho packs with Bigin credentials #262

Description

@Tjemmmic

Overview

A deployment that configures only the isolated Bigin OAuth client silently arms the seven shared Zoho packs with Bigin's credentials. Those connectors then authenticate against an app that lacks their scopes, so connections fail at runtime rather than at configuration time.

zohoOAuthEnvMap (src/connectors/adapters/factories.ts:366-377) lists Bigin's env names as the third fallback for the shared packs:

clientId: ['ZOHO_OAUTH_CLIENT_ID', 'ZOHO_CRM_OAUTH_CLIENT_ID', 'BIGIN_BY_ZOHO_OAUTH_CLIENT_ID']

resolveConnectorAdapterFactoryOptions takes the first non-empty name, so with only BIGIN_BY_ZOHO_* present every shared pack resolves to Bigin's client instead of returning null.

This dates from db329a7 fix(zoho): isolate Bigin OAuth credentials, which gave Bigin its own envMap but left its names in the shared list.

Reproduction

Verified against main:

const env = {
  BIGIN_BY_ZOHO_OAUTH_CLIENT_ID: 'bigin-id',
  BIGIN_BY_ZOHO_OAUTH_CLIENT_SECRET: 'bigin-secret',
}
const crm = CONNECTOR_ADAPTER_FACTORIES.find(c => c.kind === 'zoho-crm')!
resolveConnectorAdapterFactoryOptions(crm, env)
// => { clientId: 'bigin-id', clientSecret: 'bigin-secret' }   ← expected null

Affects zoho-crm, zoho-desk, zoho-bookings, zoho-books, zoho-invoice, zoho-mail, zoho-campaigns.

Why it needs a decision rather than a quick edit

Dropping BIGIN_BY_ZOHO_* from zohoOAuthEnvMap is the obvious fix and makes the packs return null — unregistered rather than misconfigured, which is the right failure. But it changes credential resolution for seven connectors, so any deployment currently leaning on that fallback would see them stop registering. That is a maintainer call about deployment topology, not a mechanical fix.

Deliberately not bundled into #261, which is test-only and unblocks the stalled release.

Checklist

  • Decide whether the shared packs should accept BIGIN_BY_ZOHO_* at all
  • Remove the fallback (or narrow it) and assert null for a Bigin-only environment
  • Check whether the same pattern exists in other provider packs sharing an env map

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions