diff --git a/CLAUDE.md b/CLAUDE.md index 68911f8..ab12cf4 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -100,7 +100,7 @@ This service supports three authentication methods for different use cases: | **AWS Bedrock** | Enterprise | Enterprise pricing | [Authentication Guide](./docs/claude-authentication-guide.md) | #### Quick Start: Setup Container (Personal/Development) -For Claude Max/20x subscribers wanting to use their subscription for automation: +For Claude Max subscribers (5x or 20x plans) wanting to use their subscription for automation: ```bash # 1. Run interactive authentication setup diff --git a/docs/README.md b/docs/README.md index 560904b..fadd2a7 100644 --- a/docs/README.md +++ b/docs/README.md @@ -7,7 +7,7 @@ Welcome to the Claude GitHub Webhook service documentation! This service enables ### For Developers with Claude Subscriptions **💡 Recommended for personal projects and development** -You can use your existing Claude Max or Claude 20x subscription instead of paying API fees: +You can use your existing Claude Max subscription (5x or 20x plans) instead of paying API fees: 1. **[Setup Container Authentication](./setup-container-guide.md)** - Use your subscription for automation 2. **[Complete Authentication Guide](./claude-authentication-guide.md)** - All authentication methods @@ -27,7 +27,7 @@ You can use your existing Claude Max or Claude 20x subscription instead of payin - **CLI Access**: Direct command-line interface for testing ### Authentication Flexibility -- **Personal**: Use Claude Max/20x subscriptions via setup container +- **Personal**: Use Claude Max subscriptions (5x or 20x plans) via setup container - **Production**: ANTHROPIC_API_KEY for stable production usage - **Enterprise**: AWS Bedrock integration for compliance and scale @@ -69,11 +69,11 @@ You can use your existing Claude Max or Claude 20x subscription instead of payin | Usage Level | Setup Container | API Key | AWS Bedrock | |-------------|-----------------|---------|-------------| -| **Light** (< 1M tokens/month) | Fixed subscription cost | ~$15/month | ~$20/month | -| **Medium** (1-10M tokens/month) | Fixed subscription cost | $150-1500/month | $150-1500/month | -| **Heavy** (10M+ tokens/month) | Fixed subscription cost | $1500+/month | $1500+/month | +| **Light** (< 1M tokens/month) | $100-200/month (Max 5x/20x) | ~$15/month | ~$20/month | +| **Medium** (1-10M tokens/month) | $100-200/month (Max 5x/20x) | $150-1500/month | $150-1500/month | +| **Heavy** (10M+ tokens/month) | $100-200/month (Max 5x/20x) | $1500+/month | $1500+/month | -**💡 Pro Tip**: If you're already paying for Claude Max or Claude 20x subscriptions, the setup container method lets you use your existing subscription for automation at no additional cost! +**💡 Pro Tip**: If you're already paying for Claude Max subscriptions (5x or 20x plans), the setup container method lets you use your existing subscription for automation at no additional cost! ## 🎯 Use Case Recommendations diff --git a/docs/claude-authentication-guide.md b/docs/claude-authentication-guide.md index bab796d..fa0d349 100644 --- a/docs/claude-authentication-guide.md +++ b/docs/claude-authentication-guide.md @@ -14,7 +14,7 @@ This guide covers three authentication methods for using Claude with the webhook ## 🐳 Option 1: Setup Container (Development/Personal) -**Best for:** Developers with Claude Max subscriptions who want to use their existing subscription for automation. Note: Claude Code is not included with Claude Pro plans. +**Best for:** Developers with Claude Max subscriptions (5x or 20x plans) who want to use their existing subscription for automation. Note: Claude Code is not included with Claude Pro plans. ### Advantages - ✅ **Cost-effective**: Use your existing Claude subscription @@ -220,8 +220,12 @@ AWS_PROFILE=your-profile-name ## 📊 Cost Comparison ### Setup Container (Personal/Development) -- **Claude Max**: Fixed monthly subscription cost -- **Claude 20x**: Fixed monthly subscription cost (higher performance) +- **Claude Max 5x**: $100/month (5x Pro usage limits, includes Claude Code) + - ~225 messages every 5 hours for short conversations + - ~50-200 Claude Code prompts every 5 hours +- **Claude Max 20x**: $200/month (20x Pro usage limits, includes Claude Code) + - ~900 messages every 5 hours for short conversations + - ~200-800 Claude Code prompts every 5 hours - **Perfect for**: Individual developers, hobbyists, development workflows ### ANTHROPIC_API_KEY (Production) @@ -292,7 +296,7 @@ AWS_PROFILE=production-claude ## 🎯 Recommendations by Use Case ### Individual Developer -- **Start with**: Setup Container (use your Claude Max subscription) +- **Start with**: Setup Container (use your Claude Max 5x or 20x subscription) - **Upgrade to**: API Key if you need higher stability ### Small Team diff --git a/docs/setup-container-guide.md b/docs/setup-container-guide.md index 9c21def..97b8668 100644 --- a/docs/setup-container-guide.md +++ b/docs/setup-container-guide.md @@ -6,6 +6,8 @@ The setup container method allows Claude Max subscribers to use their existing s Traditional Claude CLI usage requires interactive sessions. This setup container captures the complete authentication state, including OAuth tokens and session data, making it portable to non-interactive environments. +**Note**: Claude Code access is only available with Claude Max subscriptions (5x at $100/month or 20x at $200/month). Claude Pro ($20/month) does not include Claude Code access. + ## How It Works ```mermaid @@ -34,10 +36,10 @@ graph TD ## Architecture Benefits -### For Claude Max/20x Subscribers +### For Claude Max Subscribers (5x or 20x Plans) - **Massive Cost Savings**: Use subscription instead of pay-per-token -- **Full Feature Access**: All subscription benefits (speed, priority) -- **No Usage Anxiety**: Use existing subscription limits +- **Full Feature Access**: All subscription benefits including Claude Code access +- **High Usage Limits**: 5x or 20x more usage than Claude Pro ### Technical Advantages - **OAuth Security**: No API keys in environment variables diff --git a/src/controllers/githubController.ts b/src/controllers/githubController.ts index 1eeb0a2..2d255dc 100644 --- a/src/controllers/githubController.ts +++ b/src/controllers/githubController.ts @@ -114,9 +114,11 @@ export const handleWebhook: WebhookHandler = async (req, res) => { const event = req.headers['x-github-event'] as string; const delivery = req.headers['x-github-delivery'] as string; - // Check if request body exists and has required structure - if (!req.body || typeof req.body !== 'object' || req.body === null) { - logger.error('Webhook request missing or invalid body'); + // Validate request body structure for webhook processing + // Use Object.prototype.toString for secure type checking to prevent bypass + const bodyType = Object.prototype.toString.call(req.body); + if (bodyType !== '[object Object]' || req.body === null || req.body === undefined) { + logger.error('Webhook request missing or invalid body structure'); return res.status(400).json({ error: 'Missing or invalid request body' }); }