@cloudflare/workers-auth 0.5.5 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { l as OAuthConsentPages, F as FileFormat, b as OAuthFlowContext, C as CredentialStore, d as LoginOrRefreshResult, U as UserAuthConfig } from './file-format-B1KgHuUR.mjs';
1
+ import { l as OAuthConsentPages, F as FileFormat, b as OAuthFlowContext, C as CredentialStore, d as LoginOrRefreshResult, U as UserAuthConfig } from './file-format-Dbmn5hhd.mjs';
2
2
  import { ApiCredentials, ComplianceConfig } from '@cloudflare/workers-utils';
3
3
 
4
4
  /** Minimal shape of the interactive `select` prompt's options for account selection. */
@@ -42,13 +42,29 @@ interface AuthContext {
42
42
  * rather than a fork of the factory.
43
43
  */
44
44
  interface CliDescriptor {
45
- /** CLI name used in user-facing messaging and keyring install-dir scoping (e.g. `"wrangler"`). */
45
+ /**
46
+ * The CLI's invocation name, used for keyring install-dir scoping and in
47
+ * messaging that refers to the executable (e.g. `"wrangler"`, `"cf"`).
48
+ */
46
49
  cliName: string;
50
+ /**
51
+ * The CLI's branded name, used in prose addressed to the user (e.g.
52
+ * `"Wrangler"` for wrangler, `"cf"` for cf). Distinct from
53
+ * {@link CliDescriptor.cliName}, which names the executable.
54
+ */
55
+ displayName: string;
47
56
  /** Commands surfaced in auth guidance. */
48
57
  commands: {
49
58
  login: string;
50
59
  whoami: string;
51
60
  createProfile: string;
61
+ /**
62
+ * The command that restarts the OAuth 2.0 Device Authorization Grant,
63
+ * surfaced when a device code is denied, expires, or times out. Spelled
64
+ * out per CLI rather than derived from {@link CliDescriptor.commands.login}
65
+ * so the flag name stays the CLI's business.
66
+ */
67
+ deviceLogin: string;
52
68
  };
53
69
  /**
54
70
  * OS-keyring service identifier. Becomes the `-s` arg to macOS `security`,
@@ -110,6 +126,13 @@ interface CloudflareLoginProps {
110
126
  callbackHost?: string;
111
127
  callbackPort?: number;
112
128
  profile?: string;
129
+ /**
130
+ * When `true`, authenticate using the OAuth 2.0 Device Authorization Grant
131
+ * (RFC 8628) instead of the authorization-code-with-PKCE callback flow. The
132
+ * device flow does not start a local callback server, so `callbackHost` and
133
+ * `callbackPort` are ignored when this is set.
134
+ */
135
+ device?: boolean;
113
136
  }
114
137
  /** A Cloudflare CLI's auth layer, returned by {@link createCloudflareAuth}. */
115
138
  interface CloudflareAuth {