Skip to content

[SDK-867] Add a campaign approval scope keyed on the Iterable server key - #44

Open
franco-zalamena-iterable wants to merge 2 commits into
mainfrom
feature/SDK-867-campaign-consent
Open

franco-zalamena-iterable wants to merge 2 commits into
mainfrom
feature/SDK-867-campaign-consent

Conversation

@franco-zalamena-iterable

@franco-zalamena-iterable franco-zalamena-iterable commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

SDK-867

This PR adds the consent that campaign mode will need. agent approve campaign records a new campaign scope keyed on a fingerprint of the Iterable server key, the first 16 hex characters of its sha256, and the key itself is never stored or printed. Nothing sends yet, the campaign send comes in a later PR.

APPROVED=1 doesn't cover this scope. If the key changes or isn't loaded there is no consent, so a yes given for one key doesn't carry over to another. The Firebase and campaign scopes are separate, a yes to one says nothing about the other. Fingerprinting uses shasum and falls back to sha256sum, and if neither is installed agent approve campaign says it can't fingerprint the key instead of saying there is no key.

This is the second part of SDK-867 and it is independent of #43 (G17 matching). Plugin version is bumped to 26.11.4.

Type

  • Manual reference-content edit
  • Skill / pipeline / CI change

If this is a skill / pipeline / CI change

  • pnpm check:all green (not run locally, nothing under pipeline/ changed and the manifests are covered by tests/plugin-manifests.sh below)
  • If changing the schema or a validator, tested both the success and the failure case locally (n/a)
  • If changing SKILL.md, sanity-checked the routing table against that skill's reference/ (n/a)

Testing

tests/approval-gate.sh has a new Iterable campaign section with 18 checks, covering no yes on record, APPROVED=1, approving with no key, a different or swapped key, a blank-key row on disk, no SHA-256 tool, sha256sum matching shasum, and both cross-scope cases.

$ bash tests/approval-gate.sh
  PASS campaign: agent approve campaign records it against a key fingerprint
  PASS campaign: the key is neither printed nor stored, only its fingerprint
  PASS campaign: a different server key is asked again
  PASS campaign: swapping the key in .env needs a new yes
  PASS campaign: sha256sum alone fingerprints the key the same as shasum
  PASS campaign: a campaign yes says nothing about Firebase
  PASS campaign: a Firebase yes says nothing about Iterable campaigns
77 PASS, 0 FAIL, exit 0

$ bash tests/agent-questions.sh
164 PASS, 0 FAIL, exit 0

$ bash tests/plugin-manifests.sh
  PASS all three manifests name one version             26.11.4
10 PASS, 0 FAIL, exit 0

Anything reviewers should know

Note on merge order: #43 is on 26.11.2 and #42 will need 26.11.3, so this one is numbered to go in after both.

🤖 Generated with Claude Code

Creating a template and a running campaign in someone's Iterable project
needs its own recorded yes. The project id is only readable from a device
endpoint, after this has to be asked, so the approval is scoped to a
fingerprint of the server key. The key itself is never stored or printed.
APPROVED=1 does not cover it, and a Firebase yes says nothing about it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The campaign scope hashed the key with shasum only, which perl-less Linux
images lack, and the failure surfaced as "no Iterable server key yet".
Fall back to sha256sum (same 16-hex value) and say plainly when neither
exists. A blank campaign key now gets a placeholder scope, like an unchosen
project, and the gate tests plant blank rows so the empty-key guard can't
be dropped unnoticed. Comments and usage text now cover all four scopes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant