diff --git a/.github/workflows/clickhouse_ci.yml b/.github/workflows/clickhouse_ci.yml index 8e020cdb..da03a1a7 100644 --- a/.github/workflows/clickhouse_ci.yml +++ b/.github/workflows/clickhouse_ci.yml @@ -34,7 +34,7 @@ jobs: CLICKHOUSE_CONNECT_TEST_CLOUD: 'True' CLICKHOUSE_CONNECT_TEST_HOST: ${{ secrets.INTEGRATIONS_TEAM_TESTS_CLOUD_HOST_SMT }} CLICKHOUSE_CONNECT_TEST_PASSWORD: ${{ secrets.INTEGRATIONS_TEAM_TESTS_CLOUD_PASSWORD_SMT }} - CLICKHOUSE_CONNECT_TEST_JWT_SECRET: ${{ secrets.INTEGRATIONS_TEAM_TESTS_CLOUD_JWT_PRIVATE_KEY }} + CLICKHOUSE_CONNECT_TEST_JWT_SECRET: ${{ secrets.INTEGRATIONS_TEAM_TESTS_CLOUD_JWT_DESERT_VM_43 }} run: pytest tests/integration_tests - name: Run ClickHouse Container (LATEST) diff --git a/.github/workflows/on_push.yml b/.github/workflows/on_push.yml index c9fa619a..664bfbd7 100644 --- a/.github/workflows/on_push.yml +++ b/.github/workflows/on_push.yml @@ -67,9 +67,9 @@ jobs: clickhouse-version: - '24.3' - '24.8' - - '24.9' - '24.10' - '24.11' + - '24.12' - latest name: Local Tests Py=${{ matrix.python-version }} CH=${{ matrix.clickhouse-version }} @@ -152,6 +152,6 @@ jobs: CLICKHOUSE_CONNECT_TEST_PORT: 8443 CLICKHOUSE_CONNECT_TEST_HOST: ${{ secrets.INTEGRATIONS_TEAM_TESTS_CLOUD_HOST_SMT }} CLICKHOUSE_CONNECT_TEST_PASSWORD: ${{ secrets.INTEGRATIONS_TEAM_TESTS_CLOUD_PASSWORD_SMT }} - CLICKHOUSE_CONNECT_TEST_JWT_SECRET: ${{ secrets.INTEGRATIONS_TEAM_TESTS_CLOUD_JWT_PRIVATE_KEY }} + CLICKHOUSE_CONNECT_TEST_JWT_SECRET: ${{ secrets.INTEGRATIONS_TEAM_TESTS_CLOUD_JWT_DESERT_VM_43 }} SQLALCHEMY_SILENCE_UBER_WARNING: 1 run: pytest tests/integration_tests diff --git a/clickhouse_connect/driver/httpclient.py b/clickhouse_connect/driver/httpclient.py index 08521113..5f5bd9da 100644 --- a/clickhouse_connect/driver/httpclient.py +++ b/clickhouse_connect/driver/httpclient.py @@ -408,16 +408,18 @@ def _raw_request(self, data = data.encode() headers = dict_copy(self.headers, headers) attempts = 0 + final_params = {} if server_wait: - params['wait_end_of_query'] = '1' + final_params['wait_end_of_query'] = '1' # We can't actually read the progress headers, but we enable them so ClickHouse sends something # to keep the connection alive when waiting for long-running queries and (2) to get summary information # if not streaming if self._send_progress: - params['send_progress_in_http_headers'] = '1' + final_params['send_progress_in_http_headers'] = '1' if self._progress_interval: - params['http_headers_progress_interval_ms'] = self._progress_interval - final_params = dict_copy(self.params, params) + final_params['http_headers_progress_interval_ms'] = self._progress_interval + final_params = dict_copy(self.params, final_params) + final_params = dict_copy(final_params, params) url = f'{self.url}?{urlencode(final_params)}' kwargs = { 'headers': headers, diff --git a/tests/integration_tests/test_jwt_auth.py b/tests/integration_tests/test_jwt_auth.py index b1c36033..02249cd5 100644 --- a/tests/integration_tests/test_jwt_auth.py +++ b/tests/integration_tests/test_jwt_auth.py @@ -1,7 +1,5 @@ -from datetime import datetime, timezone, timedelta from os import environ -import jwt import pytest from clickhouse_connect.driver import create_client, ProgrammingError, create_async_client @@ -157,12 +155,4 @@ def make_access_token(): secret = environ.get(JWT_SECRET_ENV_KEY) if not secret: raise ValueError(f'{JWT_SECRET_ENV_KEY} environment variable is not set') - payload = { - 'iss': 'ClickHouse', - 'sub': 'CI_Test', - 'aud': '1f7f78b8-da67-480b-8913-726fdd31d2fc', - 'clickhouse:roles': ['default'], - 'clickhouse:grants': [], - 'exp': datetime.now(tz=timezone.utc) + timedelta(minutes=15) - } - return jwt.encode(payload, secret, algorithm='RS256') + return secret