Skip to content

Let the server derive the delivery allow-list by default - #2

Merged
njb90 merged 1 commit into
mainfrom
delivery-ip-defaults
Aug 3, 2026
Merged

Let the server derive the delivery allow-list by default#2
njb90 merged 1 commit into
mainfrom
delivery-ip-defaults

Conversation

@njb90

@njb90 njb90 commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

What

  • create no longer sends a default delivery_ips — the API locks delivery to the requester's resolved address on its own, so the default request body carries no IP list. Explicit --ip values are sent verbatim, unchanged.
  • delivery_ips is now optional in the library API (ProvisionRequest).
  • The public-IP lookup is demoted to diagnostics only: after a create, the CLI checks (best-effort, 3s timeout, never throws) whether this machine's externally observed IP is in the returned allow-list, and prints a warning with the exact --force --ip <ip> fix if not. Behind VPNs and NAT pools the API path and the media delivery path can exit from different addresses, which otherwise surfaces later as an unexplained delivery 401.
  • The lookup rejects private/reserved addresses (corporate proxies and split DNS can make echo services return internal IPs) and can never shape the request or block a create.

Why

Simplest possible default contract: the server owns the allow-list unless the caller explicitly overrides it, and the CLI's only added value on the IP front is telling users when the lock won't match their delivery path — not guessing on their behalf.

Testing

npm test — 51/51 (node:test, in-process HTTP stubs). Coverage includes: default request omits delivery_ips, explicit --ip passthrough with zero lookups, private/reserved echo responses treated as undetermined, mismatch-warning trigger conditions. Verified end-to-end against the live API: default create → cloud provisioned, delivery locked to the caller, sample asset delivered with transformations.

🤖 Generated with Claude Code

The API appends the requester's resolved address to delivery_ips on
every create, so the CLI no longer sends a default list — omitting the
field entirely and keeping explicit --ip values verbatim. delivery_ips
is now optional in the library API.

The public-IP lookup becomes diagnostics-only: after create it checks
whether this machine's externally observed IP is in the returned
allow-list and, if not, warns with the exact fix — the API path and the
delivery path can exit from different addresses behind VPNs and NAT
pools, which otherwise surfaces as an unexplained delivery 401. The
lookup rejects private and reserved addresses, never shapes the
request, and never blocks a create.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@njb90
njb90 merged commit 2b3d05f into main Aug 3, 2026
4 checks passed
@njb90
njb90 deleted the delivery-ip-defaults branch August 3, 2026 16:02
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