~ar-python-hackers/authentication-results-python/trunk

« back to all changes in this revision

Viewing changes to authres/arc.py

  • Committer: Scott Kitterman
  • Date: 2018-10-30 03:44:32 UTC
  • Revision ID: scott@kitterman.com-20181030034432-mtoe0qvj31wavzjf
Tags: 1.1.1
--- 1.1.1 2018-10-30
  + Added ARC specific tags for draft-ietf-dmarc-arc-protocol-18 (as of IETF
    last call, still experimental), smtp.remote-ip and header.oldest-pass

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# coding: utf-8
2
2
 
3
3
# Copyright © 2017 Gene Shuman <gene@valimail.com>,
4
 
# Copyright © 2012-2013 Scott Kitterman <scott@kitterman.com>
 
4
# Copyright © 2012-2013, 2018 Scott Kitterman <scott@kitterman.com>
5
5
#
6
6
# Licensed under the Apache License, Version 2.0 (the "License");
7
7
# you may not use this file except in compliance with the License.
17
17
 
18
18
"""
19
19
authres extension module for the Authenticated Recieved Chain (ARC)
20
 
(draft-ietf-dmarc-arc-protocol-08) authentication method.
 
20
(draft-ietf-dmarc-arc-protocol-18) authentication method.
21
21
"""
22
22
 
23
23
#MODULE = 'authres'
30
30
 
31
31
class ARCAuthenticationResult(authres.core.AuthenticationResult):
32
32
    """
33
 
    ARC (draft-ietf-dmarc-arc-protocol-08) result clause of an
 
33
    ARC (draft-ietf-dmarc-arc-protocol-18) result clause of an
34
34
    ``Authentication-Results`` header
35
35
    Note: Still under development API subject to change."""
36
36
 
44
44
        header_ams_s                = None,  header_ams_s_comment                = None,
45
45
        header_as_d                 = None,  header_as_d_comment                 = None,
46
46
        header_as_s                 = None,  header_as_s_comment                 = None,
 
47
        header_oldest_pass          = None,  header_oldest_pass_comment          = None,
 
48
        smtp_remote_ip              = None,  smtp_remote_ip_comment              = None,
 
49
 
47
50
    ):
48
51
        authres.core.AuthenticationResult.__init__(self, self.METHOD, version,
49
52
            result, result_comment, reason, reason_comment, properties)
55
58
        if header_as_d_comment:                 self.header_as_d_comment             = header_as_d_comment
56
59
        if header_as_s:                         self.header_as_s                     = header_as_s
57
60
        if header_as_s_comment:                 self.header_as_s_comment             = header_as_s_comment
 
61
        if header_oldest_pass:                  self.header_oldest_pass              = header_oldest_pass
 
62
        if header_oldest_pass_comment:          self.header_oldest_pass_comment      = header_oldest_pass_comment
 
63
        if smtp_remote_ip:                      self.smtp_remote_ip                  = smtp_remote_ip
 
64
        if smtp_remote_ip_comment:              self.smtp_remote_ip_comment          = smtp_remote_ip_comment
58
65
 
59
66
    header_ams_d,             header_ams_d_comment             = make_result_class_properties('header', 'ams-d')
60
67
    header_ams_s,             header_ams_s_comment             = make_result_class_properties('header', 'ams-s')
61
68
    header_as_d,              header_ams_d_comment             = make_result_class_properties('header', 'as-d')
62
69
    header_as_s,              header_ams_s_comment             = make_result_class_properties('header', 'as-s')
 
70
    header_oldest_pass,       header_oldest_pass_comment       = make_result_class_properties('header', 'oldest-pass')
 
71
    smtp_remote_ip,           smtp_remote_ip_comment           = make_result_class_properties('smtp', 'remote-ip')
63
72
 
64
73
RESULT_CLASSES = [
65
74
    ARCAuthenticationResult