fix: nostr auth

This commit is contained in:
Amarpreet Minhas 2024-08-15 19:38:40 -04:00
parent 2fdd3da9d0
commit 7b37ad6479

View file

@ -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)