Skip to content

feat: support mtls for query api - #254

Open
NguyenHoangSon96 wants to merge 5 commits into
mainfrom
feat/support-mtls
Open

NguyenHoangSon96 wants to merge 5 commits into
mainfrom
feat/support-mtls

Conversation

@NguyenHoangSon96

@NguyenHoangSon96 NguyenHoangSon96 commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Closes #

Proposed Changes

  • Add support for mTLS for query API.
  • Add examples of how to configure mTLS.

Checklist

  • CHANGELOG.md updated
  • Rebased/mergeable
  • A test has been added if appropriate
  • Tests pass
  • Commit messages are conventional
  • Sign CLA (if not already signed)

@NguyenHoangSon96 NguyenHoangSon96 self-assigned this Nov 5, 2026
Copilot AI balanced review requested due to automatic review settings November 5, 2026 08:49
@NguyenHoangSon96
NguyenHoangSon96 marked this pull request as draft November 5, 2026 08:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

New required constructor parameters break existing non-mTLS callers, while invalid TLS certificate configurations prevent plaintext mock servers from initializing.

5 open issues
What changed in this PR

This PR adds mutual TLS (mTLS) support to Arrow Flight queries, extending the client’s certificate settings to the query API.

Changes:

  • Pass client certificates and private keys into Flight options, including bundled PEM support.
  • Add TLS and mTLS query/write tests and TLS-capable mock servers.
  • Add certificate fixtures and a script to regenerate them.
File Description
tests/​util/​mocks.py Adds TLS configuration to the Flight mock server.
tests/​test_influxdb_client_3.py Adds TLS and mTLS success and failure cases.
tests/​data/​certificates/​other-server.pem Bundled credentials for rejection tests.
tests/​data/​certificates/​other-server.key Private key for untrusted test credentials.
tests/​data/​certificates/​other-server.crt Certificate for rejection tests.
tests/​data/​certificates/​influxdb.pem Bundled server certificate and key.
tests/​data/​certificates/​influxdb.key Private key for TLS test servers.
tests/​data/​certificates/​influxdb.crt Certificate for trusted TLS test servers.
tests/​data/​certificates/​client.pem Bundled client credentials for mTLS tests.
tests/​data/​certificates/​client.key Client private key for mTLS tests.
tests/​data/​certificates/​client.crt Client certificate for mTLS tests.
scripts/​generate-self-signed-cert.sh Generates self-signed certificate fixtures.
influxdb_client_3/​query/​query_api.py Adds certificate options and forwards credentials to Flight.
influxdb_client_3/​__init__.py Connects client certificate settings to query options.

Review effort: Balanced

Comment thread influxdb_client_3/query/query_api.py Resolved
Comment thread tests/util/mocks.py Resolved
Comment thread influxdb_client_3/query/query_api.py Resolved
Comment thread tests/test_influxdb_client_3.py Resolved
Comment thread tests/test_influxdb_client_3.py Resolved
@NguyenHoangSon96
NguyenHoangSon96 force-pushed the feat/support-mtls branch 5 times, most recently from 6041d64 to 0d280ff Compare November 9, 2026 07:27
@codecov

codecov Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.15385% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.79%. Comparing base (ea7631b) to head (4b7b65c).

Files with missing lines Patch % Lines
influxdb_client_3/query/query_api.py 94.44% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #254      +/-   ##
==========================================
+ Coverage   89.45%   89.79%   +0.33%     
==========================================
  Files          28       28              
  Lines        2049     2096      +47     
==========================================
+ Hits         1833     1882      +49     
+ Misses        216      214       -2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread tests/test_influxdb_client_3.py Resolved
Comment thread tests/util/mocks.py Resolved
Comment thread influxdb_client_3/query/query_api.py Resolved
Comment thread scripts/generate-self-signed-cert.sh Resolved
@@ -0,0 +1,28 @@
-----BEGIN PRIVATE KEY-----
Comment thread tests/test_influxdb_client_3.py Resolved
Comment thread tests/test_influxdb_client_3.py Resolved
Comment thread tests/test_influxdb_client_3.py Resolved
Comment thread tests/util/mocks.py Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread examples/core/basic_ssl.py Resolved
Comment thread influxdb_client_3/__init__.py Resolved
@NguyenHoangSon96
NguyenHoangSon96 marked this pull request as ready for review November 10, 2026 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants