mirror of
https://github.com/jeremyd/ergo.git
synced 2026-08-09 07:13:05 -07:00
eb43ff69c4
Rebuilt the nostr registration feature cleanly on top of current ergo mainline (origin/master), dropping the stale ergo reversions that were entangled in the original squashed branch. - New irc/nostr package: NIP-04/NIP-17 DMs, NIP-05 resolution, relay connect/auth, and identifier helpers. - Registration/verification via nostr: parseCallback auto-detects nostr identifiers (NIP-05, npub, hex pubkey) and dispatches a verification DM. - Nostr-based cloaked hostnames for accounts (opt-in via ip-cloaking.nostr-hostnames), applied at the account-cloak sites. - Config: accounts.registration.nostr-verification and the nostr-hostnames cloak option, with matching default.yaml and help text. - Adds github.com/nbd-wtf/go-nostr and vendored dependencies.
38 lines
1.5 KiB
Go
38 lines
1.5 KiB
Go
// Copyright (c) 2024 Ergo Contributors
|
|
// released under the MIT license
|
|
|
|
package nostr
|
|
|
|
import "errors"
|
|
|
|
var (
|
|
// Identifier validation errors
|
|
ErrInvalidNostrIdentifier = errors.New("invalid nostr identifier format")
|
|
ErrInvalidPubkeyFormat = errors.New("invalid pubkey format")
|
|
ErrInvalidPubkeyLength = errors.New("invalid pubkey length")
|
|
ErrInvalidHexFormat = errors.New("invalid hex format")
|
|
ErrInvalidPrivkeyLength = errors.New("invalid private key length")
|
|
ErrInvalidNpubPrefix = errors.New("invalid npub prefix")
|
|
|
|
// NIP-05 resolution errors
|
|
ErrNIP05ResolutionFailed = errors.New("NIP-05 resolution failed")
|
|
ErrNIP05NotFound = errors.New("NIP-05 address not found")
|
|
ErrNIP05InvalidResponse = errors.New("invalid NIP-05 response")
|
|
ErrNIP05HTTPError = errors.New("HTTP error during NIP-05 resolution")
|
|
ErrNIP05PubkeyNotFound = errors.New("pubkey not found in NIP-05 response")
|
|
|
|
// Relay discovery errors
|
|
ErrRelayDiscoveryFailed = errors.New("relay discovery failed")
|
|
ErrNoInboxRelaysFound = errors.New("no inbox relays found")
|
|
ErrRelayConnectionFailed = errors.New("relay connection failed")
|
|
ErrRelayAuthFailed = errors.New("relay authentication failed")
|
|
|
|
// DM sending errors
|
|
ErrDMSendFailed = errors.New("DM send failed")
|
|
ErrDMEncryptionFailed = errors.New("DM encryption failed")
|
|
ErrNostrKeyNotConfigured = errors.New("nostr private key not configured")
|
|
|
|
// Decoding errors
|
|
ErrNpubDecodingFailed = errors.New("npub decoding failed")
|
|
)
|