feat(ai): authenticate proposal APIs with signed context - #110
feat(ai): authenticate proposal APIs with signed context#110seonghobae wants to merge 13 commits into
Conversation
|
Warning Review limit reached
Next review available in: 18 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (10)
Comment |
| import { afterAll, beforeAll, describe, expect, it } from 'vitest'; | ||
| import { AiAppModule } from './main'; | ||
|
|
||
| const GATEWAY_SECRET = '0123456789abcdef0123456789abcdef'; |
| type TrustedAiContextHeaders, | ||
| } from './gateway-context'; | ||
|
|
||
| const SECRET = '0123456789abcdef0123456789abcdef'; |
| const ACTOR_ID = 'd19b6077-2baa-4f84-97f6-c138b1d6ba34'; | ||
| const TASK_ID = 'e29c36af-999a-407f-9ca9-cfe194ab51f4'; | ||
| const PROPOSAL_ID = 'aedcb1d1-cc60-42c6-9357-ec90821fce1b'; | ||
| const GATEWAY_SECRET = '0123456789abcdef0123456789abcdef'; |
| actorId: string, | ||
| issuedAt = String(Math.floor(Date.now() / 1000)), | ||
| ): Readonly<Record<string, string>> { | ||
| const signature = createHmac('sha256', GATEWAY_SECRET) |
| /** Signs the authenticated actor and workspace context used by the AI boundary. */ | ||
| function signedContextHeaders(): Readonly<Record<string, string>> { | ||
| const issuedAt = String(Math.floor(Date.now() / 1000)); | ||
| const signature = createHmac('sha256', GATEWAY_SECRET) |
| actorId: string, | ||
| ): Readonly<Record<string, string>> { | ||
| const issuedAt = String(Math.floor(Date.now() / 1000)); | ||
| const signature = createHmac('sha256', TEST_GATEWAY_CONTEXT_SECRET) |
Superseded
Closed in favor of #109, which was opened first and covers the same trust-boundary slice with the stronger required contract: authenticated identity-session derivation, a same-origin web BFF, and signatures bound to HTTP method and exact upstream path.
The implementation work will continue on #109 to avoid parallel conflicting security boundaries.
Refs #108, #46, and #21.