docs: add API key auth requirement to /ws/stats in OpenAPI spec#156
docs: add API key auth requirement to /ws/stats in OpenAPI spec#1560x-SquidSol wants to merge 1 commit intodcccrypto:mainfrom
Conversation
The /ws/stats endpoint applies requireApiKey() middleware (health.ts:76) which checks the x-api-key header, but the OpenAPI spec had no security requirement documented. Clients following the spec would hit an undocumented 401. Adds: - securitySchemes.ApiKeyAuth component (apiKey in header, name: x-api-key) - security requirement on /ws/stats operation - 401 response documentation with example Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 5 minutes and 3 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
GET /ws/statsrequiresx-api-keyheader viarequireApiKey()middleware, but the OpenAPI spec had nosecurityrequirement. Clients following the spec would receive an undocumented 401.securitySchemescomponent andsecurity+401response to the/ws/statsoperation.Changes
components.securitySchemes.ApiKeyAuth(apiKey in header, name:x-api-key)security: [ApiKeyAuth: []]to/ws/statsGET operation401response with example error messageTest plan
vitest runpasses (186/186 tests)requireApiKey()checksx-api-keyheader insrc/middleware/auth.ts🤖 Generated with Claude Code