khatru: support multi-user auth.

This commit is contained in:
fiatjaf
2025-09-06 10:11:31 -03:00
parent 8750197ea7
commit fd53d7309f
4 changed files with 53 additions and 20 deletions

View File

@@ -22,14 +22,12 @@ type WebSocket struct {
cancel context.CancelFunc
// nip42
Challenge string
AuthedPublicKey nostr.PubKey
Authed chan struct{}
Challenge string
AuthedPublicKeys []nostr.PubKey
authLock sync.Mutex
// nip77
negentropySessions *xsync.MapOf[string, *NegentropySession]
authLock sync.Mutex
}
func (ws *WebSocket) WriteJSON(any any) error {