Migrate primary to labeled path, remove all flat-path fallback logic
This commit is contained in:
@@ -127,15 +127,6 @@ def list_google_accounts() -> str:
|
||||
accounts[label] = val.get('email', s['Name'])
|
||||
except Exception:
|
||||
accounts[label] = s['Name']
|
||||
# Also check flat path as 'primary' if not already in labeled list
|
||||
if 'primary' not in accounts:
|
||||
flat = f'agent-claw/google-credentials/{safe_actor_id}'
|
||||
try:
|
||||
import json as _json2
|
||||
val = _json2.loads(sm.get_secret_value(SecretId=flat)['SecretString'])
|
||||
accounts['primary'] = val.get('email', flat)
|
||||
except Exception:
|
||||
pass
|
||||
if accounts:
|
||||
parts = [f'{label} ({email})' for label, email in accounts.items()]
|
||||
return 'Connected Google accounts: ' + ', '.join(parts)
|
||||
|
||||
Reference in New Issue
Block a user