From 905732e33c00155250caf57bfe7e51ad1a940bcc Mon Sep 17 00:00:00 2001 From: vasileios Date: Wed, 4 Sep 2024 09:14:20 +0200 Subject: [PATCH] [#4582] Added tests for the weekly task --- .../tests/files/digid/metadata_with_slo_POST | 85 +++++++++++++++++ .../tests/files/eherkenning/metadata | 92 +++++++++++++++++++ .../authentication/tests/test_tasks.py | 60 ++++++++++++ 3 files changed, 237 insertions(+) create mode 100644 src/openforms/authentication/tests/files/digid/metadata_with_slo_POST create mode 100644 src/openforms/authentication/tests/files/eherkenning/metadata create mode 100644 src/openforms/authentication/tests/test_tasks.py diff --git a/src/openforms/authentication/tests/files/digid/metadata_with_slo_POST b/src/openforms/authentication/tests/files/digid/metadata_with_slo_POST new file mode 100644 index 0000000000..b72ee9025f --- /dev/null +++ b/src/openforms/authentication/tests/files/digid/metadata_with_slo_POST @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + DNT82s99BhXBIvewrpNSnBnuACmZFAKg7Ze+rZmflcQ= + + + + gDvJjFd221rI7Y6JT6IFNRr9L1JVQgXiOSx62zfy0Qx7wZTjx1ngs+eOcRloHEdIKBd/BCDQGl10VakEmmzB1OYcuR2V5mq7IdR+lIJb+eoKO1dhc6IK+F2vfWCUxphYUDbfWBE0U06YvSI4di2j0CISMXUbbNiO8DeFWI6/NYuiRimONpRomjwz1X+nR1Aaw58A8hrqiYKMZzMDHL2wJ7haK5ZKv3lWtACpSMYcdNXAzo2le9T0IyZjNUlkGtgHH2UyjDUL1OcZnvMSpd3lHFc6HkUfkbrGmJecNJWZyXT+7BH2HxaYFW0jQEYaTw7vyYatYf0HTNqfcN4VePU7Ww== + + 2e9046aba2e95ed07efb655f6f50880ef686e531 + + + + + + 2e9046aba2e95ed07efb655f6f50880ef686e531 + + MIICsjCCAZqgAwIBAgIJAJhvbn1Aal/aMA0GCSqGSIb3DQEBCwUAMBExDzANBgNV + BAMMBnVidW50dTAeFw0xNzEyMjkxNjI3NDhaFw0yNzEyMjcxNjI3NDhaMBExDzAN + BgNVBAMMBnVidW50dTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAObY + RaZaguRBRowjJraDM8A7VpcWi+aIzYc0003gmz1j+/31pQ7QX12cCFAnyo+6bFlQ + Or8/Qda24yIAsaaj96Z3iA4bWDUARLUD8N6gftI8sZwf1JRW6kgwYn3DiLdhDeKd + 8LsrraUzHK/CXccCt5xM6t7gsgBoJvMNmy2ddpuh6T5xLQpREcI9JVqAihRa33ty + PMDk4QzPYjKsshYfFqlpRz6Zb3SMUnqjhRlWKyF/QgviNdrK8w1xlx6ix/oVruOP + P4qSl5vOmGk49CRqWY7IWciD2VHcH04fVfjhwPsh4Dv7uTaMLHwyGvJ8XFjK6yef + aiSODBsnb+bqKe8jWssCAwEAAaMNMAswCQYDVR0TBAIwADANBgkqhkiG9w0BAQsF + AAOCAQEAWOjsjh9NxJ5Lu5bGsNQecxheCtkv6WdTB4O5+z60qVNxQZrwQkPbnTQm + yAfTxR/VubLGqJ3mYU5YsqKJ2Z9Cqvc3wIPXLkruv5A1RwDv0eb0R/UE5nF/nKQR + B3yn9AYVrzu5kNlpFr/hK6brqfznMKPT6K4n9jMdUg9Bek9b2j8vG7L/Jgona43K + e7Ip6lACOP0q5PQvrKIkkdfh5QbZjrCQnUVRsScDh/qjWS01rYUp9z7rfuEuQNt5 + TPNMhvmH+podlP9zgONDdwYsjdP59+pFIRebf3Qlkd2nNk6AfL4oFpacr8x7EuHx + QJZ5MqEauEhsXVSP+gFGywjSsYHMHg== + + + + + + + 2e9046aba2e95ed07efb655f6f50880ef686e531 + + MIICsjCCAZqgAwIBAgIJAJhvbn1Aal/aMA0GCSqGSIb3DQEBCwUAMBExDzANBgNV + BAMMBnVidW50dTAeFw0xNzEyMjkxNjI3NDhaFw0yNzEyMjcxNjI3NDhaMBExDzAN + BgNVBAMMBnVidW50dTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAObY + RaZaguRBRowjJraDM8A7VpcWi+aIzYc0003gmz1j+/31pQ7QX12cCFAnyo+6bFlQ + Or8/Qda24yIAsaaj96Z3iA4bWDUARLUD8N6gftI8sZwf1JRW6kgwYn3DiLdhDeKd + 8LsrraUzHK/CXccCt5xM6t7gsgBoJvMNmy2ddpuh6T5xLQpREcI9JVqAihRa33ty + PMDk4QzPYjKsshYfFqlpRz6Zb3SMUnqjhRlWKyF/QgviNdrK8w1xlx6ix/oVruOP + P4qSl5vOmGk49CRqWY7IWciD2VHcH04fVfjhwPsh4Dv7uTaMLHwyGvJ8XFjK6yef + aiSODBsnb+bqKe8jWssCAwEAAaMNMAswCQYDVR0TBAIwADANBgkqhkiG9w0BAQsF + AAOCAQEAWOjsjh9NxJ5Lu5bGsNQecxheCtkv6WdTB4O5+z60qVNxQZrwQkPbnTQm + yAfTxR/VubLGqJ3mYU5YsqKJ2Z9Cqvc3wIPXLkruv5A1RwDv0eb0R/UE5nF/nKQR + B3yn9AYVrzu5kNlpFr/hK6brqfznMKPT6K4n9jMdUg9Bek9b2j8vG7L/Jgona43K + e7Ip6lACOP0q5PQvrKIkkdfh5QbZjrCQnUVRsScDh/qjWS01rYUp9z7rfuEuQNt5 + TPNMhvmH+podlP9zgONDdwYsjdP59+pFIRebf3Qlkd2nNk6AfL4oFpacr8x7EuHx + QJZ5MqEauEhsXVSP+gFGywjSsYHMHg== + + + + + + + + + + + \ No newline at end of file diff --git a/src/openforms/authentication/tests/files/eherkenning/metadata b/src/openforms/authentication/tests/files/eherkenning/metadata new file mode 100644 index 0000000000..a45754833c --- /dev/null +++ b/src/openforms/authentication/tests/files/eherkenning/metadata @@ -0,0 +1,92 @@ + + + + + + + + + + + + +wlAXjLMXcBaAnMSeTPMWtXAXz3aw2JutKmrINJ9K0Zs= + + + +djwJqVPxyHhwc+cEcNGHUDvfiq4hqzfw+etregUdSYXbxHZ/0y0H82f/rrFnX5gLzaJVGMGL7CXO +D2D0g03pRroEHOayI000SZgJIHaP6Pij8jnBwgVBvhhEh8e0y2NqEkyc3haiukA2nFfjQ2aZj5c2 +3LVgfShPStdGdJzYrnU7SdEVdAP4j6oooTtEUL6ZyKf8H8WXzvWGpil8ccPFTTjaiVTIyUsAMTrs +1HdokjTLi+uliR89Q5E8ttpQjHXPlkq1wLS2PWP2szg7DMgJtIB+RfJ2V7at4UwOXYVuTZOw/xBe +cMvsbRRqa0kLFaf2qqHgzsp1y4cOwDi2x0KhBLfeEH376PFBxDX0ferNK7zuMji/6mBxK8Y/je7G +4jk6eTR3kNHhvLYTZbfXIpohEnyB+Nkn7uinfO/IGFykNcoKEco31IjjZcmxFQ8uOydirtI44tZ3 +Ki/jX8WDr84Ty16ZdDaX2wJbHbb8DVt1aTSD+vOljZuAYhdo1GjTJLC9y8ch4hC1YNNJROtYgnqs +xW4aNJMkUvI+a7GVv/fADxZacj5sgD1V/fFkBqXd1RqxoxItDF2jvJ4UG1kNAi/l/Li61gcXZ/F6 +1aniA/4a+MhTOKLskZzy1tpjooXhjjHgnaSsMVl6GYtI4kJAGFfRxbIB0wBTyD5ZvhOizFuty40= + + +e6e04e0a22bbc8a036a8a243abc9655e92907f73a4ba5a2ad28485ec3f4c82d1 + + + + + + + + urn:etoegang:core:assurance-class:loa4 + + + + + + + e6e04e0a22bbc8a036a8a243abc9655e92907f73a4ba5a2ad28485ec3f4c82d1 + + MIIJ5TCCB82gAwIBAgIUdMixrcjWdAdmwfcU/6Q+iOJ9fxgwDQYJKoZIhvcNAQELBQAwgYIxCzAJBgNVBAYTAk5MMSAwHgYDVQQKDBdRdW9WYWRpcyBUcnVzdGxpbmsgQi5WLjEXMBUGA1UEYQwOTlRSTkwtMzAyMzc0NTkxODA2BgNVBAMML1F1b1ZhZGlzIFBLSW92ZXJoZWlkIE9yZ2FuaXNhdGllIFNlcnZlciBDQSAtIEczMB4XDTE5MDUyMTE0MTYxM1oXDTIxMDUyMTE0MjYwMFowgaMxHTAbBgNVBAUTFDAwMDAwMDAzNTIwMzU0NzYwMDAwMQswCQYDVQQGEwJOTDEQMA4GA1U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VTHt055zH2UZEAdQBVgdTCFpA2AUrqC5tXPFPwwOQ4eHAlCBcvo6odBxPTDAAAAWrayRy5AAAEAwBGMEQCIHJEhDlzT56fIGskeFNAl6j/RwyJIj05LCl6dlZtwdVIAiBzj0ZESf5I19ADEYvmSCX/cm9cckp2kL5umK3sVVwjEDANBgkqhkiG9w0BAQsFAAOCAgEAdOox7PhOPz5fI56I10eKJBua4RDlaQfQxSk3UQ2XKcI4z8axVRWTgk1jLIsPX84/rIMMuHGfPRleaI2TRwW9YiW0wNzjGujX7txY3I6l3jAbZDdRt8g5PMjILJRna617F/MIandeG/A4FqFAocCZJklCBS4w6F0hokA8nw9ffagi4mtgwg3RjCWVP/JNG0eJnaYI+xFdgbya1MF7Gv6cDSYhzmjRNjXNfS5Hjz9hwk+HinXG3mivVLko6PWIb8OLv6MPuQD12VCZee8v0BZIYt+QAuwTnceCpw8eD7dg3qddttmZNP7hM1BJF3lCVtl3jrY5KrJ5Xy521gokttS1kDm1hXP4ty6CzUZ9jbAR8tz5/9qJd3dBRXV1d8eU72aQ6KXivXyGZGguMIFntyQGNLm+e65C4wAJjfjD2vjMA7mRi3KqWDBuqzaM/HVJ2b3k3B+ihtpYc2FJChPz/KvxdkCXUkzaK6Vfez7X9Zq3BPY3HX2eD6M+w/8pIo4mbDB8BjLnMWnvG2h6atevE1r58y5A3uwjMDkWd/KC2L3GFRo7J8s0GN9GAVyPLC6F6SGirxYqI7MDN9gUDO+1vq4+yLEL6g3KRFhqlC7944wRjcnUuvYx1TiuhvS0UFcUe9cG5AuASnsOioHiGZSg/M581HbGKGZ6ok7PQH3vOLTk3gU= + + + + + + + + + urn:etoegang:1.9:EntityConcernedID:KvKnr + urn:etoegang:1.9:EntityConcernedID:Pseudo + urn:etoegang:1.9:EntityConcernedID:RSIN + urn:etoegang:1.11:EntityConcernedID:eIDASLegalIdentifier + urn:etoegang:1.12:EntityConcernedID:BSN + urn:etoegang:1.12:EntityConcernedID:PseudoID + + + + + + + + e6e04e0a22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CXUkzaK6Vfez7X9Zq3BPY3HX2eD6M+w/8pIo4mbDB8BjLnMWnvG2h6atevE1r58y5A3uwjMDkWd/KC2L3GFRo7J8s0GN9GAVyPLC6F6SGirxYqI7MDN9gUDO+1vq4+yLEL6g3KRFhqlC7944wRjcnUuvYx1TiuhvS0UFcUe9cG5AuASnsOioHiGZSg/M581HbGKGZ6ok7PQH3vOLTk3gU= + + + + + + + + + + + + + iWelcome B.V. + iWelcome Broker 1.13 (Pre-production) + https://www.iwelcome.com/ + + + iWelcome + eherkenning@iwelcome.com + 026 3724 295 + + + \ No newline at end of file diff --git a/src/openforms/authentication/tests/test_tasks.py b/src/openforms/authentication/tests/test_tasks.py new file mode 100644 index 0000000000..81272ccbca --- /dev/null +++ b/src/openforms/authentication/tests/test_tasks.py @@ -0,0 +1,60 @@ +from pathlib import Path +from unittest.mock import patch + +from django.test import TestCase + +from digid_eherkenning.models import DigidConfiguration + +from ..tasks import update_saml_metadata + +BASE_DIR = Path(__file__).parent.resolve() +DIGID_TEST_METADATA_FILE_SLO_POST = ( + BASE_DIR / "files" / "digid" / "metadata_with_slo_POST" +) +EHERKENNING_TEST_METADATA_FILE = BASE_DIR / "files" / "eherkenning" / "metadata" + + +class UpdateSamlTaskTests(TestCase): + @patch( + "onelogin.saml2.idp_metadata_parser.OneLogin_Saml2_IdPMetadataParser.get_metadata" + ) + def test_command_for_digid_update_is_executed(self, get_metadata): + config = DigidConfiguration.get_solo() + + with DIGID_TEST_METADATA_FILE_SLO_POST.open("rb") as metadata_file: + metadata_content = metadata_file.read().decode("utf-8") + get_metadata.return_value = metadata_content + config.metadata_file_source = ( + "https://was-preprod1.digid.nl/saml/idp/metadata" + ) + config.save() + + self.assertEqual(get_metadata.call_count, 1) + + get_metadata.reset_mock() + + update_saml_metadata() + + self.assertEqual(get_metadata.call_count, 1) + + @patch( + "onelogin.saml2.idp_metadata_parser.OneLogin_Saml2_IdPMetadataParser.get_metadata" + ) + def test_command_for_eherkenning_update_is_executed(self, get_metadata): + config = DigidConfiguration.get_solo() + + with EHERKENNING_TEST_METADATA_FILE.open("rb") as metadata_file: + metadata_content = metadata_file.read().decode("utf-8") + get_metadata.return_value = metadata_content + config.metadata_file_source = ( + "https://eh01.staging.iwelcome.nl/broker/sso/1.13" + ) + config.save() + + self.assertEqual(get_metadata.call_count, 1) + + get_metadata.reset_mock() + + update_saml_metadata() + + self.assertEqual(get_metadata.call_count, 1)