2.6 KiB
2.6 KiB
Plan
Goals
- Replace all
axiosusage withnativeRequestfromutils/http.js - Remove outbound telemetry/spying requests while keeping functional analytics (auth flows + GrowthBook feature flags)
- Do a quick security pass to remove obvious vulnerabilities and risky network behaviors
Current Status
- Completed axios → nativeRequest conversions:
services/mcp/officialRegistry.tsservices/mcp/claudeai.tsservices/oauth/getOauthProfile.ts
- In progress:
services/settingsSync/index.ts(axios import removed; remaining axios calls + error classification need conversion)
Next Steps (Axios Removal)
- Fix
services/settingsSync/index.ts- Replace
classifyAxiosErrorimport withclassifyHttpErrorfromutils/errors.js - Replace
axios.get(..., validateStatus: 200|404)withnativeRequest+try/catchhandling forHttpError404 - Replace
axios.put(...)withnativeRequest(method: 'PUT', JSON body)
- Replace
- Convert
services/oauth/client.ts- Replace
axios.post/getwithnativeRequest - Replace
axios.isAxiosErrorhandling withisHttpError - Preserve analytics events but ensure no tokens/PII are logged
- Replace
- Convert
services/policyLimits/index.ts- Replace
classifyAxiosErrorwithclassifyHttpError - Replace
axios.get(... validateStatus: 200|304|404)withnativeRequest+try/catchhandling forHttpErrorstatuses - Preserve existing caching semantics (304 means cache valid; 404 means empty restrictions)
- Replace
- Convert
services/remoteManagedSettings/index.ts(same pattern as policy limits, plus 204/304/404 handling) - Convert remaining axios users (transports, bridge, installers, feedback, etc.)
Telemetry / “Spying” Removal
- Search for outbound tracking endpoints and SDKs (events, crash reporting, session replay, fingerprinting)
- Remove or gate non-essential outbound calls behind “essential traffic only” where appropriate
- Keep:
- OAuth/auth network flows required for functionality
- GrowthBook feature flag fetches required for feature gating
Security Pass (Quick Wins)
- Ensure no secrets/tokens are logged or included in analytics payloads
- Validate any places that build URLs/headers from user input to prevent SSRF or header injection
- Enforce timeouts on outbound requests and avoid overly permissive redirects
- Verify files written to disk use safe permissions (e.g.
0o600for sensitive caches) and safe paths
Verification
- Run the repo’s lint/typecheck commands
- Run test suite (or targeted tests) for settings sync / oauth client flows if present