Skip to content

Proposal: a local front door to the Datum Cloud API (datumctl api proxy) - #246

Closed
scotwells wants to merge 10 commits into
mainfrom
proposal/api-proxy
Closed

Proposal: a local front door to the Datum Cloud API (datumctl api proxy)#246
scotwells wants to merge 10 commits into
mainfrom
proposal/api-proxy

Conversation

@scotwells

@scotwells scotwells commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

What this is

An enhancement proposal for datumctl api proxy — a local server that gives every tool on your machine an authenticated front door to the Datum Cloud API. It forwards each request signed in as you, attaching credentials automatically and keeping them fresh, so the tools behind it never see a token, never store one, and never break when one expires:

$ datumctl api proxy --port 8001
$ curl http://127.0.0.1:8001/apis/resourcemanager.miloapis.com/v1alpha1/organizations

This PR contains only the design document (docs/enhancements/api-proxy/README.md).

Why it exists

  • Local development of apps built on the platform — instead of copying short-lived tokens into .env files, a developer points the app's API base URL at the proxy once and datumctl owns authentication for the whole workday.
  • Live-updating clients — dashboards, controllers, and registries keep watches open so changes appear the moment they happen; delivering those live results in real time is a hard requirement of the design, not an optimization.
  • End-to-end test suites — a harness starts a proxy, reads the printed address, and points every test at it; no test process ever holds a credential.
  • Scripting and explorationcurl against a local address instead of copy-pasting tokens that expire mid-investigation.

Datum's own cloud portal is the first consumer, but the friction is the same for anything built against the platform.

Key design positions the doc takes

  • A faithful stand-in by default, explicit scoping on request — a bare proxy serves the whole API so development URLs match production URLs exactly; --project/--organization serve a single project or organization for short URLs. Scope is never silently inherited from the active context.
  • Conservative security posture — reachable only from the local machine with no way to open it wider, standard browser defenses on and not configurable, client-supplied credentials dropped, tokens never logged and never served.
  • Predictable lifecycle — the session is pinned at startup (datumctl auth switch never repoints a running proxy), the printed address doubles as a machine-readable readiness signal, and when the session dies the proxy answers with a clearly marked error that names the fix rather than imitating a platform rejection.

Review focus

The decisions most worth reviewer eyes — a bare invocation never inherits the active context (production-parity wins), local-machine-only with no override, a same-OS-user socket mode as the first fast-follow, and never retrying a platform rejection on the client's behalf — are each stated with their rationale in the section they belong to.

Companion implementation PR: #247.

🤖 Generated with Claude Code

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
scotwells and others added 9 commits July 12, 2026 21:13
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@scotwells scotwells changed the title Proposal: a local authenticated API proxy (datumctl api proxy) Proposal: a local front door to the Datum Cloud API (datumctl api proxy) Jul 14, 2026
@scotwells

Copy link
Copy Markdown
Contributor Author

Moved to the enhancements repo, where proposal documents live: datum-cloud/enhancements#818. The companion implementation PR remains #247.

@scotwells scotwells closed this Jul 14, 2026
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