fix(ibkr): reconcile CP API v1 read-path to the live paper gateway#129
Merged
Conversation
Replace the representative cpapi fixtures with real, sanitized captures from a live paper Client Portal Gateway, and reconcile the DTOs, endpoint descriptor, and capture script to what the wire actually sends: - tickle: bind IBKR's misspelled `collission` key (a correct-spelling alias is kept should IBKR ever fix it); add a guard test. - secdef/info: bind `ticker` (not `symbol`), and decode a single object (not an array) for one conid. - Endpoint::secdef_info is now conid-only — a stock lookup with `secType=STK` is rejected `400 "month required"`. - capture.sh: `POST /tickle` sends an empty body (a bodyless POST returns 411); secdef/info drops `secType`. - secdef/search: real AAPL returns 6 sections; positions keep money as `serde_json::Number` (real mktPrice preserved, holdings zeroed). Fixtures sanitized: account id, holder name, session token, userId, MAC, hardware id, balances, and account-status date scrubbed; the public market price is kept. `collission` is allowlisted in _typos.toml. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (17)
📝 WalkthroughWalkthroughIBKR CPAPI mappings and endpoint requests were reconciled with sanitized paper-gateway captures. Fixtures, capture commands, deserialization behavior, public endpoint signatures, and related tests were updated for the observed wire shapes. ChangesIBKR CPAPI wire reconciliation
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related issues
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
This was referenced Jul 10, 2026
NotAProfDev
added a commit
that referenced
this pull request
Jul 10, 2026
# Conflicts: # _typos.toml
NotAProfDev
added a commit
that referenced
this pull request
Jul 10, 2026
* chore(ibkr): harden the CP gateway docker harness Make the dev Client Portal Gateway self-sufficient so browser login works in a devcontainer without a manual patch, adopting hardening ideas from a reference gateway: - Bake a dev `conf.yaml` into the image whose `ips.allow` covers loopback + RFC-1918 private ranges — the distribution's shipped allowlist (192.*/131.216.*/127.0.0.1) rejects a Docker-forwarded login (source 172.*/10.*) with 403 "not allowed". - Add a container HEALTHCHECK (curl /iserver/auth/status -> 200|401); install curl for it. - Harden docker-compose: cap_drop ALL, no-new-privileges, mem/pids limits, and a bounded log size. - `just ibkr-capture` resolves the gateway's container IP (new docker/cpapi/gateway-base-url.sh helper) because localhost:5000 is not routable from inside a devcontainer; capture.sh is untouched. Verified: image builds, and a throwaway container serves 401 (source allowed, not 403) with no manual ips.allow patch. Allowlist `vertx` (the keystore filename) in _typos.toml. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * chore(ibkr): merge main (#129) into the gateway-harness branch # Conflicts: # _typos.toml
This was referenced Jul 11, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #128
Deferred Task 9 from #127: replace the representative CP API v1 fixtures with real, sanitized captures from a live paper Client Portal Gateway, and reconcile the code to the live wire.
Live-wire corrections (the real gateway disagreed with the representative fixtures)
collissionkey (an alias keeps the correct spelling should IBKR fix it); guard test added.ticker(notsymbol) and returns a single object (not an array) for oneconid.Endpoint::secdef_infois nowconid-only — a stock lookup withsecType=STKis rejected400 "month required".POST /tickle(a bodyless POST returns411) and dropssecTypefromsecdef/info.serde_json::Number(realmktPricepreserved, holdings zeroed).Sanitization
Account id, holder name, session token,
userId, MAC, hardware id, balances, and account-status date scrubbed; the public market price is kept.gitleaksclean;collissionallowlisted in_typos.toml.just ciis green. Adversarially verified across three lenses (data-leak audit / wire fidelity / harness correctness).🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Tests
Documentation