diff --git a/lib/dl_connector_clickhouse/dl_connector_clickhouse_tests/db/config.py b/lib/dl_connector_clickhouse/dl_connector_clickhouse_tests/db/config.py index 31a70c440..b25ea904f 100644 --- a/lib/dl_connector_clickhouse/dl_connector_clickhouse_tests/db/config.py +++ b/lib/dl_connector_clickhouse/dl_connector_clickhouse_tests/db/config.py @@ -52,8 +52,7 @@ class CoreSslConnectionSettings: PASSWORD: ClassVar[str] = "qwerty" -DASHSQL_QUERY = r""" -select +DASHSQL_QUERY = r"""select arrayJoin([11, 22, NULL]) as a, [33, 44] as b, toDateTime('2020-01-02 03:04:05', 'UTC') + a as ts diff --git a/lib/dl_connector_clickhouse/docker-compose/db-clickhouse/ssl/chnode.crt b/lib/dl_connector_clickhouse/docker-compose/db-clickhouse/ssl/chnode.crt index 9c8bebc08..f8fa09882 100644 --- a/lib/dl_connector_clickhouse/docker-compose/db-clickhouse/ssl/chnode.crt +++ b/lib/dl_connector_clickhouse/docker-compose/db-clickhouse/ssl/chnode.crt @@ -1,17 +1,17 @@ -----BEGIN CERTIFICATE----- -MIICsjCCAZoCFDIrhcE7HxXiTgcRfT+0ITN9yWbUMA0GCSqGSIb3DQEBCwUAMBcx -FTATBgNVBAMMDGxvY2FsaG9zdCBDQTAeFw0yMzA5MTMwOTM2MTlaFw0yMzEwMTMw -OTM2MTlaMBQxEjAQBgNVBAMMCWxvY2FsaG9zdDCCASIwDQYJKoZIhvcNAQEBBQAD -ggEPADCCAQoCggEBALB5DUJwt1v88ga/AIih8rNMOWUO6nWu6dE4XgDJnjndjEmr -5eNSR0EI0Q1+2sXaGYmBh/iu56UWKXsrNUbjUFuvvr8SA3MfuRa5IAY25Er4v8zf -aOhE7etARI802VIbAePj3mktHZD9FG/swsyxm3duKp5UehqlGCtV3h+EhrhBTusi -5Yxe1fux4VYhkHCnVbAzFY5r2JZguMuiVnjEcmDWYnhpz9vcYRLAEyRiPXmQyVjS -6CrsG+HhPKR4JN9LPU2PeGt+nV3OAM+IvhAKWB3H0M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wipE/1f +12yF1QHHdw2tmarm+V00QlK8ddUnBnpRwkIlvQRc0LuBPcQkv3KWCxxHlcHWLGIk +ydsnjvEGmfPzGxjYmmnHnxrIAAGNP/J1ob8c/xNNbcrOV5wL1q7wiDoA5dqTXCOb +iUp4lrzly28KkQy3RwPWPkFcm/JrA51AIY6fr9JgxcoLyxCxnu4ivzALUF1YV639 +CxFcCODLAOye4duvaMZBCfm3246uteuqwNFME9oT08vOpM822IsiZH0CCAPAtQKg +9wPj3HKSqtyealyIQvkZd5+i3Ax8TA== -----END CERTIFICATE----- diff --git a/lib/dl_connector_clickhouse/docker-compose/db-clickhouse/ssl/chnode.key b/lib/dl_connector_clickhouse/docker-compose/db-clickhouse/ssl/chnode.key index da3da8374..eb76eb096 100644 --- a/lib/dl_connector_clickhouse/docker-compose/db-clickhouse/ssl/chnode.key +++ b/lib/dl_connector_clickhouse/docker-compose/db-clickhouse/ssl/chnode.key @@ -1,28 +1,28 @@ -----BEGIN PRIVATE KEY----- -MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQCweQ1CcLdb/PIG -vwCIofKzTDllDup1runROF4AyZ453YxJq+XjUkdBCNENftrF2hmJgYf4ruelFil7 -KzVG41Bbr76/EgNzH7kWuSAGNuRK+L/M32joRO3rQESPNNlSGwHj495pLR2Q/RRv -7MLMsZt3biqeVHoapRgrVd4fhIa4QU7rIuWMXtX7seFWIZBwp1WwMxWOa9iWYLjL -olZ4xHJg1mJ4ac/b3GESwBMkYj15kMlY0ugq7Bvh4TykeCTfSz1Nj3hrfp1dzgDP -iL4QClgdx9DDXfYyaOff0maBSyywfJndPIjCEgffkOv2dzCWsEEjLp8Ed5LPlOPF -H6mag973AgMBAAECggEAVwi8s2Hn7KRJsW4OE1Tb3/Xd8Kt0kunbQ2ZrZjQJpzxO -7h6rWHvBzJ9OiztfJmk0Yw7RQqLweAkAGFDtC7McdLuudYmqzeJ9ZGmVE7uKyDb6 -UU517Ofh9z5REdfcvpO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49dJzW +FlllrRUVYKwumxTPrVTWUtElc3dEsM7vyiJjBdqazN5ENI4TJD7TmWwKwhqiCG+T +4hnPDJUdpvUCgYEAo66CxFCNm0HoEwFtE5Nvl4o5GHM1jdvD6Z5cNwUkgT9YI4F8 +S/hx+Oaoi+dR/YOYc45ELGRfhbuYy4AL7UoWJJCXhsqQY7fx+85qiohgKMPWZhwq +0OC1peX/QutvmaXOZl3vliC1Mx+W3pTOFo72LCxPLe7ByRpS+UrivcUEdzcCgYBI +Ay2L18p+JQXtJgMgu7jFjm6J+QwkR2cuev/pB9NdmCaMrcSCk0B7iDcieFpLBll3 +qupTzKVmej/I/1Rb+epJdD1gyGn1Yz9tS+whOkRUVrNib/fup6xs/JrC4Mh/MThg +PDRI/EJHKSHzgdgoVKY8Ac9KZ2XD/Kprqz5P50NoCQKBgG8OGsVYDzSw23PxulJp +HPAN3LHySRRSq0hdylcsG8fSdUX7YqiZCChIxCDjxK78j2OTxdyuT1LzDQr5kxZH +VYuVlBjBGZooYgBbp0TgM5zj9NPdxt/RNnRiAHGm9CeukZmWrZL5Qn59nbm9L8AK +90nlkhM5o1h8IwVRwYFjksyc -----END PRIVATE KEY----- diff --git a/lib/dl_connector_clickhouse/docker-compose/db-clickhouse/ssl/marsnet_ca.crt b/lib/dl_connector_clickhouse/docker-compose/db-clickhouse/ssl/marsnet_ca.crt index e457f2d9b..1c438b6b2 100644 --- a/lib/dl_connector_clickhouse/docker-compose/db-clickhouse/ssl/marsnet_ca.crt +++ b/lib/dl_connector_clickhouse/docker-compose/db-clickhouse/ssl/marsnet_ca.crt @@ -1,19 +1,19 @@ -----BEGIN CERTIFICATE----- -MIIDDzCCAfegAwIBAgIUTVnVMqNc6HkQVha4tjfc/MHp/DowDQYJKoZIhvcNAQEL -BQAwFzEVMBMGA1UEAwwMbG9jYWxob3N0IENBMB4XDTIzMDkxMzA5MzYxOVoXDTI2 -MDkxMjA5MzYxOVowFzEVMBMGA1UEAwwMbG9jYWxob3N0IENBMIIB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Wxob3N0IENBMIIBIjANBgkqhkiG +9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwfeMlBTGkI3Vtjbf3dC8Fci/FefjWf2yeas9 +a89VADWPYv1PS4K7PsQ0qUDCRS0Fd071HF+aCyNwDVTy3dQMnNT7WaA5CDzsnuuA +iFMOPZV8UuUiS/6ktYJnXyrqwKZivS8ZN7bBJW8mRNOhZaykC1g0Xd0ALn3FlCc3 +cBiYMeJFBPeFk2vMLNIXZNigAkQ46WGZqm4lsa1NgWDsTlc50wQqNgFpUP4xWekr +em/b+Ujry/xDGM2W2HhpJrxgqw+5Us7Qo9RZ8aZvkunI0hDLuWHUnYjZOYHBh2M0 +GQpsHjFAXLxC4Wrv7lBxVv99E1el4Xr0zk0lkFyxK8NpGJchIQIDAQABo1MwUTAd +BgNVHQ4EFgQUeKnTYy762/yemWjh9kQipWN8nyYwHwYDVR0jBBgwFoAUeKnTYy76 +2/yemWjh9kQipWN8nyYwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOC +AQEAgqCYm0jDrvTFvd5iCkD3nSUzHcyl4YMERvGDVDp4VeYu7/Pf/+F1RXrPi0su +YFqx++Z3w9XhJC4J8g71j6h8rwApZxFB4yUHwngU0xNgA+yCjzjjuzo9QdX4xuyS +9gM0ECu9HqSC4GlGWoX1DJsk3HDoZYllABf4aeHk2s08L2LxmeT5Cu0uQYFe1VMP +q3ucvekK8oZd1oMArQ1LRhWTBcKgtA8irPWK/NQYdNTMEkp6TGyY63hg8k0jXLfw +YqA1bgE+K7XpFasfXQCYfmhseXUzrS4N5+f3yP6WgPfFCWnb5GNmHcADxOvqANL/ +r4ZdafJbRc7Zrdfo5T0jdv8k1g== -----END CERTIFICATE----- diff --git a/lib/dl_connector_mysql/dl_connector_mysql/core/async_adapters_mysql.py b/lib/dl_connector_mysql/dl_connector_mysql/core/async_adapters_mysql.py index d8fcc16a0..3e110f2e8 100644 --- a/lib/dl_connector_mysql/dl_connector_mysql/core/async_adapters_mysql.py +++ b/lib/dl_connector_mysql/dl_connector_mysql/core/async_adapters_mysql.py @@ -112,6 +112,9 @@ def create( def get_default_db_name(self) -> Optional[str]: return self._target_dto.db_name + def get_target_host(self) -> Optional[str]: + return self._target_dto.host + async def _create_engine(self, db_name: str, use_ssl: bool = False) -> aiomysql.sa.Engine: # TODO: pass ca_data through *DTO ssl_ctx = ssl.create_default_context(cafile=get_root_certificates_path()) if use_ssl else None diff --git a/lib/dl_connector_oracle/dl_connector_oracle_tests/db/core/test_remote_query_executor.py b/lib/dl_connector_oracle/dl_connector_oracle_tests/db/core/test_remote_query_executor.py index 773f1aa2d..6bbce3c88 100644 --- a/lib/dl_connector_oracle/dl_connector_oracle_tests/db/core/test_remote_query_executor.py +++ b/lib/dl_connector_oracle/dl_connector_oracle_tests/db/core/test_remote_query_executor.py @@ -11,6 +11,10 @@ class TestOracleRemoteQueryExecutor(BaseOracleTestClass, BaseRemoteQueryExecutor SYNC_ADAPTER_CLS = OracleDefaultAdapter ASYNC_ADAPTER_CLS = OracleDefaultAdapter + @pytest.fixture(scope="class") + def basic_test_query(self) -> str: + return "select 1, 2, 3 from dual" + @pytest.mark.asyncio async def test_qe_result(self, remote_adapter): result = await self.execute_request(remote_adapter, query=SUBSELECT_QUERY_FULL) diff --git a/lib/dl_connector_postgresql/dl_connector_postgresql/core/postgresql_base/async_adapters_postgres.py b/lib/dl_connector_postgresql/dl_connector_postgresql/core/postgresql_base/async_adapters_postgres.py index 3c9b06535..00fad7d46 100644 --- a/lib/dl_connector_postgresql/dl_connector_postgresql/core/postgresql_base/async_adapters_postgres.py +++ b/lib/dl_connector_postgresql/dl_connector_postgresql/core/postgresql_base/async_adapters_postgres.py @@ -159,6 +159,9 @@ def get_conn_line(self, db_name: Optional[str] = None, params: dict[str, Any] = def get_default_db_name(self) -> Optional[str]: return self._target_dto.db_name + def get_target_host(self) -> Optional[str]: + return self._target_dto.host + def _convert_date(self, s: str, ignoretz: bool) -> datetime: try: d = dateutil_parser.parse(s, ignoretz=ignoretz) diff --git a/lib/dl_connector_postgresql/docker-compose/db-postgres/ssl/root.crt b/lib/dl_connector_postgresql/docker-compose/db-postgres/ssl/root.crt index 6151c95ad..28ade15ba 100644 --- a/lib/dl_connector_postgresql/docker-compose/db-postgres/ssl/root.crt +++ b/lib/dl_connector_postgresql/docker-compose/db-postgres/ssl/root.crt @@ -2,53 +2,53 @@ Certificate: Data: Version: 1 (0x0) Serial Number: - 4f:e9:43:4d:a0:68:f2:3e:f4:1f:0b:15:39:50:4a:5c:b9:5c:6c:8c + 34:bd:0e:df:92:97:4a:2f:a9:26:df:d7:8f:3d:17:15:b4:02:ef:b4 Signature Algorithm: NULL Issuer: CN = root.yourdomain.com Validity - Not Before: Sep 13 09:15:59 2023 GMT - Not After : Sep 10 09:15:59 2033 GMT + Not Before: Sep 23 13:28:30 2024 GMT + Not After : Sep 21 13:28:30 2034 GMT Subject: CN = root.yourdomain.com Subject Public Key Info: Public Key Algorithm: rsaEncryption RSA Public-Key: (2048 bit) Modulus: - 00:b8:50:e5:b5:48:bf:f9:85:1d:78:4d:10:e2:5f: - 78:19:73:28:59:f1:a1:ce:b3:65:cc:d4:47:58:8f: - 6f:03:eb:51:cb:7e:3a:64:0f:ec:81:30:9b:07:50: - 2c:98:90:20:eb:8d:3e:56:74:02:37:92:e7:2e:0b: - cf:22:60:6a:4c:e3:fe:55:83:34:99:96:37:68:b4: - 02:d1:47:48:16:12:0f:22:a5:41:ca:11:2a:e8:b4: - 0e:e7:0d:be:13:9c:02:93:e5:ac:01:b8:c8:8e:71: - 80:0b:fc:44:f1:d0:dc:fc:60:06:20:09:66:4b:c0: - 30:c2:73:17:6e:a5:a5:8b:66:18:a7:74:11:f0:3c: - d6:77:54:64:0b:b2:21:bb:d2:e4:14:d0:9e:79:9f: - da:dd:05:8c:bc:1c:13:c0:43:1d:d4:28:d2:94:de: - cb:4f:ff:36:8a:cb:cb:94:7f:9c:e6:03:46:33:10: - ba:8a:ae:a9:24:71:f2:4d:88:3e:15:11:8d:5b:9a: - cc:78:3c:08:b5:ee:70:e3:06:e6:92:34:67:70:fc: - c8:96:a4:08:ab:bc:b5:39:97:e1:87:8c:2c:b9:44: - 78:2a:c3:b0:0d:f5:95:bd:69:de:a2:ff:f1:b7:c0: - ca:96:80:97:a8:56:f3:08:05:3c:5c:3e:b2:7a:e4: - aa:85 + 00:d3:3d:c3:4a:60:3a:47:77:47:4e:cf:be:5f:ca: + 57:31:83:32:d7:44:c4:a3:70:fa:b3:78:cc:20:9d: + b4:93:46:19:19:e5:58:38:cc:26:e5:3b:5c:fe:91: + b0:e7:f5:54:4a:10:69:69:5b:11:d6:77:be:ce:da: + ac:e1:88:b8:b2:e5:8b:b7:d2:53:1f:c6:71:21:db: + 1a:a2:60:02:fd:12:5b:05:e7:7c:91:f2:73:de:58: + 7c:f2:0a:61:c4:e1:17:b2:71:05:b4:07:a6:81:f0: + 71:3f:3d:5f:44:8f:0e:db:44:ed:55:82:d5:b3:92: + d8:8f:56:8f:34:8f:b0:67:99:69:fa:cc:6a:ce:93: + ed:2c:5e:45:f5:b6:f5:f0:82:3a:d2:09:56:78:ce: + 9a:eb:79:ca:2c:02:f1:fd:af:3c:cc:ae:90:e8:2d: + f2:a7:52:1f:ee:bd:83:13:ba:ec:6a:6b:90:4d:89: + b0:13:c8:b4:d3:f4:ab:69:d0:cd:7f:95:fe:59:44: + 0e:35:d2:ba:02:d6:11:4c:dd:bd:eb:a8:9f:6d:e2: + c9:2f:6a:30:05:43:61:8c:48:e1:78:37:91:78:df: + 22:3e:20:6c:4a:31:19:20:29:6d:bd:1a:fc:e7:98: + f8:f5:e4:10:40:e7:95:49:49:6f:2e:a5:bb:e2:63: + 39:51 Exponent: 65537 (0x10001) Signature Algorithm: NULL -----BEGIN CERTIFICATE----- -MIIDHTCCAgWgAwIBAgIUT+lDTaBo8j70HwsVOVBKXLlcbIwwDQYJKoZIhvcNAQEL -BQAwHjEcMBoGA1UEAwwTcm9vdC55b3VyZG9tYWluL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1UEAwwTcm9vdC55b3VyZG9tYWluLmNvbTAeFw0yNDA5MjMxMzI4 +MzBaFw0zNDA5MjExMzI4MzBaMB4xHDAaBgNVBAMME3Jvb3QueW91cmRvbWFpbi5j +b20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDTPcNKYDpHd0dOz75f +ylcxgzLXRMSjcPqzeMwgnbSTRhkZ5Vg4zCblO1z+kbDn9VRKEGlpWxHWd77O2qzh +iLiy5Yu30lMfxnEh2xqiYAL9ElsF53yR8nPeWHzyCmHE4ReycQW0B6aB8HE/PV9E +jw7bRO1VgtWzktiPVo80j7BnmWn6zGrOk+0sXkX1tvXwgjrSCVZ4zprrecosAvH9 +rzzMrpDoLfKnUh/uvYMTuuxqa5BNibATyLTT9Ktp0M1/lf5ZRA410roC1hFM3b3r +qJ9t4skvajAFQ2GMSOF4N5F43yI+IGxKMRkgKW29GvznmPj15BBA55VJSW8upbvi +YzlRAgMBAAGjUzBRMB0GA1UdDgQWBBSJ23r4XLlCQmOzERSLZCfi6qd+jjAfBgNV +HSMEGDAWgBSJ23r4XLlCQmOzERSLZCfi6qd+jjAPBgNVHRMBAf8EBTADAQH/MA0G +CSqGSIb3DQEBCwUAA4IBAQABEE85FZTlhK/RKQDr5XKFw2IK2A+O3tlzAU90ErM6 +vySP3y0RvasYbjCAYPxybAzXT/PPStFFib003B9BIaGQ4gMMs9Mr8QjrRn7BaFI2 +6z7gTVXuQNpo2yqW8WEnk7q09001jvKVoCe5DXdepa+wo+zMHvYLQ0KNZ+Dyl/Hg +06IwXnuI6V/YkV235HB2j6VjJw97iOnE3u33yc7DIaC3Ps9W+H25hmHlw0/jPu7h +JnR+PpPQPty0PM1icHI+R45Bem8lnhB/9UHgOptVBjpsbG1J4vkZDYFDpwGtuVTv +UgGAe1wgl/MYofbHwuFI8KeCda9XvyPkxvHG0A6B9axi -----END CERTIFICATE----- diff --git a/lib/dl_connector_postgresql/docker-compose/db-postgres/ssl/server.crt b/lib/dl_connector_postgresql/docker-compose/db-postgres/ssl/server.crt index b0f039cec..448527c15 100644 --- a/lib/dl_connector_postgresql/docker-compose/db-postgres/ssl/server.crt +++ b/lib/dl_connector_postgresql/docker-compose/db-postgres/ssl/server.crt @@ -2,51 +2,51 @@ Certificate: Data: Version: 1 (0x0) Serial Number: - 1b:59:e0:0a:f0:98:00:b0:17:4e:d0:51:42:00:72:2f:15:80:22:e6 + 22:44:fb:98:94:f4:12:11:38:bc:24:7b:05:8c:86:7f:1e:bc:86:2f Signature Algorithm: NULL Issuer: CN = dbhost.yourdomain.com Validity - Not Before: Sep 13 09:16:00 2023 GMT - Not After : Sep 12 09:16:00 2024 GMT + Not Before: Sep 23 13:28:31 2024 GMT + Not After : Sep 23 13:28:31 2025 GMT Subject: CN = dbhost.yourdomain.com Subject Public Key Info: Public Key Algorithm: rsaEncryption RSA Public-Key: (2048 bit) Modulus: - 00:d8:b2:be:9d:d7:41:2b:c9:05:a4:8b:dd:52:99: - 59:b0:ba:e1:be:87:59:bb:1e:93:0c:da:27:b6:34: - f8:6a:33:23:76:5d:fd:80:f3:15:8a:45:0d:db:8f: - 82:0f:12:80:1e:f9:27:d7:2d:14:e4:0e:cd:76:3c: - 92:b9:69:33:3f:91:ab:af:9d:f9:ab:03:4f:10:0b: - 1d:8b:b0:ec:be:6a:5e:7e:16:dd:39:46:39:e2:46: - 5b:97:cd:dc:33:28:16:d7:a6:42:01:67:45:1c:e4: - 20:a0:78:53:35:2c:e6:8d:de:c1:c7:b5:f1:7d:ec: - 46:9e:e3:0a:e5:1f:2a:a2:2a:1f:c4:28:90:43:32: - 65:07:3b:70:b3:35:e7:0b:e9:ea:83:37:b9:03:97: - ab:55:c4:bb:21:65:9c:aa:d4:d9:6e:93:96:23:90: - 26:1f:8a:2d:3c:51:56:fb:ad:71:50:c9:5a:b0:44: - d7:91:bf:21:5c:0a:31:67:8a:68:46:14:b0:c8:9c: - e6:76:51:72:95:2f:07:81:ca:51:0c:14:71:26:a1: - bc:c1:70:95:6f:ab:bb:2b:b1:7e:06:f6:85:0e:73: - 01:68:de:77:86:37:d2:0f:fa:70:07:ab:59:0c:db: - 32:e1:ad:12:f0:97:67:ec:f6:57:33:1d:b5:82:7e: - 80:69 + 00:e6:b0:bf:a8:58:67:0a:0c:1f:4d:e9:72:4a:2e: + 2f:4a:fd:3e:5f:f5:66:89:6a:57:87:cc:24:ec:54: + 6c:f6:a7:7b:56:b6:7e:73:f4:3b:82:5a:29:fb:49: + 4e:08:8a:76:95:b0:3c:09:05:a2:e1:cd:99:02:86: + 2c:24:8c:67:42:19:e0:8b:df:37:3d:34:8a:a2:ea: + b9:60:7d:93:e4:bd:b1:d3:96:32:93:ef:d1:b9:b9: + ad:37:b4:c5:7e:9a:5e:c8:35:86:6c:29:24:5e:d2: + 7e:b8:f6:45:96:80:92:c9:8d:33:e9:29:9e:ee:cf: + 46:2b:aa:b9:e4:46:02:72:61:42:06:0a:3f:c9:9a: + 46:b2:30:48:84:d5:ac:5e:db:6d:f3:64:29:ef:69: + f1:5d:88:18:85:0c:05:cb:e2:70:ab:cb:b3:b7:31: + 6b:0b:f9:93:53:a1:eb:d0:6d:0f:07:be:f5:0d:4d: + 26:91:8d:3f:17:82:ee:04:30:85:b0:d0:b7:48:6b: + 5f:c1:0b:31:a9:2c:d8:65:23:09:61:64:6c:51:35: + f7:9f:3e:10:45:9f:eb:9b:28:8d:3d:56:a5:ec:33: + d0:15:21:11:fc:2f:43:ad:56:8b:ba:ca:b2:ce:d6: + 18:4a:b5:05:1d:ce:08:e3:95:a5:52:cc:31:37:eb: + 0f:13 Exponent: 65537 (0x10001) Signature Algorithm: NULL -----BEGIN CERTIFICATE----- -MIICxTCCAa0CFEtJVF80MChgeMib1gG1PFZymWDEMA0GCSqGSIb3DQEBCwUAMB4x -HDAaBgNVBAMME3Jvb3QueW91cmRvbWFpbi5jb20wHhcNMjMwOTEzMDkxNjAwWhcN -MjQwOTEyMDkxNjAwWjAgMR4wHAYDVQQDDBVkYmhvc3Q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VGz2p3tWtn5z9DuCWin7SU4IinaVsDwJBaLhzZkChiwkjGdC +GeCL3zc9NIqi6rlgfZPkvbHTljKT79G5ua03tMV+ml7INYZsKSRe0n649kWWgJLJ +jTPpKZ7uz0YrqrnkRgJyYUIGCj/JmkayMEiE1axe223zZCnvafFdiBiFDAXL4nCr +y7O3MWsL+ZNToevQbQ8HvvUNTSaRjT8Xgu4EMIWw0LdIa1/BCzGpLNhlIwlhZGxR +NfefPhBFn+ubKI09VqXsM9AVIRH8L0OtVou6yrLO1hhKtQUdzgjjlaVSzDE36w8T +AgMBAAEwDQYJKoZIhvcNAQELBQADggEBAI4fmKSdIwJZsDz41DDQcItYz0QcL2Ag +ByVle8Xi29koBDabX64cEjzuCjOKiUlWS5ZjcAp+Da8x+jbBDwk2hb+7oUuoxE3O +SMu6f2aTKRyu1Cj+kFd5ocTmFPgwOjE2vypBCP8azBGp0QI9fDP0DWoT6m+st1z7 +Ij+hxCo8+51gjeAAV1syltE2LyZd2sfkbYvO2b9bHMGaiamjO4m63u8NDIgol9Rf +QUinUi52VEmlXB78K6n9wrV/XObEWIw9vu8+FnPFMUaFhWAX1STUfpLv5MceRkZx +eWulid3C0Xq1uMd/pCQ0Omv08/YQ0YPV5YBQ51izMwJqhUi2MmLPXR4= -----END CERTIFICATE----- diff --git a/lib/dl_connector_postgresql/docker-compose/db-postgres/ssl/server.key b/lib/dl_connector_postgresql/docker-compose/db-postgres/ssl/server.key index 5249dd1a4..d67414c9a 100644 --- a/lib/dl_connector_postgresql/docker-compose/db-postgres/ssl/server.key +++ b/lib/dl_connector_postgresql/docker-compose/db-postgres/ssl/server.key @@ -1,28 +1,28 @@ -----BEGIN PRIVATE KEY----- -MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDYsr6d10EryQWk -i91SmVmwuuG+h1m7HpMM2ie2NPhqMyN2Xf2A8xWKRQ3bj4IPEoAe+SfXLRTkDs12 -PJK5aTM/kauvnfmrA08QCx2LsOy+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hD +05podQozwEz3IBNITogvrh46YjJj+rDcQmuy9F3DrvGy38tGWavTLgvK7bFXo8AT +6KmUmFSGx2tqh7w3dmD2eo6lHw4QCEIhL+UQj3diAyECgYEA/eNT5xmJl3XHTDp4 +UdtPxIKSMtFCgL9J3E5IGJxPcUNssOZa1TwgnJvkUB/dpGP632O6u+8A2igKk9ra +zJG+JovaXKegr4XWowCeA+wZbXfrLig/OpFw8yqhxouvwW/wBxeNg6goU5U+3StS +prJPg0p20s1qfB7N8C+Mo6YADSMCgYEA6JwFIqDuAv3jbtgBJ+TdHmIHyj3b+S/t +Cq5QLm6uAROfPwB5HHSJXnBw9pBQDWY2YWXD1P1TEWVlHEGC7tCzGitzoSexqIjK +K65gxW+4uAJ0jfBKgky0kHcLiB/N3uW0Evx6FDC2Jrflxfgmvf6RyjoB3sC+p7af +rlKkvSTlbVECgYAVPqyKrgxhbC2dJ1diIiPuoa5yKiiSdW9MzBAkXxAWvjmeI+h9 +52YjNLhKLCBz3RnlD4dUqo87shYQgUPF0nxC5XkEP9KmXWC0ixyt31fRXTOEzUFd +OUZmUq7u2kl+uksvjLz+w1d8hwSXpURpRop4xgZjZWT/teQtsQzntMBUWQKBgCOl +PRg4ZyDoPUEQMuUlKklsplr0rc/66y1W1wy2g03A7wddkDGvHhntyzHNnabgAfdc +++yYwXEKA7uXwnPMYZXiEL8icRQtmiWlfEjlPP5dyfSyXQiorobw50B99zNwKe86 +545OhKtcRQbYZz94UmkWCJFVIiJbVw8EtSATFmFxAoGBAPD20lZEBHmjCrodyYWM +ysnq9j9hJ2P3T9bCJfsBG9qQqGK8z9wWIFi9l4xGkWVBs7UBaucOtNUtRkTLHzCh +EDS+aH84WUEkKizezp0OOJo4CyeIOiho4mrt/Vov7UuoqxAkcpxxCqsWdz3yo+xx +y5CdY9TYz7WBW3CbxdMrwNfO -----END PRIVATE KEY----- diff --git a/lib/dl_core/dl_core/connection_executors/adapters/adapters_base.py b/lib/dl_core/dl_core/connection_executors/adapters/adapters_base.py index 1e0d3572d..d440e5459 100644 --- a/lib/dl_core/dl_core/connection_executors/adapters/adapters_base.py +++ b/lib/dl_core/dl_core/connection_executors/adapters/adapters_base.py @@ -139,6 +139,9 @@ def execute_by_steps(self, db_adapter_query: DBAdapterQuery) -> Generator[Execut def test(self) -> None: pass + def get_target_host(self) -> Optional[str]: + return None + def execute_typed_query(self, typed_query: TypedQuery) -> TypedQueryResult: return self._sync_typed_query_action.run_typed_query_action(typed_query=typed_query) diff --git a/lib/dl_core/dl_core/connection_executors/adapters/adapters_base_sa.py b/lib/dl_core/dl_core/connection_executors/adapters/adapters_base_sa.py index 0f66f562b..53ee2482f 100644 --- a/lib/dl_core/dl_core/connection_executors/adapters/adapters_base_sa.py +++ b/lib/dl_core/dl_core/connection_executors/adapters/adapters_base_sa.py @@ -122,6 +122,9 @@ def conn_id(self) -> Optional[str]: def default_chunk_size(self) -> int: return self._default_chunk_size + def get_target_host(self) -> Optional[str]: + return self._target_dto.get_effective_host() + def get_extra_engine_event_listeners(self) -> list[EventListenerSpec]: return [] @@ -165,9 +168,11 @@ def execute_by_steps(self, db_adapter_query: DBAdapterQuery) -> Generator[Execut # TODO FIX: Delegate query compilation for debug to error handler or make method of debug compilation compiled_query = query if isinstance(query, str) else compile_query_for_debug(query, engine.dialect) - with db_session_context( - backend_type=self.get_backend_type(), db_engine=engine - ) as db_session, self.handle_execution_error(compiled_query), self.execution_context(): + with ( + db_session_context(backend_type=self.get_backend_type(), db_engine=engine) as db_session, + self.handle_execution_error(compiled_query), + self.execution_context(), + ): with GenericProfiler("db-exec"): result = db_session.execute( query, @@ -216,16 +221,18 @@ def get_db_version(self, db_ident: DBIdent) -> Optional[str]: @final def get_schema_names(self, db_ident: DBIdent) -> List[str]: - with self.handle_execution_error( - debug_compiled_query=f"" - ), self.execution_context(): + with ( + self.handle_execution_error(debug_compiled_query=f""), + self.execution_context(), + ): return self._get_schema_names(db_ident) @final def get_tables(self, schema_ident: SchemaIdent) -> List[TableIdent]: - with self.handle_execution_error( - debug_compiled_query=f"" - ), self.execution_context(): + with ( + self.handle_execution_error(debug_compiled_query=f""), + self.execution_context(), + ): return self._get_tables(schema_ident) @final @@ -254,10 +261,13 @@ def exc_post_processor(db_exc: exc.DatabaseQueryError) -> None: f"Unsupported type of table table definition to get info: {get_type_full_name(type(table_def))}" ) - with self.handle_execution_error( - debug_compiled_query=debug_compiled_query, - exc_post_processor=exc_post_processor, - ), self.execution_context(): + with ( + self.handle_execution_error( + debug_compiled_query=debug_compiled_query, + exc_post_processor=exc_post_processor, + ), + self.execution_context(), + ): if isinstance(table_def, TableIdent): columns = self._get_raw_columns_info(table_def) indexes: Optional[Tuple[RawIndexInfo, ...]] = None diff --git a/lib/dl_core/dl_core/connection_executors/adapters/async_adapters_aiohttp.py b/lib/dl_core/dl_core/connection_executors/adapters/async_adapters_aiohttp.py index 04fe9a809..3cd717d99 100644 --- a/lib/dl_core/dl_core/connection_executors/adapters/async_adapters_aiohttp.py +++ b/lib/dl_core/dl_core/connection_executors/adapters/async_adapters_aiohttp.py @@ -96,6 +96,9 @@ def get_session_headers(self) -> dict[str, str]: def get_session_cookies(self) -> dict[str, str]: return {} + def get_target_host(self) -> Optional[str]: + return self._target_dto.get_effective_host() + async def close(self) -> None: await self._session.close() diff --git a/lib/dl_core/dl_core/connection_executors/adapters/async_adapters_base.py b/lib/dl_core/dl_core/connection_executors/adapters/async_adapters_base.py index 83829a927..83da10c77 100644 --- a/lib/dl_core/dl_core/connection_executors/adapters/async_adapters_base.py +++ b/lib/dl_core/dl_core/connection_executors/adapters/async_adapters_base.py @@ -152,6 +152,9 @@ def _make_async_typed_query_action(self) -> AsyncTypedQueryAdapterAction: # Redefine this method to enable `execute_typedQuery` return AsyncTypedQueryActionNotImplemented() + def get_target_host(self) -> Optional[str]: + return None + async def test(self) -> None: return await self._async_test_action.run_test_action() diff --git a/lib/dl_core/dl_core/connection_executors/adapters/async_adapters_remote.py b/lib/dl_core/dl_core/connection_executors/adapters/async_adapters_remote.py index fbacbda87..237c8d9c6 100644 --- a/lib/dl_core/dl_core/connection_executors/adapters/async_adapters_remote.py +++ b/lib/dl_core/dl_core/connection_executors/adapters/async_adapters_remote.py @@ -374,6 +374,9 @@ async def execute(self, query: DBAdapterQuery) -> AsyncRawExecutionResult: return await self._execute_non_stream(query) + def get_target_host(self) -> Optional[str]: + return self._target_dto.get_effective_host() + async def get_db_version(self, db_ident: DBIdent) -> Optional[str]: return await self._make_request_parse_response( dba_actions.ActionGetDBVersion( diff --git a/lib/dl_core/dl_core/connection_executors/adapters/async_adapters_sync_wrapper.py b/lib/dl_core/dl_core/connection_executors/adapters/async_adapters_sync_wrapper.py index c3c3672a9..6026bec77 100644 --- a/lib/dl_core/dl_core/connection_executors/adapters/async_adapters_sync_wrapper.py +++ b/lib/dl_core/dl_core/connection_executors/adapters/async_adapters_sync_wrapper.py @@ -100,6 +100,9 @@ async def data_generator() -> TBIChunksGen: raw_chunk_generator=data_generator(), ) + def get_target_host(self) -> Optional[str]: + return self._sync_adapter.get_target_host() + async def test(self) -> None: await self._loop.run_in_executor(self._tpe, self._sync_adapter.test) diff --git a/lib/dl_core/dl_core/connection_executors/remote_query_executor/app_async.py b/lib/dl_core/dl_core/connection_executors/remote_query_executor/app_async.py index 6b184d5a3..8979c02dc 100644 --- a/lib/dl_core/dl_core/connection_executors/remote_query_executor/app_async.py +++ b/lib/dl_core/dl_core/connection_executors/remote_query_executor/app_async.py @@ -1,6 +1,8 @@ from __future__ import annotations import argparse +import asyncio +import ipaddress import logging import pickle import sys @@ -11,6 +13,7 @@ Union, ) +import aiodns from aiohttp import web from aiohttp.typedefs import Handler @@ -51,6 +54,7 @@ from dl_core.connection_executors.remote_query_executor.error_handler_rqe import RQEErrorHandler from dl_core.connection_executors.remote_query_executor.settings import RQESettings from dl_core.enums import RQEEventType +from dl_core.exc import SourceTimeout from dl_core.loader import ( CoreLibraryConfig, load_core_lib, @@ -74,6 +78,10 @@ class BaseView(web.View): def tpe(self) -> ContextVarExecutor: return self.request.app["tpe"] + @property + def forbid_private_addr(self) -> bool: + return self.request.app["forbid_private_addr"] + def adapter_factory( target_conn_dto: ConnTargetDTO, @@ -235,6 +243,27 @@ async def post(self) -> Union[web.Response, web.StreamResponse]: async with adapter: LOGGER.info("DBA for action was created: %s", adapter) + if self.forbid_private_addr: + target_host = adapter.get_target_host() + if target_host: + try: + ipaddress.ip_address(target_host) + host = target_host + except ValueError: + try: + resolver = aiodns.DNSResolver() + resp = await resolver.query(target_host, "A") + host = resp[0].host + except aiodns.error.DNSError: + host = None + LOGGER.warning("Cannot resolve host: %s", target_host, exc_info=True) + if host is None or ipaddress.ip_address(host).is_private: + await asyncio.sleep(30) + query = None + if isinstance(action, (act.ActionExecuteQuery, act.ActionNonStreamExecuteQuery)): + query = action.db_adapter_query.debug_compiled_query + raise SourceTimeout(db_message="Source timed out", query=query) + if isinstance(action, act.ActionExecuteQuery): return await self.handle_query_action(adapter, action.db_adapter_query) @@ -270,7 +299,7 @@ async def actual_middleware(request: web.Request, handler: Handler) -> web.Strea return actual_middleware -def create_async_qe_app(hmac_key: bytes) -> web.Application: +def create_async_qe_app(hmac_key: bytes, forbid_private_addr: bool = False) -> web.Application: req_id_service = RequestId( header_name=HEADER_REQUEST_ID, accept_logging_ctx=True, @@ -293,6 +322,7 @@ def create_async_qe_app(hmac_key: bytes) -> web.Application: # TODO FIX: Close on app exit app["tpe"] = ContextVarExecutor() + app["forbid_private_addr"] = forbid_private_addr app.router.add_route("get", "/ping", PingView) app.router.add_route("*", "/execute_action", ActionHandlingView) @@ -315,7 +345,7 @@ def get_configured_qe_app() -> web.Application: if hmac_key is None: raise Exception("No `hmac_key` set.") - return create_async_qe_app(hmac_key.encode()) + return create_async_qe_app(hmac_key.encode(), forbid_private_addr=settings.FORBID_PRIVATE_ADDRESSES) def async_qe_main() -> None: diff --git a/lib/dl_core/dl_core/connection_executors/remote_query_executor/app_sync.py b/lib/dl_core/dl_core/connection_executors/remote_query_executor/app_sync.py index 6844ac96e..41eaa982b 100644 --- a/lib/dl_core/dl_core/connection_executors/remote_query_executor/app_sync.py +++ b/lib/dl_core/dl_core/connection_executors/remote_query_executor/app_sync.py @@ -1,7 +1,10 @@ from __future__ import annotations +import ipaddress import logging import pickle +import socket +import time from typing import ( TYPE_CHECKING, Any, @@ -12,6 +15,7 @@ ) import attr +from flask import current_app from flask.json.provider import JSONProvider import flask.views from werkzeug.exceptions import ( @@ -48,6 +52,7 @@ from dl_core.connection_executors.remote_query_executor.crypto import get_hmac_hex_digest from dl_core.connection_executors.remote_query_executor.settings import RQESettings from dl_core.enums import RQEEventType +from dl_core.exc import SourceTimeout from dl_core.loader import ( CoreLibraryConfig, load_core_lib, @@ -161,9 +166,9 @@ def response_events_gen(self, db_result: "DBAdapterQueryResult", dba: SyncDirect def execute_execute_action( self, + dba: SyncDirectDBAdapter, action: act.ActionExecuteQuery, ) -> flask.Response: - dba = self.create_dba_for_action(action) try: db_result = dba.execute(action.db_adapter_query) except Exception: @@ -180,10 +185,9 @@ def execute_execute_action( def execute_non_stream_execute_action( self, + dba: SyncDirectDBAdapter, action: act.ActionNonStreamExecuteQuery, ) -> flask.Response: - dba = self.create_dba_for_action(action) - try: db_result = dba.execute(action.db_adapter_query) events: list[tuple[str, Any]] = [(RQEEventType.raw_cursor_info.value, db_result.cursor_info)] @@ -222,15 +226,30 @@ def create_dba_for_action(action: act.RemoteDBAdapterAction) -> SyncDirectDBAdap def dispatch_request(self) -> flask.Response: action = self.get_action() LOGGER.info("Got QE action request: %s", action) + dba = self.create_dba_for_action(action) + + if current_app.config["forbid_private_addr"]: + target_host = dba.get_target_host() + if target_host: + try: + host = socket.gethostbyname(target_host) + except socket.gaierror: + host = None + LOGGER.warning("Cannot resolve host: %s", target_host, exc_info=True) + if host is None or ipaddress.ip_address(host).is_private: + time.sleep(30) + query = None + if isinstance(action, (act.ActionExecuteQuery, act.ActionNonStreamExecuteQuery)): + query = action.db_adapter_query.debug_compiled_query + raise SourceTimeout(db_message="Source timed out", query=query) if isinstance(action, act.ActionExecuteQuery): - return self.execute_execute_action(action) + return self.execute_execute_action(dba, action) if isinstance(action, act.ActionNonStreamExecuteQuery): - return self.execute_non_stream_execute_action(action) + return self.execute_non_stream_execute_action(dba, action) if isinstance(action, act.NonStreamAction): - dba = self.create_dba_for_action(action) try: result = self.execute_non_streamed_action(dba, action) return flask.jsonify(action.serialize_response(result)) @@ -332,6 +351,7 @@ def create_sync_app() -> flask.Flask: hmac_key=hmac_key.encode(), ).set_up(app) + app.config["forbid_private_addr"] = settings.FORBID_PRIVATE_ADDRESSES app.add_url_rule("/ping", view_func=ping_view) app.add_url_rule("/execute_action", view_func=ActionHandlingView.as_view("execute_action")) diff --git a/lib/dl_core/dl_core/connection_executors/remote_query_executor/settings.py b/lib/dl_core/dl_core/connection_executors/remote_query_executor/settings.py index 854cb6f97..9a0ca059d 100644 --- a/lib/dl_core/dl_core/connection_executors/remote_query_executor/settings.py +++ b/lib/dl_core/dl_core/connection_executors/remote_query_executor/settings.py @@ -15,3 +15,4 @@ class RQESettings: fallback_cfg_key="CORE_CONNECTOR_WHITELIST", ) RQE_SECRET_KEY: Optional[str] = s_attrib("RQE_SECRET_KEY", missing=None, sensitive=True) # type: ignore # 2024-01-30 # TODO: Incompatible types in assignment (expression has type "Attribute[Any]", variable has type "str | None") [assignment] + FORBID_PRIVATE_ADDRESSES: bool = s_attrib("FORBID_PRIVATE_ADDRESSES", missing=False) # type: ignore diff --git a/lib/dl_core/pyproject.toml b/lib/dl_core/pyproject.toml index c6d175a63..2fce33f2d 100644 --- a/lib/dl_core/pyproject.toml +++ b/lib/dl_core/pyproject.toml @@ -100,7 +100,8 @@ module = [ "anyascii.*", "types_aiobotocore_s3.*", "mypy_boto3_s3.*", - "statcommons.*" + "statcommons.*", + "aiodns.*" ] ignore_missing_imports = true diff --git a/lib/dl_core_testing/dl_core_testing/rqe.py b/lib/dl_core_testing/dl_core_testing/rqe.py index 4a18e99cd..cd4897536 100644 --- a/lib/dl_core_testing/dl_core_testing/rqe.py +++ b/lib/dl_core_testing/dl_core_testing/rqe.py @@ -18,12 +18,14 @@ class RQEConfigurationMaker: ext_query_executer_secret_key: str = attr.ib(kw_only=True) core_connector_whitelist: Optional[Collection[str]] = attr.ib(kw_only=True, default=None) + forbid_private_addr: str = attr.ib(default="0") @contextlib.contextmanager def sync_rqe_netloc_subprocess_cm(self) -> Generator[RQEBaseURL, None, None]: env = dict( EXT_QUERY_EXECUTER_SECRET_KEY=self.ext_query_executer_secret_key, DEV_LOGGING="1", + FORBID_PRIVATE_ADDRESSES=self.forbid_private_addr, ) if self.core_connector_whitelist is not None: env["CORE_CONNECTOR_WHITELIST"] = ",".join(self.core_connector_whitelist) diff --git a/lib/dl_core_testing/dl_core_testing/testcases/remote_query_executor.py b/lib/dl_core_testing/dl_core_testing/testcases/remote_query_executor.py index 10ca4072c..56a42f4d4 100644 --- a/lib/dl_core_testing/dl_core_testing/testcases/remote_query_executor.py +++ b/lib/dl_core_testing/dl_core_testing/testcases/remote_query_executor.py @@ -26,6 +26,7 @@ from dl_core.connection_executors.models.db_adapter_data import DBAdapterQuery from dl_core.connection_executors.models.scoped_rci import DBAdapterScopedRCI from dl_core.connection_executors.remote_query_executor.app_async import create_async_qe_app +from dl_core.exc import SourceTimeout from dl_core.us_connection_base import ConnectionBase from dl_core_testing.rqe import RQEConfigurationMaker from dl_core_testing.testcases.connection_executor import BaseConnectionExecutorTestClass @@ -42,15 +43,28 @@ class BaseRemoteQueryExecutorTestClass(BaseConnectionExecutorTestClass[_CONN_TV] EXT_QUERY_EXECUTER_SECRET_KEY: ClassVar[str] = "very_secret_key" @pytest.fixture(scope="function") - def query_executor_app(self, loop: asyncio.AbstractEventLoop, aiohttp_client: AiohttpClient) -> TestClient: - app = create_async_qe_app(hmac_key=self.EXT_QUERY_EXECUTER_SECRET_KEY.encode()) + def forbid_private_addr(self) -> bool: + return False + + @pytest.fixture(scope="class") + def basic_test_query(self) -> str: + return "select 1" + + @pytest.fixture(scope="function") + def query_executor_app( + self, loop: asyncio.AbstractEventLoop, aiohttp_client: AiohttpClient, forbid_private_addr: bool + ) -> TestClient: + app = create_async_qe_app( + hmac_key=self.EXT_QUERY_EXECUTER_SECRET_KEY.encode(), forbid_private_addr=forbid_private_addr + ) return loop.run_until_complete(aiohttp_client(app)) @pytest.fixture(scope="function") - def sync_rqe_netloc_subprocess(self) -> Generator[RQEBaseURL, None, None]: + def sync_rqe_netloc_subprocess(self, forbid_private_addr: bool) -> Generator[RQEBaseURL, None, None]: with RQEConfigurationMaker( ext_query_executer_secret_key=self.EXT_QUERY_EXECUTER_SECRET_KEY, core_connector_whitelist=self.core_test_config.core_connector_ep_names, + forbid_private_addr="1" if forbid_private_addr else "0", ).sync_rqe_netloc_subprocess_cm() as sync_rqe_config: yield sync_rqe_config @@ -109,3 +123,12 @@ async def execute_request(self, remote_adapter: RemoteAsyncAdapter, query: str) resp = await remote_adapter.execute(DBAdapterQuery(query)) result = await alist(resp.get_all_rows()) return result + + @pytest.mark.asyncio + @pytest.mark.parametrize("forbid_private_addr", [True]) + async def test_forbid_private_hosts( + self, remote_adapter: RemoteAsyncAdapter, forbid_private_addr: bool, basic_test_query: str + ) -> None: + async with remote_adapter: + with pytest.raises(SourceTimeout): + await self.execute_request(remote_adapter, query=basic_test_query)