Merge main into feat-add-invite-api and adapt the invite API

Resolve the conflicts with the cluster and endpoint changes and align the
new peer_invite route with the other API v2 routes: instance access through
validate_api_key, peer selection by uuid or public key, endpoint peers
refused, email invites only when enabled, existing invites renewed and the
send_email mock pointing to the view module.
This commit is contained in:
Eduardo Silva
2026-11-24 11:23:47 -03:00
261 changed files with 34572 additions and 9800 deletions
+3
View File
@@ -5,6 +5,7 @@ import smtplib
import subprocess
from datetime import timedelta
from email.mime.text import MIMEText
from email.utils import formatdate, make_msgid
from django.core.exceptions import ValidationError
from django.core.validators import validate_email
@@ -190,6 +191,8 @@ def send_email(destination, subject, body):
msg['Subject'] = subject
msg['From'] = email_settings.smtp_from_address
msg['To'] = destination
msg['Date'] = formatdate(localtime=True)
msg['Message-ID'] = make_msgid(domain=email_settings.smtp_from_address.split('@')[-1])
if email_settings.smtp_encryption.lower() == 'ssl':
server = smtplib.SMTP_SSL(email_settings.smtp_host, email_settings.smtp_port)