card_key_provider: pass CardKeyFieldCryptor to constructor

We currently create the CardKeyFieldCryptor object inside the constructor
of the concrete CardKeyProvider classes. There is currently no problem
with that, but when we create the CardKeyFieldCryptor object first and
then pass it as parameter to the constructor, we gain more flexibility
in case we want to support other CardKeyFieldCryptor variants in the
future.

Related: SYS#6959
Change-Id: If43552740aadacab9126f8a002749a9582eef8f4
This commit is contained in:
Philipp Maier
2026-05-07 12:50:10 +02:00
parent 3cd5c41fb4
commit 58a324126e
2 changed files with 11 additions and 9 deletions
+2 -1
View File
@@ -20,7 +20,8 @@ class TestCardKeyProviderCsv(unittest.TestCase):
"KIK3" : "00010204040506070809488B0C0D0E0F"}
csv_file_path = os.path.dirname(os.path.abspath(__file__)) + "/test_card_key_provider.csv"
card_key_provider_register(CardKeyProviderCsv(csv_file_path, column_keys))
card_key_field_cryptor = CardKeyFieldCryptor(column_keys)
card_key_provider_register(CardKeyProviderCsv(csv_file_path, card_key_field_cryptor))
super().__init__(*args, **kwargs)
def test_card_key_provider_get(self):