fix(jira): address PR #302 review — signature binding, REST-pivot docs, ADR-015#11
Closed
flamingquaks wants to merge 1 commit into
Closed
Conversation
…T-pivot docs, ADR-015
Resolves all blocking issues from the changes-requested review:
Security (multi-tenant signature binding):
- `bgagent jira setup` no longer mirrors the stack-wide signing secret
into per-tenant OAuth bundles; each tenant keeps its own secret and
only the FIRST tenant seeds the stack-wide fallback.
- The receiver forwards `verified_via` ('per-tenant' | 'stack-wide') to
the processor; on stack-wide verification the processor refuses a
body-supplied cloudId and binds the delivery to the sole active
tenant, dropping when ambiguous (missing verified_via = untrusted).
- Missing-timestamp deliveries now log the skipped replay check so the
bypass is observable.
ADR / docs reconciliation (MCP → REST pivot):
- ADR renumbered to ADR-015 (post-aws-samples#296 ADR-014 collision), status
accepted, rewritten for the implemented REST outbound path and the
actual dedup key; JIRA_SETUP_GUIDE / USER_GUIDE ("six ways") /
ROADMAP / construct + handler docstrings brought in line.
- channel_mcp.py drops the non-functional Jira MCP entry (Atlassian
Remote MCP cannot authenticate headlessly); jira gate is now an
explicit no-op with tests pinning it.
Parity / correctness:
- notifyJiraOnConcurrencyCap added to orchestrate-task (the IAM grants
in agent.ts now have a consumer), mirroring the Linear path.
- Unmapped-project feedback + setup "Next steps" print the real
command: `bgagent jira map <cloud-id> <project-key> --repo …`.
- `webhookEvent` union no longer collapsed by `| string`; stale
cloudId doc comment fixed.
Test coverage:
- jira-webhook-multi-tenant.test.ts (10 cases: per-tenant verify,
cross-tenant mismatch, revoked no-fallback, stack-wide tagging,
missing-timestamp dispatch, infra-error 500).
- Processor cloudId trust-binding tests (4 cases incl. the
stack-wide + foreign-cloudId drop).
- jira-feedback.test.ts (ADF body shape, timeout, non-2xx, resolver
throw), jira-integration construct test (key schemas, TTL, env
wiring, read-only receiver IAM), CLI jira-oauth.test.ts (22 cases:
JSON token exchange, refresh rotation, accessible-resources),
Jira pair added to stored-oauth-token parity contract test.
Suites: cdk 1977 passed, cli 325 passed, agent 1005 passed; Starlight
mirrors regenerated.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Addresses all six blocking issues (and the test-coverage gaps) from krokoko's changes-requested review on aws-samples#302. Merging this into
feat/288-jira-integrationupdates that PR in place.Blocking issues resolved
test_config.pysyntax error) — already fixed at PR HEAD by1e4a4a0; this branch keeps the agent suite green (1005 passed).node docs/scripts/sync-starlight.mjsis clean.bgagent jira setupno longer mirrors the stack-wide secret into per-tenant bundles. Each tenant keeps its own secret; only the first tenant seeds the stack-wide fallback (needed for Settings-UI webhooks, which omitcloudId).verified_via: 'per-tenant' | 'stack-wide'to the processor. On stack-wide verification the processor refuses a body-suppliedcloudIdand binds the delivery to the sole active tenant (drops when zero/multiple); a missingverified_viais treated as untrusted.accepted, rewritten for the implemented REST outbound and the actual dedup key ({issueKey}#{webhookEvent}#{timestamp}).JIRA_SETUP_GUIDE,USER_GUIDE("six ways"),ROADMAP,jira-integration.ts,jira-webhook-processor.ts,config.py, andtest_config.pydocstrings all brought in line.channel_mcp.pydrops the non-functionaljiraentry fromCHANNEL_MCP_BUILDERS(the Atlassian Remote MCP can't authenticate headlessly), with tests pinning the no-op.bgagent jira map <cloud-id> <project-key> --repo …(setup interpolates the actual cloudId).notifyJiraOnConcurrencyCapimplemented inorchestrate-task.ts(parity with Linear), so the registry-read + secret grants inagent.tsnow have their consumer.Test coverage added
cdk/test/handlers/jira-webhook-multi-tenant.test.ts— 10 cases mirroring the Linear multi-workspace suite (per-tenant verify, cross-tenant mismatch fatal, revoked no-fallback even when stack-wide matches,verified_viatagging, infra-error 500, missing-timestamp dispatch).cloudIdtrust-binding tests (4 cases incl. stack-wide + foreign-cloudId drop).cdk/test/handlers/shared/jira-feedback.test.ts— ADF body shape (pinned exactly — REST v3 400s otherwise), timeout/non-2xx/resolver-throw paths.cdk/test/constructs/jira-integration.test.ts— key schemas, GSI, dedup TTL, env wiring, and read-only receiver IAM on the OAuth prefix.cli/test/jira-oauth.test.ts— 22 cases: JSON (not form-encoded) token exchange, refresh-token rotation persistence,invalid_grant, accessible-resources, PKCE, authorize-URL params incl.audience.stored-oauth-token-parity.test.tsparameterized to also cover the JiraStoredOauthToken↔StoredJiraOauthTokenpair.Verification
cdk: 109 suites / 1977 passedcli: 26 suites / 325 passed (+ compile + eslint clean)agent: 1005 passed, ruff + ty cleancheck-types-sync/check-constants-syncOK; Starlight mirrors regenerated🤖 Generated with Claude Code