@cloudflare/workers-auth 0.17.0 → 0.18.1

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.
package/dist/cf/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { createRequire } from 'node:module';
2
- import { createAuthConfigFileHelpers, createPreferences, createKeyringPreference, createFileStorage, createCloudflareAuth, createCloudflareProfileStore } from '../chunk-MP32ZADQ.mjs';
3
- export { AuthenticationError } from '../chunk-H5PZ3FJ2.mjs';
2
+ import { createAuthConfigFileHelpers, createPreferences, createKeyringPreference, createFileStorage, createCloudflareAuth, createCloudflareProfileStore } from '../chunk-PCKGSFVR.mjs';
3
+ export { AuthenticationError } from '../chunk-Q5KVZMHK.mjs';
4
4
  import { __name } from '../chunk-VAZEJK55.mjs';
5
5
  import { getEnvironmentVariableFactory, getGlobalConfigPath, getCloudflareApiEnvironmentFromEnv } from '@cloudflare/workers-utils';
6
6
  import path from 'node:path';
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from 'node:module';
2
- import { stringifyFile, parseFile, dedent, DEFAULT_TEMPORARY_ACCOUNT_FLAG, createCredentialStorageContext, createOAuthFlow, getAuthFromEnv, createProfileStore, AuthenticationError, validateAccountId, getCloudflareAccountIdFromEnv, getAuthConfigFilePath, getEncryptedAuthConfigFilePath, scrubEncryptedCredentials, validateProfileName, getCloudflareAuthUseKeyringFromEnv } from './chunk-H5PZ3FJ2.mjs';
2
+ import { stringifyFile, parseFile, dedent, DEFAULT_TEMPORARY_ACCOUNT_FLAG, createCredentialStorageContext, createOAuthFlow, getAuthFromEnv, createProfileStore, AuthenticationError, validateAccountId, getCloudflareAccountIdFromEnv, getAuthConfigFilePath, getEncryptedAuthConfigFilePath, scrubEncryptedCredentials, validateProfileName, getCloudflareAuthUseKeyringFromEnv } from './chunk-Q5KVZMHK.mjs';
3
3
  import { __name } from './chunk-VAZEJK55.mjs';
4
4
  import { existsSync, rmSync, mkdirSync, writeFileSync, chmodSync, readFileSync as readFileSync$1, readdirSync } from 'node:fs';
5
5
  import path3 from 'node:path';
@@ -1,8 +1,8 @@
1
1
  import { createRequire } from 'node:module';
2
2
  import { __name } from './chunk-VAZEJK55.mjs';
3
- import { getEnvironmentVariableFactory, getCloudflareApiEnvironmentFromEnv, getBooleanEnvironmentVariableFactory, UserError, readFileSync, isNonInteractiveOrCI, FatalError, getCloudflareApiBaseUrl, COMPLIANCE_REGION_CONFIG_PUBLIC, getCloudflareComplianceRegion, parseTOML } from '@cloudflare/workers-utils';
3
+ import { getEnvironmentVariableFactory, getCloudflareApiEnvironmentFromEnv, getBooleanEnvironmentVariableFactory, UserError, readFileSync, isNonInteractiveOrCI, FatalError, getCloudflareApiBaseUrl, COMPLIANCE_REGION_CONFIG_PUBLIC, addCustomApiHeaders, getCloudflareComplianceRegion, parseTOML } from '@cloudflare/workers-utils';
4
4
  import { spawn, spawnSync } from 'node:child_process';
5
- import { fetch } from 'undici';
5
+ import { fetch, Headers } from 'undici';
6
6
  import { webcrypto, createHash, randomBytes, createCipheriv, createDecipheriv } from 'node:crypto';
7
7
  import { TextEncoder } from 'node:util';
8
8
  import assert2 from 'node:assert';
@@ -545,9 +545,11 @@ function getCachedTemporaryPreviewAccount(storage) {
545
545
  }
546
546
  __name(getCachedTemporaryPreviewAccount, "getCachedTemporaryPreviewAccount");
