Merge lp:~valimail/authentication-results-python/gene into lp:authentication-results-python/0.6

Proposed by Scott Kitterman
Status: Merged
Merge reported by: Scott Kitterman
Merged at revision: not available
Proposed branch: lp:~valimail/authentication-results-python/gene
Merge into: lp:authentication-results-python/0.6
Diff against target: 61 lines (+19/-13)
2 files modified
authres/arc.py (+17/-11)
authres/tests (+2/-2)
To merge this branch: bzr merge lp:~valimail/authentication-results-python/gene
Reviewer Review Type Date Requested Status
Scott Kitterman Approve
Review via email: mp+328597@code.launchpad.net

Commit message

Merge ARC updates.

To post a comment you must log in.
Revision history for this message
Scott Kitterman (kitterman) wrote :

Ship it.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'authres/arc.py'
2--- authres/arc.py 2017-07-14 05:28:08 +0000
3+++ authres/arc.py 2017-08-04 18:49:56 +0000
4@@ -40,23 +40,29 @@
5 result = None, result_comment = None,
6 reason = None, reason_comment = None,
7 properties = None,
8- header_d = None, header_d_comment = None,
9+ header_ams_d = None, header_ams_d_comment = None,
10+ header_ams_s = None, header_ams_s_comment = None,
11+ header_as_d = None, header_as_d_comment = None,
12+ header_as_s = None, header_as_s_comment = None,
13 ):
14 authres.core.AuthenticationResult.__init__(self, self.METHOD, version,
15 result, result_comment, reason, reason_comment, properties)
16- if header_d: self.header_d = header_d
17- if header_d_comment: self.header_d_comment = header_d_comment
18-
19- header_d, header_d_comment = make_result_class_properties('header', 'd')
20-
21- def match_signature(self, signature_d):
22- """Match authentication result against a ARC signature by ``header.d``."""
23-
24- return self.header_d == signature_d
25+ if header_ams_d: self.header_ams_d = header_ams_d
26+ if header_ams_d_comment: self.header_ams_d_comment = header_ams_d_comment
27+ if header_ams_s: self.header_ams_s = header_ams_s
28+ if header_ams_s_comment: self.header_ams_s_comment = header_ams_s_comment
29+ if header_as_d: self.header_as_d = header_as_d
30+ if header_as_d_comment: self.header_as_d_comment = header_as_d_comment
31+ if header_as_s: self.header_as_s = header_as_s
32+ if header_as_s_comment: self.header_as_s_comment = header_as_s_comment
33+
34+ header_ams_d, header_ams_d_comment = make_result_class_properties('header', 'ams-d')
35+ header_ams_s, header_ams_s_comment = make_result_class_properties('header', 'ams-s')
36+ header_as_d, header_ams_d_comment = make_result_class_properties('header', 'as-d')
37+ header_as_s, header_ams_s_comment = make_result_class_properties('header', 'as-s')
38
39 RESULT_CLASSES = [
40 ARCAuthenticationResult
41 ]
42
43 # vim:sw=4 sts=4
44-
45
46=== modified file 'authres/tests'
47--- authres/tests 2017-07-13 05:10:33 +0000
48+++ authres/tests 2017-08-04 18:49:56 +0000
49@@ -529,10 +529,10 @@
50 >>> import authres
51 >>> import authres.arc
52 >>> arc_pass = authres.arc.ARCAuthenticationResult(result = 'pass',
53-... header_d = 'example.net')
54+... header_ams_d = 'example.net', header_ams_s='valimail2016', header_as_d="example.com", header_as_s="valimail2017")
55 >>> str(authres.AuthenticationResultsHeader(authserv_id = 'example.com',
56 ... results = [arc_pass]))
57-'Authentication-Results: example.com; arc=pass header.d=example.net'
58+'Authentication-Results: example.com; arc=pass header.ams-d=example.net header.ams-s=valimail2016 header.as-d=example.com header.as-s=valimail2017'
59
60 # Parsing IP6 address.
61 >>> arobj = authres_context.parse('Authentication-Results: mail.bmsi.com; iprev=pass policy.iprev="2001:748:100:40::2:2" (mout0.freenet.de); spf=none smtp.mailfrom=markuslaudi@freenet.de')

Subscribers

People subscribed via source and target branches