fix: Properly handle comma-separated auth vars in key-request.sh (#1083)

* fix: Properly handle comma-separated auth vars in key-request.sh

The tr command was incorrectly translating each character in '+,' to newline,
causing "ALIYUN_ACCESS_KEY_ID, ALIYUN_ACCESS_KEY_SECRET" to not be split properly.

Also updated get_cloud_env_vars to split on both + and , separators.

Fixes the error: "ALIYUN_ACCESS_KEY_ID, ALIYUN_ACCESS_KEY_SECRET: invalid variable name"

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* fix: Revert sed to tr for macOS bash 3.x compatibility

As requested in security review - BSD sed treats \n in replacement
as literal backslash-n, not newline. tr already handles both + and ,
delimiters correctly on all platforms.

Addresses security review feedback.

---------

Co-authored-by: Spawn QA Bot <qa-bot@openrouter.ai>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-authored-by: Spawn Refactor Service <refactor@spawn.service>
This commit is contained in:
A 2026-02-14 02:10:11 -08:00 committed by GitHub
parent 4d67d08487
commit 0bb085214a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -29,7 +29,7 @@ m = json.load(open(sys.argv[1]))
auth = m.get('clouds', {}).get(sys.argv[2], {}).get('auth', '')
if re.search(r'\b(login|configure|setup)\b', auth, re.I):
sys.exit(0)
for var in re.split(r'\s*\+\s*', auth):
for var in re.split(r'\s*[+,]\s*', auth):
v = var.strip()
if v:
print(v)