feat(nip43): add join/leave request event strategies#676
Draft
Anshumancanrock wants to merge 1 commit into
Draft
feat(nip43): add join/leave request event strategies#676Anshumancanrock wants to merge 1 commit into
Anshumancanrock wants to merge 1 commit into
Conversation
Wire InviteCodeRepository through the factory chain and add event strategies for NIP-43 access request kinds: - kind 28934 (Join Request): validates NIP-42 auth, extracts claim tag, atomically claims invite code, admits user - kind 28936 (Leave Request): validates NIP-42 auth, checks membership, revokes admission Pipeline changes: - Route NIP-43 kinds before the ephemeral catch-all (prevents broadcast) - Bypass isUserAdmitted for join/leave (they ARE the admission flow) - Bypass checkNip05Verification for join/leave (new users have no record) - Remove stale knip.json ignore for invite-code-repository Includes unit tests for both strategies and updated factory tests.
🦋 Changeset detectedLatest commit: 9c2ce97 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Collaborator
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.
Description
Adds event strategies for NIP-43 join (kind 28934) and leave (kind 28936) requests.
When a client sends a join request with an invite code, the relay validates NIP-42 auth, atomically claims the code, and admits the user. Leave requests revoke admission after verifying membership.
Also wires
InviteCodeRepositorythrough the factory chain, adds pipeline bypasses so join/leave events aren't blocked by admission or NIP-05 checks (since they are the admission flow), and advertises NIP-43 in the NIP-11 document.Related Issue
Continuation of #650 (NIP-43 invite code foundation).
Motivation and Context
NIP-43 defines how relays handle membership-based access control. #650 laid the database layer and this PR adds the handler layer so the relay can actually process join/leave requests from clients.
How Has This Been Tested?
Types of changes
Checklist: