Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 19, 2026

Addresses 18 unresolved review comments on PR #136 covering thread safety, output handling, AWS spec compliance, and example security.

Core Code Fixes

Thread safety: Added sync.RWMutex to VDB client token cache with double-checked locking pattern. Token refresh buffer increased to 3 minutes.

AWS SigV4 compliance: Canonical request now includes query string component per AWS spec:

canonicalRequest := fmt.Sprintf("%s\n%s\n%s\n%s\n%s\n%s",
    req.Method,
    path,
    canonicalQueryString,  // Was missing
    canonicalHeaders,
    signedHeaders,
    payloadHash,
)

Output separation: Informational messages now write to stderr when --output json is used, keeping stdout clean for piping.

Variable scoping: Moved vdbLimit and vdbOffset from global to per-command locals to prevent flag interference between commands.

Error handling: Fixed ignored json.Unmarshal error in CVE data parsing. Extracted pagination logic into buildPaginationQuery() helper.

Example & Documentation Security

Secrets handling: Troubleshooting now checks credential existence without printing values. Config example uses REPLACE_WITH_YOUR_SECRET_KEY placeholder instead of zeros.

CI/CD hardening:

  • Added SHA-256 checksum verification for binary downloads
  • Fixed command substitution error handling (if ! cmd=$(...) pattern)
  • Added error handling after jq parsing
  • Fixed GitHub Actions conditionals from numeric to string comparison (!= '0' instead of > 0)

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits January 19, 2026 11:15
- Add mutex for thread safety in VDB client
- Increase token validation buffer from 1 to 3 minutes
- Fix AWS SigV4 canonical request format (add query string component)
- Handle json.Unmarshal error in api.go
- Extract pagination logic into helper function
- Fix stdout/stderr for JSON output mode (5 locations)
- Scope vdbLimit and vdbOffset variables to commands

Co-authored-by: 0x73746F66 <93355168+0x73746F66@users.noreply.github.com>
- Update secret key placeholder in config example
- Fix troubleshooting section to not print secrets
- Add error handling for command substitution in CI script
- Add checksum verification for binary download in GitHub Action
- Fix GitHub Actions conditional expression syntax
- Add error handling after jq commands

Co-authored-by: 0x73746F66 <93355168+0x73746F66@users.noreply.github.com>
Copilot AI changed the title [WIP] Implement VDB subcommand for Vulnerability Database API fix: address code quality and security issues from PR review Jan 19, 2026
Copilot AI requested a review from 0x73746F66 January 19, 2026 11:18
@0x73746F66 0x73746F66 marked this pull request as ready for review January 19, 2026 11:28
@0x73746F66 0x73746F66 merged commit 2d3dc7d into claude/design-vdb-subcommand-HXhlM Jan 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants