Wrangler 4.119.0 新增 --device 登录,支持 OAuth 2.0 设备授权流
Workers - Log in to Wrangler without a local callback server
Wrangler 是 Cloudflare Workers 开发者的核心 CLI,这次新增的 --device 登录流直接解决了容器、SSH 和 Codespaces 环境下的认证痛点,省去端口转发和手动 curl 的麻烦。建议升级到 4.119.0 及以上版本,在受限环境中用 npx wrangler login --device 体验新流程。
wrangler login now supports the OAuth 2.0 Device Authorization Grant ↗. Pass --device to authenticate without starting a temporary callback server on localhost:8976:
npx wrangler login --deviceWrangler prints a verification URL and a short user code, opens the URL in your default browser with the code already filled in, and polls Cloudflare for an access token while you approve the request:
⛅️ wrangler 4.119.0
────────────────────
Attempting to login via OAuth Device Authorization Grant...
To authorize Wrangler, please visit:
https://dash.cloudflare.com/oauth2/device
and enter the code:
WDJB-MJHT
You have 5 minutes to approve this request.
Opening a link in your default browser: https://dash.cloudflare.com/oauth2/device?user_code=WDJB-MJHT
Successfully logged in.The default login flow needs your browser to reach localhost:8976, which is not always possible from containers, remote SSH sessions, or GitHub Codespaces. Previously these environments required forwarding ports or fetching the callback URL with curl from a second terminal session. Because --device has no callback server, those workarounds are no longer necessary.
Since the plain verification URL and user code are both printed to the terminal, you can also approve the request from a phone or another machine. Pass --browser=false to stop Wrangler from opening a browser at all.
Available in Wrangler version 4.119.0 or later. For more information, refer to wrangler login.
更进一步:量化金融体系
看懂新闻只是起点——沿量化金融路径,把它变成能交付的工程能力