Title#
feat: add JiraAdapter and POST /webhooks/jira route (BJ-7)
Problem#
Agent-core has no way to receive and normalize Jira webhook events. The Atlassian integration epic requires a Jira webhook handler that maps Jira events to DispatchEvent for downstream pipeline routing.
Task / Link#
Closes #547 — BJ-7: JiraAdapter + webhook route
Changes#
- Add
src/webhook/crypto.ts— sharedverifyHmacSha256helper; extracted fromGitHubAdapterso both adapters share one HMAC-SHA256 code path - Refactor
GitHubAdapter.verifySignatureto delegate to the shared helper (no behaviour change) - Add
JiraAdapterimplementingPlatformAdapterwithplatform='jira'; maps 5 Jira webhook events toDispatchEvent(intake,issue_updated,task_cancelled,issue_comment,link_created) - Extend
DispatchEventTypewith'issue_updated'and'link_created'; add'jira'to theplatformunion - Add
POST /webhooks/jiracontroller route; readsJIRA_WEBHOOK_SECRET(optional) for signature verification viax-hub-signatureheader - Register
JiraAdapterinWebhookModule.onModuleInit() - Add
JIRA_WEBHOOK_SECRET: Joi.string().optional()to config schema; document in.env.exampleandCLAUDE.md
Notes#
JIRA_WEBHOOK_SECRETis optional — if not configured, signature verification is skipped for Jira webhooks (suitable for local dev / trusted networks)jira:issue_updatedwithout achangelogfield emits anissue_updatedevent with nocommentBody(graceful per plan assumption)- Unknown
webhookEventvalues return 200 withstatus: ignored(no throw) - Downstream routing for
issue_updatedandlink_createdis left to a follow-up BJ- story
Testing#
- Unit tests:
jira.adapter.spec.tscovers all 5 event types, bad/missing signature (3 cases), unknown event, and missing required fields webhook.controller.spec.tsextended with 4 jira-route scenarios (401, ignored, dispatched, no-adapter)- All 50 existing test suites continue to pass after
GitHubAdaptercrypto extraction npm run lintpasses with zero warnings