-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Release: Nightly -> Demo (build.cloudflare.dev) #295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Feat: Auth via ticketing for Websocket
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Fix: SDK functionalities addition + Auth redesign
|
Claude finished @AshishKumar4's task in 2m 2s —— View job Code Quality & Security Review (Critical Path)Recommendation: APPROVE PR SummaryThis release introduces WebSocket ticket-based authentication for SDK usage, enabling secure connections from non-browser environments. It includes SDK improvements for native WebSocket support (Node 22+), comprehensive documentation, and enhanced test infrastructure. PR Description
Addressed Issues
Security AnalysisTicket Authentication SystemReviewed Files:
Authentication FlowPositive Findings:
No Critical Issues Found Code Quality
MediumConsole.log in production code ( console.log('requirement', requirement, 'for user', user);This appears to be debug logging that should be removed or converted to structured logging. Low
SDK Changes Review
Testing
Recommended manual testing:
Final RecommendationAPPROVE - This PR implements a well-designed ticket authentication system with proper security controls:
The only actionable item is removing the debug |
Summary
This release introduces WebSocket ticket-based authentication for the SDK, enabling secure, token-free WebSocket connections from non-browser environments. It also includes SDK improvements for better runtime compatibility, comprehensive documentation updates, and test infrastructure enhancements.
Changes
Authentication System
worker/middleware/auth/ticketAuth.ts)POST /api/ws-ticket) for generating short-lived, single-use ticketsWsTicketManagerutility for in-memory ticket storage with automatic expirationrouteAuth.tsmiddleware as an alternative to JWT auth for WebSocket connectionsCodingAgentControllerto support dual auth strategies (ticket vs JWT)SDK Improvements
getWsTicket()method to HttpClient for ticket-based WebSocket authBuildSession.connect()to fetch fresh tickets on connect/reconnectTesting
sdk/test/test-server.ts) using Miniflareminiflare,wrangler,@cloudflare/workers-typesDocumentation
Motivation
The SDK previously required browser-style WebSocket connections with cookies/headers for authentication. This PR enables SDK usage from server-side environments (CLI tools, automation scripts, Cloudflare Workers) where traditional browser authentication patterns don't work. Tickets provide a secure, short-lived authentication mechanism that doesn't expose long-lived tokens in WebSocket URLs.
Security Considerations
tk_for agents,tkv_for vault)Testing
cd sdk && bun testcd sdk && VIBESDK_INTEGRATION_API_KEY=xxx bun run test:integrationBreaking Changes
@cf-vibesdk/sdk/nodeexport (Node WebSocket factory no longer needed)wspackage moved to optional dependency