Skip to content

feat(zendesk): authenticate with an OAuth client instead of the API token - #86

Merged
Bilb merged 3 commits into
mainfrom
feat/zendesk-oauth
Nov 24, 2026
Merged

Bilb merged 3 commits into
mainfrom
feat/zendesk-oauth

Conversation

@Bilb

@Bilb Bilb commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Zendesk stops accepting API tokens on 2027-04-30, and since 2026-10-27 no new ones can be created. This moves every Zendesk job (the digest, the review resolver, the claude: note flow) onto an OAuth client and removes API-token support.

  • api.zendesk_session(subdomain) authenticates with a client-credentials token from ZENDESK_OAUTH_CLIENT_ID and ZENDESK_OAUTH_CLIENT_SECRET. The token acts as the admin who created the client, so comments keep coming from Main Support.
  • Tokens last 30 minutes; ClientCredentials renews two minutes early, so the 90-minute digest run keeps working.
  • jobs.toml requires the two OAuth variables instead of ZENDESK_EMAIL and ZENDESK_API_TOKEN. The --email and --api-token flags are removed.

Deploy: this needs the two OAuth values in /etc/session-ops/zendesk.env before it runs, or the digest fails on its environment check and the relay refuses every note. Add them, deploy, restart zendesk-relay, then remove ZENDESK_EMAIL and ZENDESK_API_TOKEN from the file.

Tested: unit tests for the grant, reuse, renewal, refusal and the required variables; a read-only run against Zendesk with no API token in the environment (ticket read, a forced renewal, users/me returning Main Support).

Bilb added 2 commits November 24, 2026 11:50
Zendesk stops accepting API tokens on 2027-04-30 and no longer issues new
ones. With ZENDESK_OAUTH_CLIENT_ID and ZENDESK_OAUTH_CLIENT_SECRET set,
every Zendesk job now takes a client-credentials token and renews it before
its 30-minute expiry; without them it keeps using the API token, so angus
runs unchanged until the client is added to zendesk.env.
ZENDESK_OAUTH_CLIENT_ID and ZENDESK_OAUTH_CLIENT_SECRET are now the only
Zendesk credentials, and the job runner requires them. The --email and
--api-token flags are gone with the token they configured.
@Bilb Bilb changed the title feat(zendesk): authenticate with an OAuth client, API token as fallback feat(zendesk): authenticate with an OAuth client instead of the API token Nov 24, 2026
urllib3 resends a call's original Authorization header on every retry, so
the renewal margin now covers the session's whole default retry span
(510 s) rather than two minutes.
@Bilb
Bilb merged commit dde1ec5 into main Nov 24, 2026
3 checks passed
@Bilb
Bilb deleted the feat/zendesk-oauth branch November 24, 2026 03:42
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.

2 participants