PRO-1042: preserve opaque MCP credentials - #2
Conversation
richard-lua
left a comment
There was a problem hiding this comment.
Code review — LOW risk
Documentation- and test-only change: adds parametrized tests proving legacy (lk_...) and dotted typed (api_...) credentials pass through resolveApiKey and the Authorization header unchanged, and rewrites README/llms-install guidance to stop instructing users to paste secrets into a model conversation. No source logic changes; the new tests match the existing behavior in src/auth.mjs and src/api-client.mjs. Safe to merge.
The doc change to LUA_API_KEY: "${env:LUA_API_KEY}" and the "never paste a credential into an MCP request or model conversation" guidance are a genuine improvement to the install instructions' security posture.
Minor
tests/api-client.test.mjs:49— The newtest.eachassignsprocess.env.LUA_API_KEYin the test body and depends on the suiteafterEachto clean up. This works today but is slightly fragile versus thebeforeEachconvention used elsewhere. Optionally capture/restore the original value within the test.tests/auth.test.mjs:153— The typed fixture exercises.,_,-but nothing that starts with{, so the credentials-file tier's JSON-detection branch (raw.startsWith('{')) is not exercised for an opaque value. Consider adding a brace-leading fixture to lock in that such a credential is not silently JSON-parsed.
No security or correctness issues found.
PR Risk Reviewer — automated senior review of 6073f26 · risk: low · confidence: 0.90
|
Review follow-up on the current head:\n- Removed the unsupported Cline environment interpolation example; Cline treats it literally. The copy-paste-safe config now relies on lua auth configure and the global credentials file.\n- Updated the new legacy fixtures to the actual supported non-dotted api_<32 hex> form.\n- Source precedence and runtime behavior remain unchanged; full Jest and build are green.\n\nCurrent head: b17bcb2. |
Summary
Verification
Base: c815499