From f04297d570f5c79e4f0d1208798275cdb6a952d6 Mon Sep 17 00:00:00 2001 From: Helmut Merz Date: Sun, 9 Mar 2025 09:31:59 +0100 Subject: [PATCH] provide DummyMailDelivery for testing; fix auth --- scopes/organize/mail.py | 16 ++++++++++++++++ scopes/server/auth.py | 3 +++ 2 files changed, 19 insertions(+) create mode 100644 scopes/organize/mail.py diff --git a/scopes/organize/mail.py b/scopes/organize/mail.py new file mode 100644 index 0000000..6871741 --- /dev/null +++ b/scopes/organize/mail.py @@ -0,0 +1,16 @@ +# scopes.organize.mail + +from zope.interface import implementer +from zope.sendmail.interfaces import IMailDelivery + +"""Utilities for creating and sending emails.""" + + +@implementer(IMailDelivery) +class DummyMailDelivery: + """For testing purposes: just store mails in maildata.log""" + + def send(self, fromaddr, toaddrs, message): + print("DummyMailDelivery") + print(f"fromaddr: {fromaddr}, toaddrs: {toaddrs}") + print(message) diff --git a/scopes/server/auth.py b/scopes/server/auth.py index 3a75432..06c933d 100644 --- a/scopes/server/auth.py +++ b/scopes/server/auth.py @@ -34,3 +34,6 @@ class JwtAuthentication: if self.baseAuth is not None: return self.baseAuth.unauthorized(id, request) + def logout(self, request): + print('*** JwtAuthentication: logout') +