Add subscription intelligence bridge and ChatGPT MCP app#80
Conversation
Deploying secopsai with
|
| Latest commit: |
3aeb34c
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://6b184dc2.secopsai.pages.dev |
| Branch Preview URL: | https://codex-intelligence-bridge-mc.secopsai.pages.dev |
Deploying website with
|
| Latest commit: |
3aeb34c
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://c929af77.website-bks.pages.dev |
| Branch Preview URL: | https://codex-intelligence-bridge-mc.website-bks.pages.dev |
4999b2f to
3aeb34c
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4999b2f470
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } catch (error) { | ||
| const authError = error instanceof AuthenticationError ? error : new AuthenticationError("Access token verification failed"); | ||
| response.setHeader("WWW-Authenticate", authenticationChallenge(config, authError)); | ||
| return json(response, 401, { error: authError.code, error_description: authError.message, request_id: requestId }); |
There was a problem hiding this comment.
Add CORS headers before returning auth challenges
When ChatGPT calls /mcp from https://chatgpt.com with a missing or expired access token, this 401 is returned before setCorsHeaders() runs, so the browser blocks the response and hides the WWW-Authenticate challenge that the client needs to discover OAuth metadata or re-authenticate. Apply the allowed-origin headers on the MCP path before the authentication failure path as well.
Useful? React with 👍 / 👎.
| inputs = dict(job.get("input") or {}) | ||
| if job.get("target_id"): | ||
| inputs.setdefault("target_id", job["target_id"]) | ||
| bridge_request = prepare_bridge_request(job["action"], inputs, db_path=resolved.db_path) |
There was a problem hiding this comment.
Fail or requeue jobs when context preparation fails
If a queued bridge job references a mistyped or deleted target finding/case, claim_intelligence_job() has already marked it running before this context preparation can raise ValueError. The endpoint then returns 422 to the remote bridge without calling the fail/requeue path, leaving the job stuck until stale recovery and causing the remote bridge poll to error instead of recording a failed job; validate/build the context before claiming or explicitly fail/requeue the claimed job on this exception.
Useful? React with 👍 / 👎.
Summary
Security boundary
Verification