@ducking-mind/proxy-app-cli 0.1.1 → 0.2.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.
@@ -31,9 +31,9 @@ function credentialAccount({ baseURL, portalURL, appID, projectPath, purpose })
31
31
  const identity = [
32
32
  normalizeURL(baseURL), normalizeURL(portalURL || baseURL), appID.trim(), project,
33
33
  ]
34
- // Keep existing runtime cache identities intact. Developer authorization is
35
- // a separate capability and must survive an app user's logout/account switch.
36
- if (purpose === 'development') identity.push('development')
34
+ // Deliberately isolate developer authorization from any older runtime
35
+ // credential entries that may remain in the OS keychain.
36
+ identity.push('development')
37
37
  return createHash('sha256').update(JSON.stringify(identity)).digest('hex')
38
38
  }
39
39
 
@@ -92,13 +92,13 @@ function runSecurityCommand(file, args, { input = '', timeoutMs }) {
92
92
  */
93
93
  export function createLocalCredentialStore({
94
94
  baseURL, portalURL = '', appID, projectPath,
95
- purpose = 'runtime',
95
+ purpose = 'development',
96
96
  platform = process.platform,
97
97
  runCommand = runSecurityCommand,
98
98
  timeoutMs = TIMEOUT_MS,
99
99
  stateDirectory = join(homedir(), 'Library', 'Caches', 'proxy-app', 'credentials'),
100
100
  }) {
101
- if (!['runtime', 'development'].includes(purpose)) throw new Error('未知的授权缓存用途。')
101
+ if (purpose !== 'development') throw new Error('本地凭证缓存只支持开发者授权。')
102
102
  const account = credentialAccount({ baseURL, portalURL, appID, projectPath, purpose })
103
103
  const markerPath = join(stateDirectory, account + '.disabled')
104
104
  const boundedTimeout = Number.isFinite(timeoutMs) ? Math.max(1, Math.min(timeoutMs, TIMEOUT_MS)) : TIMEOUT_MS