From 7b37ad6479028bf6f1b71f06ab3125b13c92e93a Mon Sep 17 00:00:00 2001 From: Asara Date: Thu, 15 Aug 2024 19:38:40 -0400 Subject: [PATCH] fix: nostr auth --- nostr/nostr.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/nostr/nostr.go b/nostr/nostr.go index d2b2626..5faf191 100644 --- a/nostr/nostr.go +++ b/nostr/nostr.go @@ -145,11 +145,17 @@ func NewRelay(version string) *khatru.Relay { relay.RejectFilter = append( relay.RejectFilter, + testfilter, policies.RejectKind04Snoopers, ) return relay } +func testfilter(ctx context.Context, filter nostr.Filter) (bool, string) { + l.Debug().Msgf("test: %v", ctx) + return true, "auth-required: this query requires you to be authenticated" +} + func RejectUnregisteredNpubs(ctx context.Context, event *nostr.Event) (reject bool, msg string) { l := gologger.Get(config.GetConfig().LogLevel).With().Str("context", "nostr-reject-unregistered").Logger() authenticatedUser := khatru.GetAuthed(ctx)