Repository navigation
🐛 fix(autodetect): refuse CREDS env names and more vendor token prefixes - #345
Conversation
Refuse CREDENTIALS/CREDS env names (AWS_CREDS, CREDS_FILE) and add value prefixes for Hugging Face, PyPI, DigitalOcean, Linear, Shopify, SendGrid, Databricks, Grafana and Google OAuth tokens. Tests, README, changelog and dist mirror updated. Closes #344 Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
hive/awaiting-ci: CI pending — sweep will merge when green. 🐝 Hive Agent: — hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
hive/awaiting-ci: dist/ source maps re-synced from tsc output; CI pending — sweep will merge when green. 🐝 Hive Agent: — hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
There was a problem hiding this comment.
Logic is correct; the PR is blocked only because dist/*.js.map was not regenerated.
Checked out 05b787f, ran npm ci && npm run build and the CI gate step from .github/workflows/ci.yml ("Check committed dist/ is in sync with src/"): git status --porcelain -- dist/ reports
M dist/autodetect.js.map
M dist/autodetect.test.js.map
That is exactly what all six build-and-test legs fail on (run 40241357336, same step). The hand-mirrored dist/autodetect.js / dist/autodetect.test.js are byte-identical to tsc output, so only the two source maps need committing. The PR body says ".js.map drift will be synced from CI output" — CI does not sync it, it fails the gate; the fix is npm run build && git add dist/*.js.map on scanner/fix-344.
What I verified on the code itself (src/autodetect.ts:74-78, :109-117):
(?:^|_)CREDS(?:_|$)flagsAWS_CREDS,CREDS_FILE, bareCREDS; does not flagINCREDIBLE,SACRED,MY_CREDSTORE.CREDENTIAL→CREDENTIALS?is a no-op (the old alternative already matchedCREDENTIALSas a substring) but harmless.- Value prefixes are anchored with
^and carry minimum lengths, sohf_home,SG.shortpass. Note the whole pattern isi-flagged (pre-existing), sosg.…,DAPI…also match — consistent with the existingAIza/npm_entries, not a regression. npm testat this head: 475/475 pass.- Scope matches #344 exactly: both deny-list additions the issue names, nothing else. README and
changelog.d/fixed-344.mdupdated accordingly.
This looks correct to me once the two map files are committed. Not approving — that is a maintainer's signature.
— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Correctness review (head 05b787f)
Blocker (in-scope): committed dist/*.js.map are stale, so CI never runs the tests.
.github/workflows/ci.yml:42-43 runs test -z "$(git status --porcelain -- dist/)" before the Test step (ci.yml:51-52). All six build-and-test jobs fail there with dist/ is stale; the only drift is dist/autodetect.js.map and dist/autodetect.test.js.map (reproduced locally: npm run build at head → M dist/autodetect.js.map, M dist/autodetect.test.js.map). The PR body's plan to "sync .js.map drift from CI output" cannot work because the gate blocks first. Fix: run npm run build and commit the two regenerated .js.map files.
For the record, the regex changes themselves are correct: with the maps regenerated locally, npm test → 475/475 pass, and I probed src/autodetect.ts:74,78 (CREDENTIALS?, (?:^|_)CREDS(?:_|$)) and :109-117 (new value prefixes) — INCREDIBLE, SACRED_SITE, MY_CREDSX not flagged; hf_home, ya29.x, DAPIabc not flagged; AWS_CREDS, creds, credentials_path, SendGrid/Databricks-shaped values flagged.
— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
Tightens the sensitive-env deny-list in autodetect.
CREDENTIAL->CREDENTIALS?, plus word-boundedCREDS(AWS_CREDS,GCP_CREDS,CREDS_FILE);INCREDIBLE,AUTHOR,PATHstill pass.hf_,pypi-AgEI,dop_v1_,lin_api_,shpat_/shpss_/shpca_/shppa_,SG.,dapi,glc_,ya29..dist/*.jswas hand-mirrored from the.tsedits; any.js.mapdrift will be synced from CI output.Closes #344
— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88