Repository navigation
feat: App Connect v2 protocol module and vendor sync tool - #5
Merged
Merged
Conversation
Add explicit guards where indexed access is provably in bounds; no behaviour change. Needed so the App Connect module (and apps that vendor it under this flag) type-check. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Headless request codec, response encryption, candidate polling, verifier, session records and error mapping, with test vectors and the wire profile. Depends only on @noble/hashes and @noble/secp256k1: primitives.ts holds the six helpers plus a small base58 codec, so the module can be vendored on its own. Exposed from the package root and as the ./app-connect subpath. deriveYapprSharedSecret gains an optional HKDF info parameter and zeroes its intermediate buffers (backward compatible). Co-Authored-By: Claude Opus 5.5 <[email protected]>
tools/vendor.mjs copies src/<module>/ from a git ref (or the worktree) into an app repo, checks imports without rewriting them, and records a deterministic VENDORED.json with per-file sha256 hashes. Local edits block a plain sync (--keep-local / --force override); `status` reports local and upstream drift and always exits 0 on divergence. `npm test` now also runs the node:test suite for the tool. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Remove before write (case-only renames, file/dir swaps), refuse paths through symlinks and validate every path before the first write, scan imports with a comment/string-aware scanner (multi-line imports with trailing comments, vi.mock, template imports), validate manifest commit and hash formats with prototype-safe maps, and read package.json before writing. Co-Authored-By: Claude Opus 5.5 <[email protected]>
6 tasks done
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 59 minutes. View limit details
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 |
4 of 6 tasks
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.
Summary
Makes this repo the canonical source for the App Connect v2 protocol core and adds a tool for apps to keep in-repo (vendored) copies of shared modules.
src/app-connect/: the App Connect v2 protocol core (request TLV encoding anddash-key:URIs, payload crypto, response poller, candidate verifier, session and signing-key selection, Platform error classification, contract-group trust). It is upstreamed from Yappr'svendor/platform-authcopy (stagingc762777b), which is also what EvoVote v2 copied by hand.key-exchange/yappr-protocolnow live inapp-connect/primitives.tswith neutral names (AppConnectNetworkName,APP_CONNECT_NETWORK_IDS,deriveSharedSecret,getPublicKey,decodeIdentityId). It has an internal base58 implementation, so it doesn't importbs58.@noble/hashesand@noble/secp256k1../app-connectsubpath.docs/APP_CONNECT_PROFILE.mdmoved here from Yappr. The vector test checks that the JSON embedded in the doc matchesvectors.json, and skips that check in vendored copies that don't carry the doc.noUncheckedIndexedAccessis now on repo-wide, so consumers that build with it (Forge) can typecheck vendored code. The guards don't change behaviour, and the vectors still match byte for byte.deriveYapprSharedSecretgains an optionalinfoparameter and zeroes its buffers. Existing callers are unaffected.tools/vendor.mjscopiessrc/<module>/from a git ref into an app's directory and writes a deterministicVENDORED.jsonmanifest (upstream commit and per-file sha256). It checks that imports stay inside the vendored module set and records external packages.statusreports local edits and upstream changes.docs/vendoring.md.Why
Yappr, EvoVote and govhub each had their own copy of the login code, and Forge was about to make a fourth. Security fixes were landing in only one copy. With this PR the shared code has one upstream, each app still owns its own copy, and
vendor.mjs statusshows how far a copy has drifted.First consumer: dash-forge
feat/app-connect-login, which vendorsapp-connectfrom commita627708. Please merge with a merge commit (not squash), so the commit recorded in that manifest stays reachable frommain.Open question for review
errors.tsmarks Platform code 40208 (IdentityPublicKeyIsDisabledError) aspaid: true. Forge's write path treats every key-limit refusal as unpaid. Drive raises 40208 inidentity_key_limits_updatestate validation (and the payout path), so this needs a check against Drive's fee handling for that transition. The mapping is unchanged from Yappr in this PR.Test plan
npm run lintnpm test: 17 vitest files, 356 tests, plus 18node --testtool testsnpm run buildapp-connectinto a scratch directory (--from WORKTREE). Its externals are noble only, and its own tests pass there (108 passed, 1 skipped: the doc check)🤖 Generated with Claude Code