Repository navigation
Support temporary accounts with --temporary-account and --event-code - #298
Conversation
commit: |
|
| mean | stddev | min | max | |
|---|---|---|---|---|
| PR | 257.7 ms | 3.2 ms | 252.8 ms | 265.4 ms |
| base | 261.6 ms | 4.6 ms | 254.9 ms | 271.4 ms |
Δ (PR vs base): ↓ -4.0 ms (-1.5%)
Measured with hyperfine on ubuntu-latest (3 warmup runs, 20 timed runs). CI numbers carry ±a few ms of runner jitter; treat small deltas as noise.
|
Review: 1 findings. 🤖 I've done a thorough review of your PR.
|
|
Review: 1 findings. Posted 1 inline suggestion. |
|
Review: 1 findings. 🤖 I've done a thorough review of your PR. Adds global temporary-account and event-code support.
|
|
Review: 2 findings. Adds global temporary-account provisioning and event-code support.
|
|
No new concerns since the last review |
|
🤖 I've done a thorough review of your PR. Adds temporary-account authentication and event-code support across cf workflows.
|
635d321 to
2e9b101
Compare
|
💬 Approved with comments — The temporary-account flow is implemented carefully and well tested. It covers flag validation, rejection when credentials exist or with Findings: 2 suggestions The decision is advisory: this comment never approves, blocks or requests changes on the pull request. 🔧 Fix with your agentPaste the following into your coding agent to investigate and fix these issues. 📖 AGENTS.md: 💬 1 suggestionThe account and token resolution summary in packages/cli/AGENTS.md doesn't include the temporary-account path. Recommendation: 💬 Optional Nits
View full review
📝 Documentation: 💬 1 suggestionThe README's credential-resolution section doesn't mention the temporary-account fallback. Recommendation: 💬 Optional Nits
View full review
✅ All other checks passed🚀 Release: ✅ LGTMRisk: Low. The changeset is present for this user-facing change. 🔒 Security: ✅ LGTMI found no exploitable problems.
📋 Code Quality: ✅ LGTMI found no correctness, error-handling, convention or test-coverage problems.
⚡ Performance: ✅ LGTMNo performance concerns. Reviewed commit: |
|
🤖 I've done a thorough review of your PR. Adds global temporary-account provisioning and event-code support.
|
|
LGTM |
|
No new concerns since the last review |
|
🤖 I've done a thorough review of your PR. Adds global temporary-account provisioning and event-code support.
|
|
No new concerns since the last review |
|
No new concerns since the last review |
petebacondarwin
left a comment
There was a problem hiding this comment.
A whole load of NITs sorry.
But none blocking, and otherwise LGTM.
|
LGTM |
|
LGTM |
|
LGTM! |
Summary
Adds hidden global
--temporary-accountand--event-codeflags. When no Cloudflare credentials are available, cf creates or reuses a short-lived account through@cloudflare/workers-auth, prints its claim URL, and uses that account's ID and scoped API token for the command.--temporary-accountworks on every command. cf does not keep a per-command allow-list; the API reports operations the temporary token cannot perform.--local.--event-coderequires--temporary-account, is trimmed, and rejects blank or repeated values. It is sent only when a new account is created, and is never cached, printed, or recorded in telemetry.--temporary-account, andcf auth whoamisuggests it when unauthenticated.cf auth logoutnow delegates to workers-auth's shared logout, matching Wrangler: it clears a cached temporary account and prints the shared messages. WithCLOUDFLARE_API_TOKENset, it asks you to unset the variable and leaves any stored OAuth login in place.Comparison with Wrangler
Both CLIs use the same workers-auth flow, so terms prompt/notice, proof-of-work, caching and reuse (per API environment), the already-authenticated refusal, the compliance-region check, clearing on login and logout, and logout messages behave the same. The differences are deliberate:
--temporary-account. Shared workers-auth messages are rewritten to use that spelling.--event-codeis also accepted onworkers versions create.Tests
temporary-accounts.test.tsplus updates to the context, auth-token, errors, profiles, schema-flags, arg-derivation, and telemetry sanitization tests.deploy(14 cases in the newdeploy/core.test.ts),versions upload,d1 migrations apply,logout,whoami, and root help. The logout tests now assert Wrangler's shared messages. Removed the ported identities from the fallback shards and the generator skip lists, and updatedMANIFEST.md(624 passing, 1,498 todo, 3,354 skip).pnpm test(cli and wrangler-tests),pnpm check:type,pnpm check:lint, andpnpm check:formatpass locally.