Repository navigation
docs(contract): formalize Firebase transport configuration for #163 - #178
Conversation
Propose remote contract revision 2026-08-11.3 adding two transport configuration facts absent from 2026-08-11.2 that the Go implementation (PR #177) requires for signInWithCustomToken, refreshToken, and lookupFirebaseUser: 1. Firebase web API key value: the firebaseApiKey security scheme now carries x-publicValue with the observed public key. This is embedded in every Partiful web client and documented in the March 24, 2026 browser interception. It is not a credential. 2. Referer header requirement: each Firebase operation now has a required Referer: https://partiful.com/ header parameter. Documented in the August 11, 2026 auth observation. Requests without it receive 403 API_KEY_HTTP_REFERRER_BLOCKED. Origin is NOT modelled. Agent probes succeeded without Origin, receiving valid 400 error responses. Origin is browser CORS behavior, not a Firebase transport requirement. Material claims: 992 -> 1008 Contract revision: 2026-08-11.3 (proposed, pending owner approval) Pacific full suite: 338 passed, 6 skipped, 0 failed Linked to #163 Co-authored-by: Copilot <[email protected]>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning Review limit reached
Next review available in: 55 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. 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: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughThe proposed contract revision adds privacy-safe Firebase API-key and ChangesFirebase contract evidence
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
🚥 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 |
|
Describe the observed accepted Referer separately from the unknown complete allowlist so revision 2026-08-11.3 does not overstate remote behavior. Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]> Copilot-Session: 8453c76f-a887-4fce-be42-d7997ed94292
|
Independent review cycle 1: Standards 2 blocking findings; Spec 0 findings. Required corrections: sanitize the legacy auth research source before using it as provenance and remove the unsupported assertion about Origin omission. The resulting tree and semantic guards must remain privacy-safe; no private values should be quoted in discussion or output. |
Move the public Firebase configuration claim to a dedicated privacy-safe evidence extract, reject unsafe provenance, and keep Origin unmodelled and unknown. Co-authored-by: Copilot <[email protected]>
Require redacted identity fields, retain public transport structure, and reject private-value patterns in the tracked historical auth note. Co-authored-by: Copilot <[email protected]>
|
Independent review cycle 2: Standards 0 findings; Spec 1 blocking finding. Request-shape claims for |
Co-authored-by: Copilot <[email protected]> Copilot-Session: 8453c76f-a887-4fce-be42-d7997ed94292
Keep all authentication request schemas TypeScript-derived while preserving dated observation classifications for responses and the separately observed Firebase transport facts. Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/research/2026-08-10-contract-evidence-sources.md`:
- Around line 42-44: Update the August 11 authentication observation references
and the related entries for getLoginToken and signInWithCustomToken in
spec/partiful.api-evidence.json so their request-shape claims return to the
prior inference class. Describe the observation as response and status evidence
only, and align the surrounding evidence wording with the API contract evidence
ledger.
In `@tests/remote-api-contract.test.js`:
- Around line 701-705: Update the Origin parameter lookup in the firebaseOps
validation loop to compare header names case-insensitively, using
p.name?.toLowerCase() against "origin", so modeled origin, Origin, or ORIGIN
headers are all detected and rejected.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: b956ea31-1af3-48eb-a466-488a189f6d82
📒 Files selected for processing (8)
docs/REMOTE-API-CONTRACT.mddocs/research/2026-03-24-auth-flow-endpoints.mddocs/research/2026-08-10-contract-evidence-sources.mddocs/research/2026-08-10-partiful-api-contract-evidence-ledger.mddocs/research/2026-08-11-firebase-public-api-key-redacted.mdspec/partiful.api-evidence.jsonspec/partiful.openapi.jsontests/remote-api-contract.test.js
| // Origin is NOT modelled for Firebase operations — evidence does not support it as required | ||
| for (const { path: opPath, id } of firebaseOps) { | ||
| const operation = spec.paths[opPath].post; | ||
| const origin = (operation.parameters ?? []).find((p) => p.name === 'Origin'); | ||
| expect(origin, `${id} must not claim Origin`).toBeUndefined(); |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -eu
printf '%s\n' '--- target lines ---'
sed -n '680,720p' tests/remote-api-contract.test.js
printf '%s\n' '--- related declarations and Origin checks ---'
rg -n -C 4 'firebaseOps|Origin|origin' tests/remote-api-contract.test.jsRepository: KalebCole/partiful-cli
Length of output: 5060
🏁 Script executed:
#!/bin/bash
set -eu
printf '%s\n' '--- spec loading and Firebase operation sources ---'
rg -n -C 5 'spec\s*=|openapi|accounts:signInWithCustomToken|lookupFirebaseUser|refreshToken|parameters:' tests/remote-api-contract.test.js --glob '*.js'
printf '%s\n' '--- all Origin parameter declarations and Firebase paths ---'
rg -n -C 3 'name:\s*['"'"'"]?[Oo]rigin|name:\s*['"'"'"]?[Rr]eferer|accounts:signInWithCustomToken|/v1/token|accounts:lookup' . --glob '*.js' --glob '*.json' --glob '*.yaml' --glob '*.yml'
printf '%s\n' '--- deterministic case/location probe ---'
python3 - <<'PY'
cases = [
{"name": "Origin", "in": "header"},
{"name": "origin", "in": "header"},
{"name": "ORIGIN", "in": "header"},
{"name": "origin", "in": "query"},
{"name": "Referer", "in": "header"},
]
for parameter in cases:
exact = parameter.get("name") == "Origin"
ci_header = (
isinstance(parameter.get("name"), str)
and parameter["name"].lower() == "origin"
and parameter.get("in") == "header"
)
print(f'{parameter!r} exact_match={exact} case_insensitive_header_match={ci_header}')
PYRepository: KalebCole/partiful-cli
Length of output: 50378
🏁 Script executed:
#!/bin/bash
set -eu
python3 - <<'PY'
import json
with open("spec/partiful.openapi.json", encoding="utf-8") as f:
spec = json.load(f)
paths = [
("/v1/accounts:signInWithCustomToken", "signInWithCustomToken"),
("/v1/token", "refreshToken"),
("/v1/accounts:lookup", "lookupFirebaseUser"),
]
for path, operation_id in paths:
operation = spec["paths"][path]["post"]
print(operation_id)
for parameter in operation.get("parameters", []):
print(" ", {
"name": parameter.get("name"),
"in": parameter.get("in"),
"required": parameter.get("required"),
})
def current_rejects(parameters):
return any(parameter.get("name") == "Origin" for parameter in parameters)
def proposed_rejects(parameters):
return any(
isinstance(parameter.get("name"), str)
and parameter["name"].lower() == "origin"
for parameter in parameters
)
cases = [
[{"name": "Origin", "in": "header"}],
[{"name": "origin", "in": "header"}],
[{"name": "ORIGIN", "in": "header"}],
[{"name": "origin", "in": "query"}],
[{"name": "Referer", "in": "header"}],
]
print("predicate comparison")
for parameters in cases:
print({
"parameters": parameters,
"current_rejects": current_rejects(parameters),
"proposed_rejects": proposed_rejects(parameters),
})
PYRepository: KalebCole/partiful-cli
Length of output: 928
Match Origin header names case-insensitively.
A modeled origin or ORIGIN header bypasses this check. Compare p.name?.toLowerCase() with "origin".
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@tests/remote-api-contract.test.js` around lines 701 - 705, Update the Origin
parameter lookup in the firebaseOps validation loop to compare header names
case-insensitively, using p.name?.toLowerCase() against "origin", so modeled
origin, Origin, or ORIGIN headers are all detected and rejected.
Co-authored-by: Copilot <[email protected]> Copilot-Session: 8453c76f-a887-4fce-be42-d7997ed94292
Summary
Proposes remote contract revision
2026-08-11.3, pending explicit owner approval. It adds the Firebase transport configuration required by the Go auth implementation in #177 but absent from owner-reviewed revision.2.Contract changes
Public Firebase web-key configuration
Firebase Referer request requirement
signInWithCustomToken,refreshToken, andlookupFirebaseUser.Origin remains unknown
The correction retains 1008 evidence-covered material pointers and keeps the human and machine ledgers aligned.
Review fixes
Both blocking Standards findings are addressed test-first at
0b3d744ef1942c2c8d0312fe994e8f1ab292b752:Review cycle 1 Spec review reported no findings. Review cycle 2 Standards review reported no findings; its Spec blocker is fixed by classifying every authentication request schema as a TypeScript-derived inference with exact preserved request-schema provenance. Response metadata/shapes and the separately observed public Firebase key and Referer facts remain dated-live observations. The semantic guard now compares each canonical auth request body to its cited source and independently checks response/transport classifications.
Safety and validation
No live authentication, SMS, credential entry, browser login, live probes, or Partiful integration tests were used. No private value is introduced or quoted by the correction.
go test -race ./...,go vet ./...,go build ./...,go mod verify: passedStatus and merge dependency
Status remains proposed; no owner approval or merge has occurred. Required order:
main, update its advertised revision and tests from.2to.3, and rerun all checks.Linked: #163
Summary by CodeRabbit
Documentation
Refererheader.RefererandOriginvalues.Tests