Add SendBlue iMessage integration with admin-only access

- New imessage blueprint: webhook receives inbound iMessages, runs through
  LangChain agent, replies via SendBlue REST API
- Admin-only: only users with lldap_admin group can use iMessage channel
- Admin endpoints to link/unlink imessage_number on user accounts
- Add imessage_number field to User model (needs aerich migration)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-03 19:22:15 -04:00
parent 02dd3df1f9
commit 20576cabf3
5 changed files with 322 additions and 37 deletions
+9 -2
View File
@@ -10,11 +10,18 @@ class User(Model):
username = fields.CharField(max_length=255)
password = fields.BinaryField(null=True) # Hashed - nullable for OIDC users
email = fields.CharField(max_length=100, unique=True)
whatsapp_number = fields.CharField(max_length=30, unique=True, null=True, index=True)
whatsapp_number = fields.CharField(
max_length=30, unique=True, null=True, index=True
)
imessage_number = fields.CharField(
max_length=30, unique=True, null=True, index=True
)
# Email channel fields
email_enabled = fields.BooleanField(default=False)
email_hmac_token = fields.CharField(max_length=16, unique=True, null=True, index=True)
email_hmac_token = fields.CharField(
max_length=16, unique=True, null=True, index=True
)
# OIDC fields
oidc_subject = fields.CharField(