Skip to content

Commit

Permalink
Merge pull request #106 from bndw/master
Browse files Browse the repository at this point in the history
feat: Add authed pubkey to ReqAccepter
  • Loading branch information
mattn authored Nov 28, 2023
2 parents f5a2ca4 + bf5df12 commit 18544e7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ func (s *Server) doReq(ctx context.Context, ws *WebSocket, request []json.RawMes
}

if accepter, ok := s.relay.(ReqAccepter); ok {
if !accepter.AcceptReq(ctx, id, filters) {
if !accepter.AcceptReq(ctx, id, filters, ws.authed) {
return "REQ filters are not accepted"
}
}
Expand Down
2 changes: 1 addition & 1 deletion interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ type ReqAccepter interface {
// AcceptReq is called for every nostr request filters received by the
// server. If the returned value is true, the filtres is passed on to
// [Storage.QueryEvent].
AcceptReq(context.Context, string, nostr.Filters) bool
AcceptReq(ctx context.Context, id string, filters nostr.Filters, authedPubkey string) bool
}

// Auther is the interface for implementing NIP-42.
Expand Down

0 comments on commit 18544e7

Please sign in to comment.