From 95726d9bcc34ef50787ec01371b4eb239c8e8b35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ph=C3=A9na=20Proxima?= Date: Mon, 14 Jun 2021 09:06:12 -0400 Subject: [PATCH] Revert "[ORCA] Fix integrated test failure due to invalid configuration for samlauth module." This reverts commit 437bc1d701799664ad1f2c45a4104f0ed38cc03a. --- tests/src/ExistingSite/ApiTest.php | 36 ++++++++++++++----- .../src/ExistingSite/ConfigIntegrityTest.php | 33 +++++++++++++---- 2 files changed, 53 insertions(+), 16 deletions(-) diff --git a/tests/src/ExistingSite/ApiTest.php b/tests/src/ExistingSite/ApiTest.php index e534c4da..7bece9f6 100644 --- a/tests/src/ExistingSite/ApiTest.php +++ b/tests/src/ExistingSite/ApiTest.php @@ -24,17 +24,35 @@ protected function setUp() { ->save(); // If the samlauth module is installed, ensure that it is configured (in - // this case, using its own test data) to avoid errors when creating user + // this case, using its own test data, copied here so as to not depend on + // another module's test fixtures) to avoid errors when creating user // accounts in this test. if ($this->container->get('module_handler')->moduleExists('samlauth')) { - $path = $this->container->get('extension.list.module') - ->getPath('samlauth'); - $data = file_get_contents("$path/test_resources/samlauth.authentication.yml"); - $data = Yaml::decode($data); - - $this->container->get('config.factory') - ->getEditable('samlauth.authentication') - ->setData($data) + $config_factory->getEditable('samlauth.authentication') + ->setData([ + 'sp_entity_id' => 'samlauth', + 'idp_entity_id' => 'https://idp.testshib.org/idp/shibboleth', + 'idp_single_sign_on_service' => 'https://idp.testshib.org/idp/profile/SAML2/Redirect/SSO', + 'idp_single_log_out_service' => '', + 'idp_x509_certificate' => 'MIIEDjCCAvagAwIBAgIBADANBgkqhkiG9w0BAQUFADBnMQswCQYDVQQGEwJVUzEVMBMGA1UECBMMUGVubnN5bHZhbmlhMRMwEQYDVQQHEwpQaXR0c2J1cmdoMREwDwYDVQQKEwhUZXN0U2hpYjEZMBcGA1UEAxMQaWRwLnRlc3RzaGliLm9yZzAeFw0wNjA4MzAyMTEyMjVaFw0xNjA4M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xpUjAiSWYKLtJhGEaTqCYxCCX2Dw+dOTqUzHOZ7WKv4JXPK5G/Uhr8K/qhmFT2nIQi538n6rVYLeWj8Bbnl+ev0peYzxFyF5sQA==', + 'unique_id_attribute' => 'urn:oid:1.3.6.1.4.1.5923.1.1.1.10', + 'create_users' => 0, + 'sync_name' => 0, + 'sync_mail' => 0, + 'user_name_attribute' => 'email', + 'user_mail_attribute' => 'email', + 'idp_change_password_service' => '', + 'sp_x509_certificate' => 'MIIDozCCAoqgAwIBAgIBADANBgkqhkiG9w0BAQ0FADBrMQswCQYDVQQGEwJ1czEOMAwGA1UECAwFSWRhaG8xFTATBgNVBAoMDGN3ZWFnYW5zLm5ldDEVMBMGA1UEAwwMY3dlYWdhbnMubmV0MR4wHAYJKoZIhvcNAQkBFg9tZUBjd2VhZ2Fucy5uZXQwHhcNMTUwNjIzMjAwMjMyWhcNMjUwNjIwMjAwMjMyWjBrMQswCQYDVQQGEwJ1czEOMAwGA1UECAwFSWRhaG8xFTATBgNVBAoMDGN3ZWFnYW5zLm5ldDEVMBMGA1UEAwwMY3dlYWdhbnMubmV0MR4wHAYJKoZIhvcNAQkBFg9tZUBjd2VhZ2Fucy5uZXQwggEjMA0GCSqGSIb3DQEBAQUAA4IBEAAwggELAoIBAgDDZOeQF9Cp5k0WzNBye9S/3FgKxTZjcAPBFLtMMAhcx9+kLYMwS5J5h1OUKQcaoxmz/MiVKnrnozStdOKYIeS0C+8DmjRPjKEva77RYEy/Zu4l2Y+Nijt9/OMrO2JwuchHI9Xx+rqifDCR9rJ4vwbu/6/NhTVggSgsDsxlgGtLWC1zoUmwtcBe30t63P1eDrNAEg5EkM3y6OCsx6HaK7nAJmGaF6of/60UmEXB6qBVgZlU/qUmrVX89EdGvPrKWvYJcX3xAcIQh/on/1e/XmGMRYnBB6E0qyx6sL0ZmHzwH5jIUR5S1xwqWhSAjlOUHLSg2tYfHx0dn3UV2koY9QsKEQIDAQABo1AwTjAdBgNVHQ4EFgQUTJG5GAzq0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 'map_users' => 0, + 'security_logout_requests_sign' => 0, + 'security_assertions_encrypt' => 0, + 'security_authn_requests_sign' => 0, + 'security_messages_sign' => NULL, + 'security_request_authn_context' => 1, + 'strict' => 1, + ]) ->save(); } } diff --git a/tests/src/ExistingSite/ConfigIntegrityTest.php b/tests/src/ExistingSite/ConfigIntegrityTest.php index 99c0a1b1..5ec1a248 100644 --- a/tests/src/ExistingSite/ConfigIntegrityTest.php +++ b/tests/src/ExistingSite/ConfigIntegrityTest.php @@ -23,17 +23,36 @@ protected function setUp() { parent::setUp(); // If the samlauth module is installed, ensure that it is configured (in - // this case, using its own test data) to avoid errors when creating user + // this case, using its own test data, copied here so as to not depend on + // another module's test fixtures) to avoid errors when creating user // accounts in this test. if ($this->container->get('module_handler')->moduleExists('samlauth')) { - $path = $this->container->get('extension.list.module') - ->getPath('samlauth'); - $data = file_get_contents("$path/test_resources/samlauth.authentication.yml"); - $data = Yaml::decode($data); - $this->container->get('config.factory') ->getEditable('samlauth.authentication') - ->setData($data) + ->setData([ + 'sp_entity_id' => 'samlauth', + 'idp_entity_id' => 'https://idp.testshib.org/idp/shibboleth', + 'idp_single_sign_on_service' => 'https://idp.testshib.org/idp/profile/SAML2/Redirect/SSO', + 'idp_single_log_out_service' => '', + 'idp_x509_certificate' => 'MIIEDjCCAvagAwIBAgIBADANBgkqhkiG9w0BAQUFADBnMQswCQYDVQQGEwJVUzEVMBMGA1UECBMMUGVubnN5bHZhbmlhMRMwEQYDVQQHEwpQaXR0c2J1cmdoMREwDwYDVQQKEwhUZXN0U2hpYjEZMBcGA1UEAxMQaWRwLnRlc3RzaGliLm9yZzAeFw0wNjA4MzAyMTEyMjVaFw0xNjA4MjcyMTEyMjVaMGcxCzAJBgNVBAYTAlVTMRUwEwYDVQQIEwxQZW5uc3lsdmFuaWExEzARBgNVBAcTClBpdHRzYnVyZ2gxETAPBgNVBAoTCFRlc3RTaGliMRkwFwYDVQQDExBpZHAudGVzdHNoaWIub3JnMIIBIjANBgkqhk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+ 'sync_name' => 0, + 'sync_mail' => 0, + 'user_name_attribute' => 'email', + 'user_mail_attribute' => 'email', + 'idp_change_password_service' => '', + 'sp_x509_certificate' => 'MIIDozCCAoqgAwIBAgIBADANBgkqhkiG9w0BAQ0FADBrMQswCQYDVQQGEwJ1czEOMAwGA1UECAwFSWRhaG8xFTATBgNVBAoMDGN3ZWFnYW5zLm5ldDEVMBMGA1UEAwwMY3dlYWdhbnMubmV0MR4wHAYJKoZIhvcNAQkBFg9tZUBjd2VhZ2Fucy5uZXQwHhcNMTUwNjIzMjAwMjMyWhcNMjUwNjIwMjAwMjMyWjBrMQswCQYDVQQGEwJ1czEOMAwGA1UECAwFSWRhaG8xFTATBgNVBAoMDGN3ZWFnYW5zLm5ldDEVMBMGA1UEAwwMY3dlYWdhbnMubmV0MR4wHAYJKoZIhvcNAQkBFg9tZUBjd2VhZ2Fucy5uZXQwggEjMA0GCSqGSIb3DQEBAQUAA4IBEAAwggELAoIBAgDDZOeQF9Cp5k0WzNBye9S/3FgKxTZjcAPBFLtMMAhcx9+kLYMwS5J5h1OUKQcaoxmz/MiVKnrnozStdOKYIeS0C+8DmjRPjKEva77RYEy/Zu4l2Y+Nijt9/OMrO2JwuchHI9Xx+rqifDCR9rJ4vwbu/6/NhTVggSgsDsxlgGtLWC1zoUmwtcBe30t63P1eDrNAEg5EkM3y6OCsx6HaK7nAJmGaF6of/60UmEXB6qBVgZlU/qUmrVX89EdGvPrKWvYJcX3xAcIQh/on/1e/XmGMRYnBB6E0qyx6sL0ZmHzwH5jIUR5S1xwqWhSAjlOUHLSg2tYfHx0dn3UV2koY9QsKEQIDAQABo1AwTjAdBgNVHQ4EFgQUTJG5GAzq0olNiSfg7c/zjaBHnwcwHwYDVR0jBBgwFoAUTJG5GAzq0olNiSfg7c/zjaBHnwcwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQ0FAAOCAQIAsaxgtTmqQLbNETa7pLD0q0qCU7awxUUfwM73CwW+uIoZXeTz4YP6qaQ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qLLlBDndHPb3aURJGqf/rFuooK29NBn5n30cftFv7mXc+RA9/SBbIrX5+0p6Nez4SuJLYfVHBzDF9YOVzQbDUWZZWIUtR0yBSl2WAFEET7jyofzXTKOCo2eFrnWj5a2Q0xEFj11f7q83pbdQ8HvbUdi+roaRCtAoGBDM5hrDc4CI8yR6La9fAtA4bkQ/SxiDwfh/Xnjg0eSiVIs5GeGCAJEIeNoZE7n9BQHhH5m0HyjHMnzMfLyexhW6/xHAktEvcEWZMBBIBTbXsGn/f4yKiyfLCsdoLtQIBBQTpYAXwbqVjE+L6xgK/noFdDV17XZcYbPk6xr+f6Hnd1AoGBCQi2z9/Mng5GP+MczatQnd1gyUqYt5DYNzawZKbfjxEixfFQPrH1u6vpkpoX7wdTP3QjIldZi/i7ZnvU8H+1RTXfqO+7ORuvfKJiRHupYAHTs7QmDvM/jEaL/FSgx/Hi2iaEYfbRDSnmeKXK6zcBOFfbnZZRGJpxpu3aNMI+IhdxAoGBC2RplWeGDG8+3mVs/k6L7NBKLn32lOhPcIb8V+0pnfIvC7el+XY+OhssjqeBcDlDnIyHDWwMVo92v4CZtOb48TTCfBtZor5mez0AMb3q+cDw8swI4JDaP3x33/G3F6NA6cL6WU/L18nlaBdUFtPlbUlT2dzAJ4Sl5bbh8UefxQylAoGBAKP0QllPVH3cAKcplu/vTm3Brw6cejhwUX21qBspHJDQcjbqQMqI4xdcY7oYwBGazgPKnBOgiRqSg4018dcJySL5tHneGuTXHVfp+4FznlOQKxRg7I6e/KUOzRSsLy49KlGs9OmuACe0MOTboDIn00mzUnxdmk4qsq34KaqJ4w5G', + 'sp_name_id_format' => 'urn:oasis:names:tc:SAML:2.0:nameid-format:transient', + 'map_users' => 0, + 'security_logout_requests_sign' => 0, + 'security_assertions_encrypt' => 0, + 'security_authn_requests_sign' => 0, + 'security_messages_sign' => NULL, + 'security_request_authn_context' => 1, + 'strict' => 1, + ]) ->save(); } }