@kybernesis/arp-pairing
v0.1.3
Published
ARP pairing protocol — create, deliver, countersign, and verify Connection Tokens.
Readme
@kybernesis/arp-pairing
Pairing protocol implementation — creates, verifies, and countersigns Connection Tokens.
Flow
- Issuer side.
createPairingProposalcompiles the chosen scope bundle into Cedar policies, then signs the canonical bytes with the issuer's principal key. Output: aPairingProposal. - Delivery.
buildInvitationUrlbase64url-encodes the proposal JSON into a QR code or deep link (https://samantha.agent/pair?invitation=…). - Audience side.
parseInvitationUrldecodes it. After rendering the consent UI,countersignProposalverifies the audience's local recompile still matches the issuer's policies, signs, and projects out aConnectionTokenready for the runtime. - Either side.
verifyConnectionToken(orverifyPairingProposal) takes aDidResolverand re-validates both signatures + expiry.
Canonicalization
All signatures are computed over the JCS (RFC 8785) serialization of the nine
connection-payload fields: connection_id, issuer, subject, audience,
purpose, cedar_policies, obligations, scope_catalog_version,
expires. sigs itself is never included in the hashed bytes. The same
payload shape is used whether you start from a proposal or a token, so a
proposal's signatures carry verbatim into its ConnectionToken.
