Change8

@cloudflare/workers-auth@0.5.0

📦 cloudflare-workersView on GitHub →
3 features🔧 4 symbols

Summary

The Cloudflare CLI auth layer has been refactored into a shared core package, `@cloudflare/workers-auth`, improving code reuse and introducing new auth capabilities for the `cf` CLI. Utilities for configuration caching and TTY detection have also been updated and exported from `@cloudflare/workers-utils`.

Migration Steps

  1. If you were previously mocking `ci-info` for tests, you should now mock the TTY-and-CI detection helpers exported by `@cloudflare/workers-utils` instead.

✨ New Features

  • The Cloudflare CLI auth layer has been extracted into a product-agnostic `@cloudflare/workers-auth` core, sharing OAuth login/logout/refresh, credential storage, config cache, and account-selection machinery behind an `AuthProduct` descriptor.
  • A new `@cloudflare/workers-auth/cf` package provides auth for the `cf` CLI, including its own OAuth app registration, a dedicated scope catalog, JSON config files under `~/.config/cloudflare`, and an isolated config-cache namespace.
  • `@cloudflare/workers-utils` now exports `createConfigCache` (with a `namespace` option), `openInBrowser`, and TTY-and-CI detection helpers (`isInteractive`, `isNonInteractiveOrCI`, `isCI`) that accept a logger parameter.

Affected Symbols