547
547
  async function requestPowSolution(temporaryAccountLogger, cliDisplayName) {
548
+ const headers = new Headers({ "Content-Type": "application/json" });
549
+ addCustomApiHeaders(headers);
548
550
  const response = await fetch(getTemporaryPreviewChallengeUrl(), {
549
551
  method: "POST",
550
- headers: { "Content-Type": "application/json" },
552
+ headers,
551
553
  body: "{}"
552
554
  });
553
555
  if (!response.ok) {
@@ -588,9 +590,11 @@ async function requestPowSolution(temporaryAccountLogger, cliDisplayName) {
588
590
  __name(requestPowSolution, "requestPowSolution");
589
591
  async function createTemporaryPreviewAccount(temporaryAccountLogger, request, cliDisplayName = "Wrangler") {
590
592
  const pow = await requestPowSolution(temporaryAccountLogger, cliDisplayName);
593
+ const headers = new Headers({ "Content-Type": "application/json" });
594
+ addCustomApiHeaders(headers);
591
595
  const response = await fetch(getTemporaryPreviewUrl(), {
592
596
  method: "POST",
593
- headers: { "Content-Type": "application/json" },
597
+ headers,
594
598
  body: JSON.stringify({
595
599
  termsOfService: TEMPORARY_TERMS_URLS.termsOfService,
596
600
  privacyPolicy: TEMPORARY_TERMS_URLS.privacyPolicy,
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from 'node:module';
2
- export { AuthenticationError, EncryptedFileCredentialStore, FileCredentialStore, LinuxSecretToolKeyProvider, MacSecurityKeyProvider, NapiKeyringKeyProvider, PINNED_KEYRING_VERSION, PKCE_CHARSET, TEMPORARY_TERMS_NOTICE, TEMPORARY_TERMS_PROMPT, clearAccessCaches, clearCredentialStorageState, createCredentialStorageContext, createOAuthFlow, createProfileStore, decryptString, domainUsesAccess, encryptString, findKeyringBinding, generateAuthUrl, generateKey, generateRandomState, generateVerificationUrl, getAccessHeaders, getAuthConfigFilePath, getAuthFromEnv, getAuthUrlFromEnv, getCloudflareAPITokenFromEnv, getCloudflareAccountIdFromEnv, getCloudflareAuthProfileFromEnv, getCloudflareAuthUseKeyringFromEnv, getCloudflareGlobalAuthEmailFromEnv, getCloudflareGlobalAuthKeyFromEnv, getEncryptedAuthConfigFilePath, getKeyringAccountName, getKeyringInstallDir, installKeyringBindingSync, parseEncryptedEnvelope, probeSecretTool, readStoredAuthState, resetCredentialStorageState, resolveKeyProvider, scrubEncryptedCredentials, setKeyProviderFactoryForTesting, setKeyringEntryFactory, setLinuxSecretToolRunner, setMacSecurityCommandRunner, setNpmRunner, validateProfileName } from './chunk-H5PZ3FJ2.mjs';
2
+ export { AuthenticationError, EncryptedFileCredentialStore, FileCredentialStore, LinuxSecretToolKeyProvider, MacSecurityKeyProvider, NapiKeyringKeyProvider, PINNED_KEYRING_VERSION, PKCE_CHARSET, TEMPORARY_TERMS_NOTICE, TEMPORARY_TERMS_PROMPT, clearAccessCaches, clearCredentialStorageState, createCredentialStorageContext, createOAuthFlow, createProfileStore, decryptString, domainUsesAccess, encryptString, findKeyringBinding, generateAuthUrl, generateKey, generateRandomState, generateVerificationUrl, getAccessHeaders, getAuthConfigFilePath, getAuthFromEnv, getAuthUrlFromEnv, getCloudflareAPITokenFromEnv, getCloudflareAccountIdFromEnv, getCloudflareAuthProfileFromEnv, getCloudflareAuthUseKeyringFromEnv, getCloudflareGlobalAuthEmailFromEnv, getCloudflareGlobalAuthKeyFromEnv, getEncryptedAuthConfigFilePath, getKeyringAccountName, getKeyringInstallDir, installKeyringBindingSync, parseEncryptedEnvelope, probeSecretTool, readStoredAuthState, resetCredentialStorageState, resolveKeyProvider, scrubEncryptedCredentials, setKeyProviderFactoryForTesting, setKeyringEntryFactory, setLinuxSecretToolRunner, setMacSecurityCommandRunner, setNpmRunner, validateProfileName } from './chunk-Q5KVZMHK.mjs';
3
3
  import './chunk-VAZEJK55.mjs';
4
4
 
5
5
  createRequire(import.meta.url || (typeof __filename === "string" ? __filename : "/"));