fix(relay): owner_only rejection names the agent owner who can act (#4225) - #4264
Open
iroiro147 wants to merge 1 commit into
Open
fix(relay): owner_only rejection names the agent owner who can act (#4225)#4264iroiro147 wants to merge 1 commit into
iroiro147 wants to merge 1 commit into
Conversation
…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>
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.
What
When a community owner/admin tries to add an agent to a channel and the agent's
channel_add_policyisowner_only, the relay rejected them with:…but never said who the owner is. Address #4225.
Changes
crates/buzz-relay/src/handlers/side_effects.rsowner_only_rejection.knows exactly which key is authorized to perform the add:
policy:owner_onlytag is preserved for downstream pattern-matching.crates/buzz-test-client/tests/e2e_relay.rstest_nip29_put_user_owner_only_blocksassertion toalso require the rejection to say who can act.
Tests
owner_only_rejection_message_names_owner_pubkeycovers thehelper: contains
policy:owner_only, the owner hex, and the action denial.cargo test -p buzz-relay --lib side_effects6/6 pass;cargo test -p buzz-relay --lib bridge59/59 pass; full workspacebuzz-workflow --lib153/153 pass.Out of scope / pre-existing
The broader
buzz-relay --libsuite has nine pre-existing failures inapi::mediaandapi::admin(500 vs 404 assertion mismatches) that reproduceon
mainand are unrelated to this change.Refs #4225