From ed857631616052bc137c6b1d50368bfbf711210d Mon Sep 17 00:00:00 2001 From: Neissi Torres Lima Date: Mon, 24 Nov 2014 18:54:05 -0200 Subject: #59 Bruno/Neissi - adding signature status --- service/pixelated/adapter/mail.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'service/pixelated/adapter') diff --git a/service/pixelated/adapter/mail.py b/service/pixelated/adapter/mail.py index fc32366a..124a16b1 100644 --- a/service/pixelated/adapter/mail.py +++ b/service/pixelated/adapter/mail.py @@ -79,7 +79,7 @@ class Mail: 'ident': self.ident, 'tags': list(self.tags), 'status': list(self.status), - 'security_casing': {}, + 'security_casing': self.security_casing, 'body': self.body, 'mailbox': self.mailbox_name.lower(), 'attachments': self.parts['attachments'] if self.parts else [] @@ -243,7 +243,10 @@ class PixelatedMail(Mail): @property def security_casing(self): - return {} + casing = {"imprints": []} + if self.signed: + casing["imprints"].append({"state": "valid", "seal": {"validity": "valid"}}) + return casing @property def tags(self): @@ -304,3 +307,10 @@ class PixelatedMail(Mail): def has_tag(self, tag): return tag in self.tags + + @property + def signed(self): + return self.hdoc.content["headers"].get("X-Leap-Signature", "").startswith("valid") + + def encrypt(self): + pass -- cgit v1.2.3