feat(getchitty-creds): add zones input + fix API-key payload shape#54
feat(getchitty-creds): add zones input + fix API-key payload shape#54chitcommit wants to merge 1 commit intomainfrom
Conversation
Adds two inputs to the composite action and corrects the API-key path to
match the server contract for /api/credentials/provision.
Why:
- Server-side EnhancedCredentialProvisioner already honors context.zones
for zone-scoped permissions (e.g. Workers Routes Write) on the
cloudflare_workers_deploy type, but the action had no way to forward
zone IDs.
- The API-key path was sending {credentials, purpose, service, repo,
run_id} — the route expects {type, context: {service, purpose, ...}}
and returns a single credential under .credential, not .credentials.X.
Changes:
- New `zones` input (comma-separated CF zone IDs).
- New `type` input (default cloudflare_workers_deploy).
- API-key payload rewritten to {type, context: {service, purpose, repo,
run_id, zones?}}; zones is omitted when empty.
- API-key response parsing reads .credential.value/.credential.account_id.
- Multi-credential outputs (npm/github/neon/register) explicitly empty
on the API-key path — they were already non-functional there; the OIDC
path remains the source of truth for those.
- HTTP status + error envelope handling unified across both paths.
- OIDC payload also forwards zones (server-side support on that route is
a chittyconnect follow-up — the OIDC handler bypasses the provisioner).
Follow-up (chittyconnect): teach /api/github-actions/credentials to route
cloudflare_workers_deploy through EnhancedCredentialProvisioner so zones
work end-to-end via OIDC.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
Summary
Adds
zonesandtypeinputs to thegetchitty-credscomposite action and corrects the API-key path to match the server contract for/api/credentials/provision.This is the chittyops half of the broader zones-support effort. The chittyconnect-side follow-up (teaching the OIDC route to honor
context.zones) is filed separately.Why
EnhancedCredentialProvisioneralready honorscontext.zonesfor zone-scoped permissions (e.g. Workers Routes Write) on thecloudflare_workers_deploytype, but the action exposed no input to forward zone IDs.{credentials, purpose, service, repo, run_id}; the route expects{type, context: {service, purpose, ...}}and returns a single credential under.credential(not.credentials.X). This silently failed for any caller relying on it.Changes
zonestypecloudflare_workers_deploy.{type, context: {service, purpose, repo, run_id, zones?}}..credential.value/.credential.account_id.zones(server-side support is the chittyconnect follow-up — that route bypasses the provisioner today).Notes for reviewers
npm_token/github_token/neon_*/register_tokenmust use the OIDC path. Under API-key auth the server returns one credential at a time; the prior code parsed.credentials.Xkeys that were never present, so those outputs were already empty in practice.reusable-package-publish.yml, which calls via API key forcloudflare_token+account_id— those continue to work.Validation
python3 -c \"import yaml; yaml.safe_load(...)\")connect.chitty.ccis currently returning Cloudflare error 1101 (Worker exception) on every route, including/,/api,/api/credentials/provision, and/api/github-actions/credentials. This is a separate upstream outage and is not introduced by this PR. Holding as draft until the worker is back up so the new payload can be validated against the real backend per CLAUDE.md ("No Mocks, Fake Data, or Placeholder Endpoints").Test plan
connect.chitty.ccis healthygetchitty-credswithzones: <zone_id>via API key, confirm CF token policy includes a zone-scoped blockzones, confirm zone-scoped permissions are dropped server-side (existing provisioner behavior)Follow-up
/api/github-actions/credentialsto routecloudflare_workers_deploythroughEnhancedCredentialProvisionersozonesworks end-to-end via OIDC.🤖 Generated with Claude Code