feat: portable identity export/import between River UI and riverctl#137
Merged
feat: portable identity export/import between River UI and riverctl#137
Conversation
Add IdentityExport struct in common/ with PEM-like armored encoding (CBOR + base58 with -----BEGIN/END RIVER IDENTITY----- markers). The bundle includes: - Signing key (private) - AuthorizedMember (signed membership proof) - Invite chain (for rejoin after pruning) - MemberInfo (nickname) Changes: - common/src/room_state/identity.rs: IdentityExport with armored encode/decode and validation (key must match authorized member) - cli/src/commands/identity.rs: `riverctl identity export/import` - ui/src/components/members.rs: Export/Import Identity buttons and modals in the members panel Closes #136 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Validate AuthorizedMember and invite chain signatures on import (verifies against owner key and chain member keys) - Add tests: invite chain roundtrip, member_info roundtrip, tampered signature rejection, truncated token, empty token, imported key signing Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add warning text in export modal that token contains private key - Clear token_text signal when export modal is closed (both backdrop and button) - Add stderr warning in CLI export command for human output format Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adding identity.rs to common/ changes the delegate WASM hash. Add the current delegate's key and code_hash to LEGACY_DELEGATES so existing users' secrets are migrated to the new delegate. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.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.
Summary
Adds a portable identity bundle that lets users transfer their room identity (signing key + membership proof) between the River UI and riverctl, or between different devices.
Problem
There was no way to use the same identity across River clients. A user who joined via the UI couldn't use riverctl for the same room, and vice versa. (Issue #136)
Approach
New
IdentityExportstruct incommon/AuthorizedMember, invite chain, optionalMemberInfo(nickname)-----BEGIN/END RIVER IDENTITY-----)riverctl identity export/importriverctl identity export <room_key>— exports armored token to stdoutriverctl identity import --token <token>or--file <path>or stdinUI Export/Import
Testing
IdentityExport: roundtrip encoding, key mismatch rejection, whitespace handlingcargo test -p river-core -p riverctl— all passcargo fmt/cargo clippy— cleanNotes
Closes #136
[AI-assisted - Claude]