[CI verification only] fix(relay): materialize NIP-OA owner for direct relay members - #1
Closed
rclod wants to merge 2 commits into
Closed
[CI verification only] fix(relay): materialize NIP-OA owner for direct relay members#1rclod wants to merge 2 commits into
rclod wants to merge 2 commits into
Conversation
… members The agent→owner backfill ran only when `require_relay_membership` was false. On a closed relay it never ran, and `enforce_relay_membership` does not fill the gap: it reports an owner only when it USED the delegation to admit the agent (`MembershipDecision::ViaOwner`). An agent that is also a direct relay member takes the `::Member` branch, which returns `Ok(None)` and discards a perfectly valid, cryptographically self-proving attestation. The result is that on a closed relay, any agent enrolled directly in `relay_members` has `users.agent_owner_pubkey` left NULL no matter what it sends. That column is not cosmetic — three behaviours derive from it: - `is_agent` in the admission path is `agent_owner_pubkey.is_some()`, so such agents are rate-limited at `human_messages_per_min` (60) rather than `agent_standard_messages_per_min` (120) - owner-managed agent lists have no relationship to display, so the agent is absent from them while still being DM-able - `channel_add_policy = "owner_only"` has no owner to compare against, so `add-member` fails with "policy:owner_only — agent has no owner set" for every actor, including the real owner Extraction now runs whenever an `auth` tag is present, independent of how membership was satisfied. No feature flag is needed, for the reason already documented on `extract_nip_oa_owner`: NIP-OA is cryptographically self-proving, so the tag's own verification is the security boundary — and that verification is unchanged. Also corrects two doc comments that described the old open-relay-only behaviour. Observed on a self-hosted closed relay (BUZZ_REQUIRE_RELAY_MEMBERSHIP=true) with an agent present in `relay_members` and sending a valid NIP-OA tag on its NIP-42 AUTH event: "NIP-42 auth successful" was logged, no materialization was attempted, and `agent_owner_pubkey` stayed NULL. Signed-off-by: rclod <3385524+rclod@users.noreply.github.com>
Dropped before the PR is opened. Signed-off-by: rclod <3385524+rclod@users.noreply.github.com>
Owner
Author
|
CI verified green (run 31967009636, 21 passed). Upstream PR: block#6078. |
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.
Fork-internal PR to run CI before opening the real PR against block/buzz. Not for merge; tracks block#6072.