Conversation
Software that does not understand ap:/ap+ef61: URIs can still refer to portable objects through compatible identifiers: HTTP(S) URLs under a gateway's fixed /.well-known/apgateway/ path. The later FEP-ef61 work (gateway dereferencing, portable inbox delivery, WebFinger, gateway keys, and Context helpers) needs a single, well-tested conversion between the two forms instead of hand-built strings. This adds two helpers to @fedify/vocab-runtime: - fromCompatibleEf61Id() turns a compatible identifier into the portable URI, returning null for URLs that are not compatible identifiers (including the discovery endpoint and hashlink media routes) and throwing a TypeError for malformed ones, such as those with an invalid DID, no object path, bad percent-encoding, credentials, or location hints. - toCompatibleEf61Id() builds a compatible identifier from a portable URI and an HTTP(S) gateway origin. It removes @gateway (and legacy gateways) location hints, which FEP-ef61 forbids in compatible identifiers, keeps other query parameters, and preserves the path and fragment. Characters that an HTTP(S) URL parser would rewrite are percent-encoded the same way canonicalizePortableUri() does, and paths with dot segments are rejected, so the conversion never silently changes which object is identified. Only the fixed well-known gateway path is supported. The existing comparison and origin helpers are unchanged; callers convert compatible identifiers explicitly, and the docs point out that the conversion does not authenticate anything: the object's proof still has to be verified against its DID. fedify-dev#833 fedify-dev#288 Assisted-by: Claude Code:claude-opus-5-5 Assisted-by: OpenCode:deepseek-flash Assisted-by: Codex:gpt-6-astra Assisted-by: Claude Code:claude-fable-5-1
✅ Deploy Preview for fedify-json-schema canceled.
|
|
@codex review |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (6)
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughThe runtime adds helpers to convert between FEP-ef61 portable identifiers and fixed-path HTTP(S) gateway identifiers. The changes also add validation tests, public exports, and documentation describing conversion behavior and proof verification. ChangesFEP-ef61 compatible identifiers
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Feature Merge Risk: ⚪ Minimal · up to The new identifier conversions appear ready to merge after normal checks; no actionable issue was established. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The new converters validate identifier form but do not establish who controls a DID. The change documents that distinction, and no direct authorization change is shown. Applications using the converters must still verify object proofs. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Hardening Proposals
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 37.50% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 3 files. (3 skipped: 3 unsupported.)
✨ 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 |
Codecov Report❌ Patch coverage is
... and 1 file with indirect coverage changes 🚀 New features to boost your workflow:
|
Closes #833, part of #288.
Portable objects need HTTP(S) IDs for software that can't handle
ap:/ap+ef61:URIs. This addsfromCompatibleEf61Id()andtoCompatibleEf61Id()to@fedify/vocab-runtimeso every later gateway feature converts the same way.An HTTP(S) URL parser rewrites paths that portable IDs treat as opaque: it drops tabs, turns
\into/, and resolves dot segments. Pasting a portable path under/.well-known/apgateway/could therefore name a different object.toCompatibleEf61Id()percent-encodes the path and fragment withcanonicalizePortableUri()'s rules, rejects dot segments, and converts its output back to check that the canonical ID survived. Location hints are stripped by decoded name after the query is normalized, so a raw tab can't hide@gate<TAB>wayuntil the parser deletes it; other parameters stay for collection paging. DIDs are written literally unless they contain%25, the one case the existing parser would decode.fromCompatibleEf61Id()returnsnullfor routes outside the DID object path, such as the discovery endpoint andhl:media URLs. It throws only for IDs that look compatible but are broken, including ones carrying location hints, which FEP-ef61 forbids.canonicalizePortableUri(),arePortableUrisEqual(), andgetFe34Origin()still treat compatible IDs as ordinary HTTP(S) URLs. Anyone can publishhttps://evil.example/.well-known/apgateway/did:key:VICTIM/…, so conversion stays explicit and proves nothing on its own; the proof still has to verify against the DID. Arbitrary gateway paths are out of scope. Fedify canonicalizes toap+ef61:(#828), although the current FEP text now saysap:.