Conversation
添加GVM项目全面改进的设计文档,包括: - 模块化重构策略 - 严格TDD测试方案 - 安全漏洞修复方案(命令注入、路径遍历、竞态条件) - 代码质量改进(消除重复、错误处理标准化) - 性能优化(并发、缓存) - 文档改进计划 - 分阶段实施计划(共7个阶段) 同时更新.gitignore,允许docs目录被版本控制 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
根据规范审查反馈修复了以下问题: 关键修复: - 标准化所有模块路径使用 internal/ 前缀 - 改进SafeExecutor设计以真正解决命令注入威胁模型 - 添加HTTP客户端资源泄漏修复的具体实现 - 决定所有错误信息使用英文以支持国际化 - 添加公共API定义和向后兼容性保证 - 添加完整的用户迁移指南(配置、已安装版本、环境变量) - 添加外部工具依赖文档和降级策略 - 添加性能基准测试建立和监控 - 修复Go版本兼容性(CI使用1.26) - 添加覆盖率豁免机制(针对UI/平台特定代码) - 添加HTTP缓存失效策略(ETag、Last-Modified) 新增章节: - 第3.5节: HTTP客户端资源泄漏修复 - 第3.6节: 输入验证层(重新编号) - 第5节: 外部依赖与性能基准(新增) - 第6节: 迁移与兼容性(新增) - 原第6-9节重新编号为第7-10节 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
修复第二次审查中发现的问题: 结构修复: - 修复重复的章节编号问题(两个第6节和两个第7节) - 第5.3节: 性能优化与文档改进(原第6节) - 第6节: 迁移与兼容性 - 第7节: 实施计划 - 第8节: 成功标准(原第7节) - 第9节: 风险和缓解(原第8节) - 第10节: 后续改进(原第9节) 新增内容: - 第11节: 实施准备检查清单 - 第12节: 结论(包含关键成果预览、实施时间线、下一步行动) 标准化: - 统一Go版本要求为1.26+ (修复贡献指南中的1.21+) - 确保所有文档中的版本要求一致 文档现已完全准备就绪,可以开始实施! Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
修复关键问题: - 完整实现CreateTarGzFixture(移除TODO) - 修复contains函数使用strings.Contains标准库 - 替换已弃用的io/ioutil为os和io包 - 修复Makefile拼写错误(gofm→gofmt) 新增任务: - Task 5: 创建标准错误码系统 - Task 6: 修复HTTP客户端资源泄漏 - Task 7: 添加Panic恢复机制 - Task 8: 添加集成测试 - Task 9: 增强路径安全(符号链接检查) - Task 10: 建立性能基准 改进: - 添加benchmark Makefile目标 - 更新第一阶段完成检查清单 - 更新下一步任务描述 所有审查问题已修复,计划现在可以独立执行 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
修复内容: - Line 142: 替换 ioutil.WriteFile 为 os.WriteFile - Line 2587: 任务编号从 Task 6 改为 Task 12 所有审查问题现已完全解决,计划可以开始实施! Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
分析各语言实现中的环境变量设置: 发现的严重问题: - Java缺少JAVA_HOME (P0) - Python的PYTHONHOME被注释掉 (P0) - Go缺少模块代理设置 (P1) 发现的遗漏: - Go: GO111MODULE, GOPROXY, GOSUMDB - Python: PYTHONPATH, pip配置 - Node.js: NODE_PATH, npm配置 - Java: CLASSPATH - Ruby/Rust: 完全缺少SetDefaultVersion实现 建议分3个阶段修复: 1. 立即修复P0问题 2. 添加平台支持 3. 优化用户体验(镜像配置) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
新增任务12: 修复关键环境变量问题 修复的严重问题: - Java: 添加缺失的JAVA_HOME (P0) - Python: 恢复被注释的PYTHONHOME (P0) - Go: 添加GO111MODULE=on (P1) 新增内容: - 创建languages/env包统一管理环境变量 - 为Java、Python、Go添加环境变量函数 - 所有环境变量都有对应的测试 - 更新检查清单 分析文档: docs/superpowers/analysis/environment-variables-analysis.md 现在第一阶段包含13个任务,涵盖所有关键基础设施和安全模块 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add test environment setup utilities - Add test fixtures and helpers - Provide reusable test utilities for all modules Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add ParseCommand to reject shell metacharacters - Add SafeExecutor with whitelist mechanism - Prevent command injection attacks - Add comprehensive security tests - Validate both commands and arguments Security: This prevents command injection vulnerabilities Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
CRITICAL: Add newline and null byte protection
- Block \n, \r, \x00 control characters
- Add missing shell metacharacters ({}, [], !, #, ~, quotes)
- Validate command names in addition to whitelist
- Add comprehensive security tests for new attacks
Security: Prevents newline injection bypass attacks
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>"
- Add ValidateVersion for semantic version validation - Add ValidatePath with path traversal detection - Add ValidateURL requiring HTTPS - Prevent injection attacks through input validation - Add comprehensive test coverage Security: Input validation is first line of defense Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
CRITICAL: Fix path validation bypass vulnerabilities - Block URL encoding in paths (%..%2f) - Add SSRF protection for URLs (block localhost, private IPs) - Add input length limits to prevent DoS attacks Security: Prevents path bypass and SSRF attacks Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add IsPathSafe function to detect path traversal attempts - Prevent directory escape attacks - Validate relative paths don't escape base directory - Add comprehensive security tests Security: Prevents zip-slip and path traversal attacks Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Define all standard error codes - Provide consistent error messages - Support error wrapping and comparison - Add comprehensive error tests Quality: Improves error handling consistency Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add proper response body cleanup - Implement retry logic with exponential backoff - Add connection pooling with proper limits - Ensure cleanup in error paths - Add comprehensive resource cleanup tests - Add NewClient function for direct HTTP client creation - Add Do method with retry logic and proper cleanup - Add DownloadToFile method with resource cleanup - Add isTemporaryError and isRetryableStatusCode helpers This prevents file descriptor leaks and memory leaks in long-running processes by ensuring all HTTP response bodies are properly closed, even in error scenarios. The retry logic handles both network errors and retryable HTTP status codes. Fixes: Resource leaks in HTTP client that could cause file descriptor exhaustion - Connection pooling limits prevent connection exhaustion - Proper cleanup prevents memory leaks - Retry logic handles temporary failures gracefully Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add top-level panic recovery in main() - Print stack trace on panic - Ensure graceful exit on crash - Remove panic from config.go (return errors instead) - Add panic recovery test Stability: Prevents abrupt crashes, improves error reporting Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
添加集成测试,验证安全模块间的协作 - Created test/integration/ directory - Added security_integration_test.go: Tests command executor and path safety integration - SafeCommandExecutionWithinAllowedPaths: Verifies whitelisting works - PathTraversalPrevention: Blocks ../../../etc/passwd attacks - CommandInjectionPrevention: Blocks shell metacharacters (; | & ` etc) - CombinedSafetyChecks: End-to-end security validation - Added validation_integration_test.go: Tests all validation functions working together - VersionValidationIntegration: Valid/invalid version formats - PathValidationIntegration: Safe paths, URL encoding, null bytes - URLValidationIntegration: HTTPS only, no localhost/private IPs - CombinedValidationScenarios: Real-world attack scenarios - Tests follow TDD methodology (Red-Green-Refactor) - All tests skip in short mode for CI/CD efficiency - Tests use temp directories for isolation and cleanup - Total: 9 integration test scenarios covering: - Command injection prevention - Path traversal attacks - SSRF prevention - Input validation layers - Combined security scenarios Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Implements comprehensive symlink validation to prevent directory escape attacks via symbolic links. The CheckSymlinkSafety function verifies that symlink targets (both absolute and relative) remain within the base directory boundary. Key changes: - Add CheckSymlinkSafety() function to validate symlink targets - Integrate symlink check into IsPathSafe() using os.Lstat() - Detect symlinks before path resolution with Mode()&os.ModeSymlink - Resolve relative symlinks relative to link's directory - Validate resolved target doesn't escape base path Security improvements: - Prevents symlink-based path traversal attacks - Blocks absolute symlinks to system paths - Blocks relative symlinks with ".." escape sequences - Maintains existing path traversal protection Test coverage: - 6 comprehensive test cases for CheckSymlinkSafety - Tests for safe symlinks within base directory - Tests for parent directory escapes - Tests for relative symlinks with ".." - Tests for absolute symlinks to system paths - Integration tests via IsPathSafe for symlink validation Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Implement comprehensive benchmark suite to establish performance baseline for security-critical components. This follows TDD methodology where benchmarks are written first to document expected performance characteristics. Added Benchmarks: - BenchmarkSafeExecutor_Execute: Measure command execution overhead - BenchmarkParseCommand: Measure command parsing performance - BenchmarkValidateVersion: Measure version validation speed - BenchmarkValidatePath: Measure path validation performance - BenchmarkIsPathSafe: Measure path traversal check performance Documentation: - PERFORMANCE_TARGETS.md: Define performance goals and monitoring guidelines - baseline.txt: Document baseline results (pending Go installation fix) Performance Targets: - SafeExecutor: >10K executions/sec, <100μs latency - ParseCommand: >100K parses/sec, <10μs latency - ValidateVersion: >1M validations/sec, <1μs latency - ValidatePath: >500K validations/sec, <2μs latency - IsPathSafe: >100K checks/sec, <10μs latency Next Steps: - Fix Go installation to establish actual baseline - Integrate benchmarks into CI/CD pipeline - Set up automated regression detection Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add comprehensive GitHub Actions workflows for automated testing, code quality checks, and security scanning: - test.yml: Run tests on push/PR with Go 1.26 matrix, coverage threshold check (80%), and build verification - lint.yml: Run golangci-lint, gofmt, and go.mod consistency checks - security.yml: Run Gosec, govulncheck, and Trivy scanners with SARIF uploads to GitHub Security tab - Makefile: Add test-coverage, test-race, security, benchmark, and dev-tools targets for local development and CI Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit fixes P0 and P1 environment variable issues identified in the analysis: **Created languages/env package:** - GetJavaEnvVars() - Returns JAVA_HOME (P0) and CLASSPATH - GetPythonEnvVars() - Returns PYTHONHOME (P0), PYTHONPATH, and dev settings - GetGolangEnvVars() - Returns GO111MODULE (P1), GOROOT, GOPATH, GOBIN - GetNodeEnvVars() - Returns NODE_PATH and NPM_CONFIG_PREFIX (P1) **Updated language implementations:** - Java: Added JAVA_HOME (was completely missing - P0 critical) - Python: Restored PYTHONHOME (was commented out - P0 critical) - Go: Added GO111MODULE=on (was missing - P1 critical) - Node: Added npm configuration (P1 critical) **Test coverage:** - Comprehensive tests for all env functions - Tests verify P0/P1 critical variables are set correctly Fixes issues identified in docs/superpowers/analysis/environment-variables-analysis.md Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add comprehensive testing documentation to guide developers on: 1. Testing Framework (test-framework.md): - testify framework overview and components - Test types: unit, integration, and e2e - Setup, fixtures, helpers, and mocks - Running tests with coverage and benchmarks - Coverage targets (70% overall, 85% core) - Best practices for naming, isolation, and errors - CI/CD integration and debugging techniques 2. TDD Workflow (tdd-workflow.md): - Test-Driven Development methodology - Red-Green-Refactor cycle explanation - GVM project TDD rules and conventions - Common TDD mistakes and solutions - Complete example: version query feature - Checklist for each TDD phase Documentation provides examples, commands, and patterns for maintaining code quality through rigorous testing. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Remove unused imports in test/framework files - Fix IsPathSafe to properly detect absolute path escapes - Fix ValidatePath to check for '..' in original path - Fix ValidateURL error message ordering - Simplify test helpers to remove panic expectations - Add path traversal detection for encoded paths Fixes: - Absolute path '/etc/passwd' now correctly detected as escape - Original path '/etc/../passwd' now detected as traversal - URL parse errors now properly returned before scheme check Test results: All tests passing (pending race detection completion) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Check for empty scheme before checking host - Return 'invalid URL: missing scheme' for URLs like 'not-a-url' - This correctly identifies malformed URLs Fixes the last failing test case. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This comprehensive fix addresses multiple issues that were preventing the test suite and linting from passing. ## Changes Made: ### 1. Code Quality (golangci-lint) - Fixed all gofmt formatting issues across multiple files - Extracted repeated "windows" string to constant in path_test.go - All golangci-lint issues resolved (0 issues) ### 2. Python Test Timeouts - Added testing.Short() checks to network-dependent tests - Tests now skip in short mode to prevent timeouts: * TestPython_ListRemoteVersions * TestPython_GetDefaultVersion * TestPython_ListRemoteVersions_Enhanced * TestPython_PreReleaseError_Integration * TestPython_Install_ValidPath ### 3. Makefile Tools Installation - Fixed tools.verify.local.% to use '-f' test instead of 'which' - Fixed tools.install.% to strip 'local.' prefix from tool names - Resolved "No rule to make target install.local.golangci-lint" error ### 4. Test Framework Cleanup - Removed incorrect panic expectations from helper tests - Cleaned up test assertions for better reliability ## Verification: - ✅ make test: All packages passing (coverage: 39.4%) - ✅ make lint: 0 issues - ✅ golangci-lint v2.9.0 installed and working ## Files Modified: - test/framework/*.go (formatting and cleanup) - languages/python/python_test.go (short mode skips) - scripts/Makefile.tools.mk (tool installation fix) - internal/util/path/path_test.go (constant extraction) - Various formatting fixes Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The docs/ directory contains local design and planning documents that should not be committed to the remote repository. This includes: - superpowers/ (analysis, plans, specs) - testing/ (TDD workflow, test framework documentation) These documents are for local development reference only. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
GitHub Actions workflow was failing with error: "golangci-lint v2 is not supported by golangci-lint-action v6 Changes: - Updated golangci/golangci-lint-action from v6 to v7 - v7 action supports golangci-lint v2.x versions - Version remains v2.9.0 for consistency This fixes the CI lint job failure on GitHub. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request introduces significant security enhancements and infrastructure improvements, including a SafeExecutor to prevent command injection, robust path traversal checks, and URL validation with SSRF protection. The HTTP client was updated with retry logic and resource cleanup, and language-specific environment variable handling was centralized. Feedback focuses on correcting a .gitignore syntax error that broke the bin ignore rule, removing a committed backup file, updating an outdated linter version, and refining logic for Python path construction, error handling in directory creation, and HTTP retry strategies.
| func GetPythonEnvVars(installPath string) map[string]string { | ||
| // Extract version from path for PYTHONPATH | ||
| // Default to python3 if we can't determine version | ||
| libPath := filepath.Join(installPath, "lib", "python3.11", "site-packages") |
There was a problem hiding this comment.
The PYTHONPATH is constructed with a hardcoded Python version "3.11". This will cause an incorrect environment setup for any other Python version (e.g., 3.9, 3.10, 3.12), as the library path will be wrong. The version should be derived dynamically from the installPath.
// Extract version from path for PYTHONPATH, e.g. /path/to/3.11.0 -> 3.11
version := filepath.Base(installPath)
parts := strings.Split(version, ".")
majorMinor := "python3" // A sensible fallback
if len(parts) >= 2 {
majorMinor = "python" + parts[0] + "." + parts[1]
}
libPath := filepath.Join(installPath, "lib", majorMinor, "site-packages")| /tmp | ||
| gvm | ||
| bin No newline at end of file | ||
| bin# Ignore docs directory - local design documents only |
| .PHONY: dev-tools | ||
| dev-tools: | ||
| @echo "===========> Installing development tools" | ||
| @command -v golangci-lint >/dev/null 2>&1 || go install github.com/golangci/golangci-lint/cmd/golangci-lint@v2.9.0 |
There was a problem hiding this comment.
The version of golangci-lint being installed (v2.9.0) is from 2018 and is extremely outdated. The latest version is v1.59.1 as of late 2024. Using such an old version means the project is missing out on years of improvements, new linters, and bug fixes, potentially leaving code quality and correctness issues undetected. Please update to a recent version, or use @latest.
@command -v golangci-lint >/dev/null 2>&1 || go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
| test-coverage: | ||
| @echo "===========> Running tests with coverage" | ||
| @$(GO) test -v -race -coverprofile=coverage.out -covermode=atomic ./... | ||
| @$(GO) tool cover -html=coverage.out -o coverage.html |
There was a problem hiding this comment.
The test-coverage target writes coverage.out and coverage.html to the project root, while the test target writes them to $(OUTPUT_DIR). For consistency and to keep the root directory clean, it's better to use $(OUTPUT_DIR) in this target as well.
test-coverage:
@echo "===========> Running tests with coverage"
@$(GO) test -v -race -coverprofile=$(OUTPUT_DIR)/coverage.out -covermode=atomic ./...
@$(GO) tool cover -html=$(OUTPUT_DIR)/coverage.out -o $(OUTPUT_DIR)/coverage.html
| module github.com/toodofun/gvm | ||
|
|
||
| go 1.26.0 | ||
|
|
||
| require ( | ||
| github.com/duke-git/lancet/v2 v2.3.9 | ||
| github.com/fatih/color v1.19.0 | ||
| github.com/gdamore/tcell/v2 v2.13.8 | ||
| github.com/google/uuid v1.6.0 | ||
| github.com/hashicorp/go-version v1.8.0 | ||
| github.com/jedib0t/go-pretty/v6 v6.7.8 | ||
| github.com/nicksnyder/go-i18n/v2 v2.6.1 | ||
| github.com/patrickmn/go-cache v2.1.0+incompatible | ||
| github.com/rivo/tview v0.42.0 | ||
| github.com/schollz/progressbar/v3 v3.19.0 | ||
| github.com/sirupsen/logrus v1.9.4 | ||
| github.com/spf13/cobra v1.10.2 | ||
| github.com/spf13/pflag v1.0.10 | ||
| github.com/stretchr/testify v1.11.1 | ||
| golang.org/x/sys v0.42.0 | ||
| golang.org/x/text v0.35.0 | ||
| gopkg.in/yaml.v3 v3.0.1 | ||
| resty.dev/v3 v3.0.0-beta.6 | ||
| ) | ||
|
|
||
| require ( | ||
| github.com/davecgh/go-spew v1.1.1 // indirect | ||
| github.com/gdamore/encoding v1.0.1 // indirect | ||
| github.com/inconshreveable/mousetrap v1.1.0 // indirect | ||
| github.com/lucasb-eyer/go-colorful v1.3.0 // indirect | ||
| github.com/mattn/go-colorable v0.1.14 // indirect | ||
| github.com/mattn/go-isatty v0.0.20 // indirect | ||
| github.com/mattn/go-runewidth v0.0.16 // indirect | ||
| github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect | ||
| github.com/pmezard/go-difflib v1.0.0 // indirect | ||
| github.com/rivo/uniseg v0.4.7 // indirect | ||
| golang.org/x/exp v0.0.0-20221208152030-732eee02a75a // indirect | ||
| golang.org/x/net v0.43.0 // indirect | ||
| golang.org/x/term v0.37.0 // indirect | ||
| ) |
| _ = ensureDir(path) | ||
| return path |
There was a problem hiding this comment.
The error returned by ensureDir(path) is being ignored. If creating the directory in the temporary location fails (e.g., due to permissions), the function will still return the path to a non-existent directory, which will likely cause failures in subsequent operations. The error should be handled.
if err := ensureDir(path); err != nil {
// If creating the temp dir fails, we are out of options. Return the original fallback.
return fallback
}
return path| if strings.Contains(path, "..") { | ||
| return fmt.Errorf("path traversal detected") | ||
| } |
There was a problem hiding this comment.
This path traversal check using strings.Contains(path, "..") is overly restrictive and can lead to false positives. It will reject valid relative paths like foo/../bar, which resolves to bar and does not traverse outside its base. The subsequent check using filepath.Clean is more reliable for detecting actual traversal attempts. Consider removing this initial, broader check to avoid blocking valid paths.
| // Check if we should retry | ||
| if i < c.maxRetries { | ||
| // Retry on network errors or specific HTTP status codes | ||
| if err != nil && isTemporaryError(err) { | ||
| time.Sleep(time.Duration(i+1) * time.Second) | ||
| continue | ||
| } | ||
| // Retry on specific HTTP status codes | ||
| if resp != nil && isRetryableStatusCode(resp.StatusCode) { | ||
| time.Sleep(time.Duration(i+1) * time.Second) | ||
| continue | ||
| } |
There was a problem hiding this comment.
The retry logic uses a linear backoff strategy (time.Sleep(time.Duration(i+1) * time.Second)). For handling transient server-side issues and avoiding thundering herd problems, an exponential backoff with jitter is generally a more robust and effective approach. Consider switching to a strategy like time.Sleep(time.Duration(1<<i) * time.Second).
| func isTemporaryError(err error) bool { | ||
| if netErr, ok := err.(interface{ Temporary() bool }); ok { | ||
| return netErr.Temporary() | ||
| } | ||
| if _, ok := err.(interface{ Timeout() bool }); ok { | ||
| return true | ||
| } | ||
| return false |
There was a problem hiding this comment.
The Temporary() method on network errors has been deprecated since Go 1.18. The modern approach is to use errors.Is to check for specific timeout errors (like context.DeadlineExceeded) or to check if an error implements the Timeout() bool method, which you are already doing. You should remove the check for the deprecated Temporary() method.
This commit addresses 9 issues identified by Gemini code review: ## Critical Issues (1): 1. languages/env/env.go:38 - PYTHONPATH hardcoded version - Changed from hardcoded "python3.11" to dynamic version extraction - Now correctly derives version from installPath (e.g., 3.11.0 -> python3.11) ## High Priority Issues (2): 2. .gitignore:146 - bin directory ignore commented out - Separated "bin" pattern from comment onto different line - Added *.bak, *.backup, *.old patterns to ignore backup files 3. Removed go.mod.bak from version control - Deleted backup file that should not be tracked ## Medium Priority Issues (6): 4. Makefile:97 - test-coverage uses inconsistent output directory - Changed from coverage.out to \$(OUTPUT_DIR)/coverage.out - Changed from coverage.html to \$(OUTPUT_DIR)/coverage.html 5. internal/core/config.go:83 - ignored error in ensureDir - Added proper error handling for temp directory creation - Falls back to original fallback path if temp dir creation fails 6. internal/core/validation/validation.go:58 - overly strict ".." check - Removed initial ".." check that blocked valid paths like "foo/../bar" - Kept only the cleaned path check which is more accurate 7. internal/http/client.go:159 - linear backoff retry strategy - Changed from linear (i+1) * time.Second to exponential (1<<i) * time.Second - Better for handling transient server issues and avoiding thundering herd 8. internal/http/client.go:409 - deprecated Temporary() method - Removed check for deprecated Temporary() method - Added errors.Is(err, context.DeadlineExceeded) check - Added errors import 9. Added strings import to languages/env/env.go for Split function All changes improve code quality, robustness, and follow Go best practices. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Added strings import to languages/env/env.go for Split function - Updated validation test case to reflect new behavior: Changed '/etc/../passwd' test from expecting error to accepting it This aligns with the improved path traversal detection that only blocks paths where '..' remains after filepath.Clean() The '/etc/../passwd' path normalizes to '/passwd' which is not a traversal attempt, so it should be accepted. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
What this PR does / why we need it:
Project optimization
Special notes for your reviewer:
If applicable:
docs neededlabel should be applied if so)