Add NIP-05 verification compatibility

This commit is contained in:
Danielle McLean 2023-08-10 18:05:46 +10:00
parent 2e7d12b3e6
commit 04bd6dd35d
Signed by: 00dani
GPG key ID: 52C059C3B22A753E
6 changed files with 65 additions and 0 deletions

View file

@ -81,6 +81,19 @@ class User(ModelMeta, AbstractUser):
help_text="SHA-256 hash of the user's OpenID URL, used for Libravatar",
)
nostr_key = models.CharField(
max_length=32,
unique=True,
blank=True,
null=True,
help_text="A Nostr public key in 32-byte hex format",
)
nostr_relays = models.JSONField(
default=list,
blank=True,
help_text="An array of Nostr relay URLs that this public key posts to",
)
@property
def calc_email_md5(self):
return md5(self.email.lower().encode("utf-8")).hexdigest()