]> git.ipfire.org Git - thirdparty/python-fints.git/commitdiff
Add HITANS versions 1 through 4
authorHenryk Plötz <henryk@ploetzli.ch>
Sun, 29 Jul 2018 08:45:37 +0000 (10:45 +0200)
committerRaphael Michel <mail@raphaelmichel.de>
Mon, 30 Jul 2018 06:53:44 +0000 (08:53 +0200)
fints/message.py
fints/models.py

index 4c7f87cba67c517d04acc93225c94442a8c34fcd..f7120a273e446cbd242354e6bf076982f587de0e 100644 (file)
@@ -1,7 +1,7 @@
 import random
 import re
 
-from fints.models import TANMethod5, TANMethod6
+from fints.models import TANMethod1, TANMethod2, TANMethod3, TANMethod4, TANMethod5, TANMethod6
 from fints.utils import split_for_data_groups, split_for_data_elements, fints_unescape
 from .segments.message import HNHBK, HNHBS, HNSHA, HNSHK, HNVSD, HNVSK
 
@@ -155,7 +155,15 @@ class FinTSResponse:
         methods = []
         for s in seg:
             spl = split_for_data_elements(s)
-            if spl[2] == '5':
+            if spl[2] == '1':
+                model = TANMethod1
+            elif spl[2] == '2':
+                model = TANMethod2
+            elif spl[2] == '3':
+                model = TANMethod3
+            elif spl[2] == '4':
+                model = TANMethod4
+            elif spl[2] == '5':
                 model = TANMethod5
             elif spl[2] == '6':
                 model = TANMethod6
index b53422ea0db9447f3338baac9007655a4baa7bf3..df4eb948adb31c793967d3257f4f47b5ba6726a1 100644 (file)
@@ -27,6 +27,118 @@ class TANMethod(DataClass):
     pass
 
 
+class TANMethod1(TANMethod):
+    """
+    :param security_feature:
+    :param tan_process:
+    :param tech_id:
+    :param name:
+    :param max_length_input:
+    :param allowed_format:
+    :param text_returnvalue:
+    :param max_length_returnvalue:
+    :param number_of_supported_lists:
+    :param multiple_tans_allowed:
+    :param tan_time_delayed_allowed:
+    """
+    # Source: PIN/TAN docs – Verfahrensparameter Zwei-Schritt-Verfahren, Elementversion #1
+    version = 1
+    args = ['security_feature', 'tan_process', 'tech_id', 'name', 'max_length_input', 'allowed_format',
+            'text_returnvalue', 'max_length_returnvalue', 'number_of_supported_lists', 'multiple_tans_allowed',
+            'tan_time_delayed_allowed']
+
+
+class TANMethod2(TANMethod):
+    """
+    :param security_feature:
+    :param tan_process:
+    :param tech_id:
+    :param name:
+    :param max_length_input:
+    :param allowed_format:
+    :param text_returnvalue:
+    :param max_length_returnvalue:
+    :param number_of_supported_lists:
+    :param multiple_tans_allowed:
+    :param tan_time_dialog_association:
+    :param tan_list_number_required:
+    :param cancel_allowed:
+    :param challenge_class_required:
+    :param challenge_value_required:
+    """
+    # Source: PIN/TAN docs – Verfahrensparameter Zwei-Schritt-Verfahren, Elementversion #2
+    version = 2
+    args = ['security_feature', 'tan_process', 'tech_id', 'name', 'max_length_input', 'allowed_format',
+            'text_returnvalue', 'max_length_returnvalue', 'number_of_supported_lists', 'multiple_tans_allowed',
+            'tan_time_dialog_association', 'tan_list_number_required', 'cancel_allowed', 'challenge_class_required',
+            'challenge_value_required']
+
+
+
+class TANMethod3(TANMethod):
+    """
+    :param security_feature:
+    :param tan_process:
+    :param tech_id:
+    :param name:
+    :param max_length_input:
+    :param allowed_format:
+    :param text_returnvalue:
+    :param max_length_returnvalue:
+    :param number_of_supported_lists:
+    :param multiple_tans_allowed:
+    :param tan_time_dialog_association:
+    :param tan_list_number_required:
+    :param cancel_allowed:
+    :param challenge_class_required:
+    :param challenge_value_required:
+    :param initialization_mode:
+    :param description_required:
+    :param supported_media_number:
+    """
+    # Source: PIN/TAN docs – Verfahrensparameter Zwei-Schritt-Verfahren, Elementversion #3
+    version = 3
+    args = ['security_feature', 'tan_process', 'tech_id', 'name', 'max_length_input', 'allowed_format',
+            'text_returnvalue', 'max_length_returnvalue', 'number_of_supported_lists', 'multiple_tans_allowed',
+            'tan_time_dialog_association', 'tan_list_number_required', 'cancel_allowed', 'challenge_class_required',
+            'challenge_value_required', 'initialization_mode', 'description_required', 'supported_media_number']
+
+
+class TANMethod4(TANMethod):
+    """
+    :param security_feature:
+    :param tan_process:
+    :param tech_id:
+    :param zka_id:
+    :param zka_version:
+    :param name:
+    :param max_length_input:
+    :param allowed_format:
+    :param text_returnvalue:
+    :param max_length_returnvalue:
+    :param number_of_supported_lists:
+    :param multiple_tans_allowed:
+    :param tan_time_dialog_association:
+    :param tan_list_number_required:
+    :param cancel_allowed:
+    :param sms_charge_account_required:
+    :param challenge_class_required:
+    :param challenge_value_required:
+    :param challenge_structured
+    :param initialization_mode:
+    :param description_required:
+    :param supported_media_number:
+    """
+    # Source: PIN/TAN docs – Verfahrensparameter Zwei-Schritt-Verfahren, Elementversion #4
+    version = 4
+    args = ['security_feature', 'tan_process', 'tech_id', 'zka_id', 'zka_version', 'name', 'max_length_input',
+            'allowed_format', 'text_returnvalue', 'max_length_returnvalue', 'number_of_supported_lists',
+            'multiple_tans_allowed', 'tan_time_dialog_association', 'tan_list_number_required', 'cancel_allowed',
+            'sms_charge_account_required', 'challenge_class_required', 'challenge_value_required',
+            'challenge_structured', 'initialization_mode', 'description_required', 'supported_media_number']
+
+
+
 class TANMethod5(TANMethod):
     """
     :param security_feature: