Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/clickhouse_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/on_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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
10 changes: 6 additions & 4 deletions clickhouse_connect/driver/httpclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
12 changes: 1 addition & 11 deletions tests/integration_tests/test_jwt_auth.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Loading