Repository navigation
Conversation
decryptToken accepted a truncated GCM tag (down to 4 bytes) because createDecipheriv was called without authTagLength, so a prefix of a valid tag still verified. Require exactly 16 bytes, which is what encryptToken has always written, so existing credential files keep working. Also apply the safe subset of ESLint autofixes surfaced while tuning the repo's Codacy configuration (unused imports, nullish defaults, typed catch params), add .codacy.yaml so Cloud ESLint stops failing to parse .changeset/changelog.test.ts and skips test files, and drop the legacy .codacy/codacy.yaml from the old Codacy CLI. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | -4 |
| Duplication | 0 |
AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.
TIP This summary will be updated as you push new changes.
There was a problem hiding this comment.
Pull Request Overview
✅ No blocking issues noticed
No blocking findings were identified.
Codacy also found:
- No new static-analysis or duplication issues.
- Two issues were fixed.
- Diff coverage was not reported because coverage requirements were missing.
Test suggestions
- Decrypting a credential with a truncated authentication tag is rejected.
- A newly encrypted token uses a full 16-byte tag and round-trips through decryption.
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. A newly encrypted token uses a full 16-byte tag and round-trips through decryption.
Make this review better
TIP Add a ticket key to the branch or title so the reviewer can check the PR against it. Or tell us which ticket tracker you use here.
TIP How was this review? Give us feedback
Addresses the Codacy AI review test suggestion on #67. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Collaborator
Author
|
Addressed the Codacy review's missing test suggestion: added 🤖 Generated by /pr-fixup command |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
decryptTokencalledcreateDecipherivwithoutauthTagLength, so Node accepted a truncated tag (down to 4 bytes) and a prefix of a valid tag still verified (Semgrepgcm-no-tag-length). It now rejects any tag that isn't exactly 16 bytes.encryptTokenhas always written 16-byte tags, so existing~/.codacy/credentialsfiles keep working. A new test checks that a truncated tag is rejected.IgnoreSRMItemBody,colorByGate,File), used??/?./??=where the left side is nullish rather than falsy, typed acatchparam asunknown, and marked promise-returning helpersasync. These don't change behavior. Unsafe suggestions were rejected:any→unknown, removing?.on generated API types, and||→??on display strings where""must fall through..codacy.yaml(new): excludes test files,src/test-support.tsand.changeset/**from ESLint 9, and generated or boilerplate Markdown from markdownlint. The.changeset/**exclusion fixes a Cloud ESLint failure: it couldn't parse.changeset/changelog.test.tswithparserOptions.project, becausetsconfig.jsondoesn't include dot-folders. That's probably why Cloud ESLint has been reporting 0 issues. Codacy only reads this file from the default branch..codacy/codacy.yaml(old Codacy CLI v1 tool pins), which is now replaced by the Cloud/local config. Also wraps the URL inAGENTS.mdin<>to satisfy markdownlint MD034.Test plan
npx tsc --noEmitnpm test(824 passing, including the newshould reject a truncated auth tag)codacy repository --reanalyze) and confirm ESLint 9 no longer reports the.changeset/changelog.test.tsparse error🤖 Generated with Claude Code