Repository navigation
feat: keep and use connected_apps for conversation keys and app signatures - #112
Open
santiagomed wants to merge 27 commits into
Open
santiagomed wants to merge 27 commits into
santiagomed wants to merge 27 commits into
Conversation
Co-authored-by: Santiago Medina <santiagomed@users.noreply.github.com>
…tures Co-authored-by: Santiago Medina <santiagomed@users.noreply.github.com>
…SDKs Co-authored-by: Santiago Medina <santiagomed@users.noreply.github.com>
|
|
…p validation Co-authored-by: Santiago Medina <santiagomed@users.noreply.github.com>
…ce & net472 test Co-authored-by: Santiago Medina <santiagomed@users.noreply.github.com>
…nversation_keys Co-authored-by: Santiago Medina <santiagomed@users.noreply.github.com>
Co-authored-by: Santiago Medina <santiagomed@users.noreply.github.com>
Co-authored-by: Santiago Medina <santiagomed@users.noreply.github.com>
…s all bindings Co-authored-by: Santiago Medina <santiagomed@users.noreply.github.com>
…pp sending Co-authored-by: Santiago Medina <santiagomed@users.noreply.github.com>
…d comments Co-authored-by: Santiago Medina <santiagomed@users.noreply.github.com>
Co-authored-by: Santiago Medina <santiagomed@users.noreply.github.com>
…, skipped_connected_apps, and read-receipt signatures Co-authored-by: Santiago Medina <santiagomed@users.noreply.github.com>
…_id, skipped_connected_apps, and clean types across all bindings Co-authored-by: Santiago Medina <santiagomed@users.noreply.github.com>
…G, and all examples to use connected-app mode and request_body Co-authored-by: Santiago Medina <santiagomed@users.noreply.github.com>
…ertion Co-authored-by: Santiago Medina <santiagomed@users.noreply.github.com>
…ion/reply tests Co-authored-by: Santiago Medina <santiagomed@users.noreply.github.com>
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.
Support connected apps across all bindings (Rust, Python, JS/WASM, C ABI/FFI, Go, .NET, JVM, Ruby) so a connected app can participate in a business's 1:1 X Chat conversations without ever holding the business's private keys — while keeping the developer flow simple and misuse-resistant.
Developer flow
Pass
GET /2/users/{id}/public_keysrecords straight to the SDK as usual — the SDK verifies connected apps' keys and signatures for you. Enable connected-app mode once viasetIdentity({ userId, signingKeyVersion, clientAppId }), and postrequestBodydirectly to/2/chat/conversations/${restConversationId}/...on every send and prepare result.Full walkthrough and tradeoffs in
docs/API.md#connected-apps.What changed
clientAppId(client_app_id) toSetIdentityParamsacross all bindings and removed per-sendconnectedApp/ConnectedAppSender. In connected-app mode, 1:1 sends and read receipts infer the acted-for participant from stored/hook-resolved public keys (sync calls use stored keys only; JS/.NET*Asynccalls includingprepareMarkConversationReadAsyncand native bindings callresolvePublicKeys). Rejects missing keys, neither participant listing the app, both listing it (unlesssenderIdis passed), non-participant or app-ownersenderId, groups, and self-DMs, and never falls back to the app owner.requestBody&restConversationId: Added toSendPayload,PreparedConversationChange,PreparedGroupMetadataChange, andPreparedActionacross all bindings (purely additive). Emits exactsnake_caseX API request JSON, includesconnected_app_conversation_keyson non-self 1:1 key changes when present, and never includes the secretconversation_key.skippedConnectedApps): Broken or invalid connected-app entries are skipped identically on passed-in, stored, and hook paths instead of aborting a 1:1 key change, and reported inskippedConnectedApps({ clientAppId, reason }).PublicKeyRecordandConnectedAppinto one interface per casing (PublicKeyRecordSnake | PublicKeyRecordCamel,ConnectedAppSnake | ConnectedAppCamel) with plain developer-focused comments.prepare_mark_conversation_readin connected-app mode populates valid top-level signature and version fields alongsideconnected_app_signaturesoPOST /2/chat/conversations/{id}/readaccepts them while decryption still verifies the connected-app signature.docs/API.md(including the connected-apps walkthrough and tradeoffs),docs/CRYPTO.md,CHANGELOG.md, all READMEs, and allexamples/*projects to use the redesigned flow andrequestBody.Testing
cargo fmt --check,cargo clippy --workspace --all-targets -- -D warnings,cargo test --workspace), Go (make test-go), Python (195tests), and Rust/Go/Python example offline suites pass locally.skippedConnectedApps,requestBody/restConversationId, and app-signed read receipts.