Repository navigation
feat(cli): show and search verified identity in users get - #9647
Conversation
Where a community advertises NIP-FI verified profiles, users get attaches a verified object (username, display_name, full_name, issuer_label, verified_at) from the relay-signed kind:30382, trusting only the NIP-11 self key. --name now uses the relay profile search so verified usernames match, falling back to NIP-50 on relays without it. messages send also resolves @mentions by a channel member's verified username. Signed-off-by: damienrj <damien@squareup.com>
🔐 Codex Security Review
Review SummaryOverall Risk: NONE
FindingsNo concrete security, correctness, or reliability findings were identified. Notes
Generated by Codex Security Review | |
Drop the messages send @mention change, the unicode name validation and strict projection checks, the 404 fallback and verified-only entries. Strip any verified key from kind:0 content so only a relay-signed kind:30382 can set it. Signed-off-by: damienrj <damien@squareup.com>
joahg
left a comment
There was a problem hiding this comment.
🤖 This needs a human maintainer's review because it comes from outside the core maintainer group. No P0 or P1 findings.
What holds up:
- Only kind 30382 events signed by the NIP-11
selfkey count, andevent.verify()checks the id and signature for real. - The projection shape, the active status and
verified_at <= created_atare enforced. The newest event per subject wins, with the lower id breaking ties. - A newer retraction or malformed head clears the name. All of this matches the mobile client.
/profiles/searchis NIP-98 signed, and only a 404 falls back to NIP-50.- A relay without
federated_identityreads as "not advertised", so older relays are fine.
Inline: two P2s (verified usernames collide with self-declared names in @ resolution, and a NIP-11 discovery failure is now fatal for users get and messages send) and one P3 (queries over 100 characters).
Also P3: the name validators in verified_profiles.rs copy buzz-auth's. Sharing them, or adding a test that pins them to the relay's rules, would keep them from drifting.
Not covered: I didn't build or run the tests, and I didn't review the owner-scoped --name path.
joahg
left a comment
There was a problem hiding this comment.
🤖 Follow-up on b8b95d3, which narrows the PR to users get.
- Dropping the
messages sendmention change resolves the verified-versus-profile-name collision. - Dropping the copied validators resolves the drift risk.
- The trust core is intact: only kind 30382 events signed by the advertised
selfkey count,event.verify()runs,activemust betrue, and there's a test for events from other keys. - Stripping
verifiedfrom kind:0 content in both lookup paths is a good addition: it stops a self-written profile from claiming verification.
Two P3s remain:
users get, with no args or--pubkey, still fails outright when the relay info can't be fetched or its advertisement is malformed, though the kind:0 output doesn't need it. The doc comment says this is deliberate, which is fine. A stderr warning that keeps the kind:0 output would be friendlier for read-only lookups.- On a relay that advertises verified profiles,
--namenow goes only through/profiles/search. A query over 100 characters errors (400) where NIP-50 used to answer, and results stop at one page of 100.
This still needs a human maintainer's review, because it comes from outside the core maintainer group.
Warn on stderr instead of failing --pubkey lookups when relay info can't be read, and send --name queries over 100 characters to NIP-50 search. Signed-off-by: damienrj <damien@squareup.com>
joahg
left a comment
There was a problem hiding this comment.
🤖 Follow-up on c3760e0. Both open points are fixed:
users get --pubkeyandusers getwith no arguments now keep the kind:0 output when relay info or the verified lookup fails, and write theverified_profiles_unavailablewarning to stderr. stdout JSON is unaffected.--namestill fails hard, as you described, since that path needs the advertisement.- A
--namequery longer than 100 characters falls back to NIP-50. The check (trim().chars().count() <= 100) matches the server's trim and character count, so there's no bytes-vs-characters mismatch.
Two small test gaps are noted inline. This is an outside contribution, so a human maintainer still needs to review it before merge.
wpfleger96
left a comment
There was a problem hiding this comment.
🤖 Reviewed at c3760e0, on top of joahg's earlier passes. The trust core holds: only kind 30382 events from the NIP-11 self key with a valid id and signature count, and a verified key in user-written kind:0 content never reaches the output. Two correctness gaps that the existing comments don't cover are inline, and I'd like them fixed before approving. One nonblocking note about spec checks is inline too.
users get --pubkey returns requested people who have a verified profile but no kind:0. --name uses /profiles/search only when public_profile is searchable, otherwise NIP-50 with verified profiles attached. Restore the NIP-FI projection checks: empty content, exact tag set, p equal to d, verified_at not after created_at, well-formed names, and the lower id winning a same-second tie. Signed-off-by: damienrj <damien@squareup.com>
Signed-off-by: damienrj <damien@squareup.com>
…-profiles * origin/main: test(relay): refresh the author's membership cache after the stray-h private channel insert (#9640) fix(mobile): name the cause of account-unavailable sign-in errors (#9628) perf(db): bound deep keyset history pages by the cursor timestamp (#9549) feat(cli)!: consistent channels list/get/search output (type, visibility, labels, real created_at) (#9617) ci(docker): publish the push gateway only when its inputs change (#9658) feat(mobile): reply to a message from its iOS notification (#9439) fix(mobile): stop reporting saved images as failed on iOS (#9599) Signed-off-by: damienrj <damien@squareup.com>
joahg
left a comment
There was a problem hiding this comment.
🤖 Follow-up on 9a14081. Both of my earlier test gaps are closed: the warning is now asserted, and the 100-character boundary and multi-byte cases are pinned. wpfleger96's three points also look fixed when checked against the code:
--pubkeyand the no-argument lookup now append people who have only a verified profile, in request order, with no duplicate rows.--nameuses/profiles/searchonly whensearchableis literallytrue, and falls back to NIP-50 plusfetch_verified_profilesotherwise.- Projection validation is back and accepts what the relay emits.
The full buzz-cli suite passes locally. I've added two small notes inline.
This is an outside contribution, so a human maintainer still needs to review it before merge.
Matches the --pubkey path: kind:0 matches are kept and a verified_profiles_unavailable warning goes to stderr. Document that valid_name is looser than the relay's NFC and category rules. Signed-off-by: damienrj <damien@squareup.com>
wpfleger96
left a comment
There was a problem hiding this comment.
🤖 Re-reviewed at 24a8cc6. All three of my earlier points are fixed: --pubkey and the no-argument lookup now return people who only have a verified profile, --name uses /profiles/search only when searchable is true and otherwise falls back to NIP-50 with verified profiles attached, and the projection checks are back, including the lower-id tie-break. The new --name fallback keeps kind:0 matches with a warning when the verified check fails, matching --pubkey. I found no new issues. LGTM.
joahg
left a comment
There was a problem hiding this comment.
🤖 Follow-up: 24a8cc6 addresses both of my open P3s. If NIP-11 discovery or the kind:30382 query fails, --name now keeps the kind:0 matches and prints a verified_profiles_unavailable warning on stderr. A failing /profiles/search on a searchable relay still errors, which is reasonable since that request is the search itself. The new test covers both failure branches and the healthy case. The valid_name and parse_projection docs now say their checks are looser than mobile's. The users:: and verified_profiles:: tests pass locally. No new findings.
This PR comes from outside the core maintainer group, so a human Buzz maintainer needs to review and approve it. This review is a comment only.
…ction-p * origin/main: (200 commits) fix(mobile): keep open shared sessions in Solo (#9704) fix(mobile): align channel indicators and Duo section menus (#9703) fix(mobile): allow person mentions in Solo chats (#9705) fix(mobile): let code scroll under the code block copy button (#9612) Transcribe Bestie hold recordings into text on device (#9645) feat(cli): show and search verified identity in users get (#9647) fix(mobile): keep agent poster up until the iOS video draws (#9688) test(relay): stop bridge cancel_fixture tests timing out on the first replica connect (#9691) Revert "feat(relay): support community-scoped NIP-AR artifacts" (#9689) feat(relay): add conditional Solo member role updates (#9667) feat(mobile): add saved channel section filters (#8479) feat(relay): support community-scoped NIP-AR artifacts (#9650) feat(mobile): add a diagnostics test report and test crash to Settings (#9676) fix(pubsub): round the rate-limit retry hint up from PTTL (#9552) feat(mobile): add diagnostic reporting module with crash capture (#9613) fix(mobile): recover stuck read-state updates and stale Mark Read (#9492) test(relay): refresh the author's membership cache after the stray-h private channel insert (#9640) fix(mobile): name the cause of account-unavailable sign-in errors (#9628) perf(db): bound deep keyset history pages by the cursor timestamp (#9549) feat(cli)!: consistent channels list/get/search output (type, visibility, labels, real created_at) (#9617) ... Signed-off-by: Matthew Boston <mboston@squareup.com>
…eaction-recipients * origin/main: (72 commits) fix(mobile): keep open shared sessions in Solo (#9704) fix(mobile): align channel indicators and Duo section menus (#9703) fix(mobile): allow person mentions in Solo chats (#9705) fix(mobile): let code scroll under the code block copy button (#9612) Transcribe Bestie hold recordings into text on device (#9645) feat(cli): show and search verified identity in users get (#9647) fix(mobile): keep agent poster up until the iOS video draws (#9688) test(relay): stop bridge cancel_fixture tests timing out on the first replica connect (#9691) Revert "feat(relay): support community-scoped NIP-AR artifacts" (#9689) feat(relay): add conditional Solo member role updates (#9667) feat(mobile): add saved channel section filters (#8479) feat(relay): support community-scoped NIP-AR artifacts (#9650) feat(mobile): add a diagnostics test report and test crash to Settings (#9676) fix(pubsub): round the rate-limit retry hint up from PTTL (#9552) feat(mobile): add diagnostic reporting module with crash capture (#9613) fix(mobile): recover stuck read-state updates and stale Mark Read (#9492) test(relay): refresh the author's membership cache after the stray-h private channel insert (#9640) fix(mobile): name the cause of account-unavailable sign-in errors (#9628) perf(db): bound deep keyset history pages by the cursor timestamp (#9549) feat(cli)!: consistent channels list/get/search output (type, visibility, labels, real created_at) (#9617) ... Signed-off-by: Matthew Boston <mboston@squareup.com>
…c-spec-mobile * origin/main: fix(mobile): keep glass controls mounted and the wide thread push parallax (#9726) fix(mobile): stabilize Duo chat switching and sheet layering (#9717) Require relay schema owner review for migrations and schema (#9708) fix(relay): resurface a hidden DM when someone else messages it (#9678) fix(deploy): pin self-host installs to relay 0.3.0 (#9714) fix(mobile): keep open shared sessions in Solo (#9704) fix(mobile): align channel indicators and Duo section menus (#9703) fix(mobile): allow person mentions in Solo chats (#9705) fix(mobile): let code scroll under the code block copy button (#9612) Transcribe Bestie hold recordings into text on device (#9645) feat(cli): show and search verified identity in users get (#9647) fix(mobile): keep agent poster up until the iOS video draws (#9688) test(relay): stop bridge cancel_fixture tests timing out on the first replica connect (#9691) Revert "feat(relay): support community-scoped NIP-AR artifacts" (#9689) feat(relay): add conditional Solo member role updates (#9667) feat(mobile): add saved channel section filters (#8479) feat(relay): support community-scoped NIP-AR artifacts (#9650) feat(mobile): add a diagnostics test report and test crash to Settings (#9676) fix(pubsub): round the rate-limit retry hint up from PTTL (#9552) feat(mobile): add diagnostic reporting module with crash capture (#9613) Signed-off-by: Will Pfleger <wpfleger@block.xyz> # Conflicts: # mobile/test/features/activity/activity_page_test.dart
…-workflow-verified-mentions * 'main' of https://github.com/block/buzz: (21 commits) chore: require relay owner review for the relay and db crates (#9728) fix(mobile): align Huddle cards and preserve conversation navigation (#9713) Match mobile mention chips to desktop styling (#9706) feat(relay): push mentions to people outside a listed channel (#9623) fix(db): undo migration 0097 (#9710) fix(mobile): keep glass controls mounted and the wide thread push parallax (#9726) fix(mobile): stabilize Duo chat switching and sheet layering (#9717) Require relay schema owner review for migrations and schema (#9708) fix(relay): resurface a hidden DM when someone else messages it (#9678) fix(deploy): pin self-host installs to relay 0.3.0 (#9714) fix(mobile): keep open shared sessions in Solo (#9704) fix(mobile): align channel indicators and Duo section menus (#9703) fix(mobile): allow person mentions in Solo chats (#9705) fix(mobile): let code scroll under the code block copy button (#9612) Transcribe Bestie hold recordings into text on device (#9645) feat(cli): show and search verified identity in users get (#9647) fix(mobile): keep agent poster up until the iOS video draws (#9688) test(relay): stop bridge cancel_fixture tests timing out on the first replica connect (#9691) Revert "feat(relay): support community-scoped NIP-AR artifacts" (#9689) feat(relay): add conditional Solo member role updates (#9667) ... Signed-off-by: Camilo Sanchez <camilos@squareup.com>
Moves the block/buzz revision that `src-tauri` depends on from `630922a9` to `e21606bf` (current block/buzz `main`). `scripts/build-buzz-cli.mjs` builds the bundled `buzz` CLI from this same revision, so the app now ships a CLI with these changes: - [block/buzz#9738](block/buzz#9738): `channels add-member` adds many members per event. - [block/buzz#9752](block/buzz#9752): `users get --name` leaves out archived users unless `--include-archived` is passed. - [block/buzz#9653](block/buzz#9653): raw query and publish commands. - [block/buzz#9647](block/buzz#9647): verified identity in `users get`. - [block/buzz#9617](block/buzz#9617): consistent `channels list/get/search` output (breaking). - [block/buzz#9684](block/buzz#9684): shared stars and mutes. `Cargo.lock` changes one line: the `buzz-audio-client` source rev. Its crate is byte-identical between the two revisions, so no other package or dependency edge moves, and `cargo check --locked` passes in `src-tauri`. The new CLI adds a top-level `raw` command, so the desktop's legacy-CLI guard (`src-tauri/src/legacy_cli_invocation.rs`) now recognizes `raw` too, with a native regression case (`raw publish` with a private payload that must not be echoed). Nothing in this repo parses `buzz channels list/get/search` output. The bundled-CLI smoke test (`scripts/test-buzz-cli.mjs`) reads only `--help` command names, and `legacy_cli_invocation.rs` matches only the top-level `channels` word. --------- Signed-off-by: Will Pfleger <wpfleger@block.xyz> Co-authored-by: Duncan <dcfd242e557282d7a1e2cf2e6877522682f1e5c6156dc92ca7d90eaedd3b0f95@buzz.block.builderlab.xyz>
Summary
buzz users getreads only kind:0 profiles, so the CLI can't find or confirm a person by their verified username. This adds relay-verified profiles (kind:30382) tousers get.--pubkeyadds averifiedobject (username,display_name,full_name,issuer_label,verified_at) for subjects that have one. A requested person with a verified profile but no kind:0 is still returned.--nameuses the relay'sPOST /profiles/searchwhen the community advertises verified profiles withsearchable: true, so it matches verified names (word prefix). Otherwise, or for queries over the endpoint's 100-character limit, it runs the existing NIP-50 substring search and attaches verified profiles where the community advertises them.Verified profiles are read only when NIP-11 advertises
federated_identity.public_profile. A projection is trusted only if it is kind 30382, signed by the relay'sselfkey with a valid signature, and follows the NIP-FI projection rules the mobile client applies: empty content, exactly the projection tags (each once with one value),pequal tod,activeset totrue, a valid username, names of 1–64 characters with no surrounding whitespace or control characters (looser than mobile, which also requires NFC and rejects more Unicode categories), and a decimalverified_atno later thancreated_at. The newest projection per subject wins (the lower id breaks a same-second tie), so a retraction clears the verified name. Anyverifiedkey in user-authored kind:0 content is dropped on every path, so only a relay-signed projection can set it.users getnow makes one NIP-11 request. If that request fails, the advertisement is malformed, or the kind:30382 lookup fails, it still prints the kind:0 results and writes averified_profiles_unavailablewarning to stderr. This applies to--pubkey, no args, and--name.Related issue
Related: #8745 (verified profile spec), #9624 (verified-name mentions in workflows).
Testing
cargo test -p buzz-clipasses, with tests for trust checks, retraction, both lookup paths, search without the advertisement, and a forgedverifiedobject in kind:0 (no advertisement, impostor-only projection, and a valid projection replacing it).cargo fmtandcargo clippy -p buzz-cli -D warningsare clean.--name <verified username>found a user whose kind:0 name differs, and--pubkeyreturned the expectedverifiedobjects.