Skip to content

fix(relay): owner_only rejection names the agent owner who can act (#4225) - #4264

Open
iroiro147 wants to merge 1 commit into
block:mainfrom
iroiro147:fix/4225-owner-only-message
Open

fix(relay): owner_only rejection names the agent owner who can act (#4225)#4264
iroiro147 wants to merge 1 commit into
block:mainfrom
iroiro147:fix/4225-owner-only-message

Conversation

@iroiro147

Copy link
Copy Markdown

What

When a community owner/admin tries to add an agent to a channel and the agent's
channel_add_policy is owner_only, the relay rejected them with:

policy:owner_only — only the agent owner can add this agent

…but never said who the owner is. Address #4225.

Changes

  • crates/buzz-relay/src/handlers/side_effects.rs
    • Extract the rejection string into a pure helper, owner_only_rejection.
    • Include the agent owner's hex pubkey in the message so the rejected actor
      knows exactly which key is authorized to perform the add:
      policy:owner_only — only the agent owner (<hex-pubkey>) can add this agent
      
    • The policy:owner_only tag is preserved for downstream pattern-matching.
  • crates/buzz-test-client/tests/e2e_relay.rs
    • Strengthen the existing test_nip29_put_user_owner_only_blocks assertion to
      also require the rejection to say who can act.

Tests

  • New unit test owner_only_rejection_message_names_owner_pubkey covers the
    helper: contains policy:owner_only, the owner hex, and the action denial.
  • Existing e2e gate extended (assertion-only; unchanged actors).
  • Suite receipts: cargo test -p buzz-relay --lib side_effects 6/6 pass;
    cargo test -p buzz-relay --lib bridge 59/59 pass; full workspace
    buzz-workflow --lib 153/153 pass.

Out of scope / pre-existing

The broader buzz-relay --lib suite has nine pre-existing failures in
api::media and api::admin (500 vs 404 assertion mismatches) that reproduce
on main and are unrelated to this change.

Refs #4225

…lock#4225)

The kind:9000 third-party-add rejection for channel_add_policy=owner_only just
said "only the agent owner can add this agent" without identifying the owner,
leaving community owners/admins guessing who to contact.

Format the rejection with the agent owner's hex pubkey in the message so the
actor knows exactly which key is authorized. Extract the message construction
into a pure helper (owner_only_rejection) and cover it with a unit test; extend
the existing e2e_relay owner_only gate assertion to require the message to say
who can act.

Refs block#4225

Signed-off-by: Sarthak Singh <sarthak.singh@juspay.in>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant