|
|
@@ -324,6 +324,19 @@ func (m *ManagementStore) ValidateJoinRequest(event nostr.Event) (reject bool, e
|
|
|
|
return true, "invalid: failed to validate invite code"
|
|
|
|
return true, "invalid: failed to validate invite code"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Signing
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// SignEvent signs an unsigned event template with the relay's own (self) key and
|
|
|
|
|
|
|
|
// returns the full signed event. Used by relay admins to mint events on behalf of
|
|
|
|
|
|
|
|
// the relay — e.g. NIP-43 relay-level role events (NIP-86 signevent).
|
|
|
|
|
|
|
|
func (m *ManagementStore) SignEvent(event nostr.Event) (nostr.Event, error) {
|
|
|
|
|
|
|
|
if err := m.Config.Sign(&event); err != nil {
|
|
|
|
|
|
|
|
return event, err
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return event, nil
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Middleware
|
|
|
|
// Middleware
|
|
|
|
|
|
|
|
|
|
|
|
func (m *ManagementStore) Enable(instance *Instance) {
|
|
|
|
func (m *ManagementStore) Enable(instance *Instance) {
|
|
|
@@ -386,4 +399,8 @@ func (m *ManagementStore) Enable(instance *Instance) {
|
|
|
|
instance.Relay.ManagementAPI.ListBannedEvents = func(ctx context.Context) ([]nip86.IDReason, error) {
|
|
|
|
instance.Relay.ManagementAPI.ListBannedEvents = func(ctx context.Context) ([]nip86.IDReason, error) {
|
|
|
|
return m.GetBannedEventItems(), nil
|
|
|
|
return m.GetBannedEventItems(), nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
instance.Relay.ManagementAPI.SignEvent = func(ctx context.Context, event nostr.Event) (nostr.Event, error) {
|
|
|
|
|
|
|
|
return m.SignEvent(event)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|