Skip to content

Conversation

markphelps
Copy link
Contributor

@markphelps markphelps commented Jun 29, 2025

Summary

  • Add comprehensive TLS configuration options to the Java client SDK, matching the functionality from the Python implementation
  • Add TlsConfig class with builder pattern and static factory methods
  • Support CA certificates (file paths and raw data), client certificates for mutual TLS, and insecure mode for development
  • Update ClientOptions and FliptClient to accept TLS configuration
  • Update tests to handle HTTPS URLs with TLS configuration automatically
  • Add comprehensive README documentation with examples

cc @cristianonicolai

@markphelps markphelps requested a review from a team as a code owner June 29, 2025 15:33
@markphelps markphelps changed the base branch from main to feat/issue-1132-python-tls-support June 29, 2025 15:33
@codecov-commenter
Copy link

codecov-commenter commented Jun 29, 2025

Codecov Report

Attention: Patch coverage is 0% with 14 lines in your changes missing coverage. Please review.

Project coverage is 75.31%. Comparing base (f701007) to head (71da9df).
Report is 433 commits behind head on main.

Files with missing lines Patch % Lines
flipt-engine-ffi/src/http.rs 0.00% 10 Missing ⚠️
flipt-engine-ffi/src/lib.rs 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1135      +/-   ##
==========================================
- Coverage   80.36%   75.31%   -5.05%     
==========================================
  Files           8        9       +1     
  Lines        4165     4477     +312     
==========================================
+ Hits         3347     3372      +25     
- Misses        818     1105     +287     

☔ View full report in Codecov by Sentry.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@markphelps markphelps force-pushed the feat/java-tls-config branch from 2be3aa8 to c30ee0d Compare June 29, 2025 15:37
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jun 29, 2025
Base automatically changed from feat/issue-1132-python-tls-support to main June 29, 2025 15:40
@dosubot dosubot bot added documentation Improvements or additions to documentation enhancement New feature or request labels Jun 29, 2025
@markphelps markphelps requested review from erka and Copilot June 29, 2025 15:48
Copilot

This comment was marked as outdated.

@markphelps markphelps force-pushed the feat/java-tls-config branch from 280026d to 830f62b Compare June 29, 2025 16:15
@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Jun 29, 2025
Signed-off-by: Mark Phelps <[email protected]>
Change TlsConfig from Lombok @value to traditional class structure
to match ClientOptions pattern and ensure proper JSON serialization

Signed-off-by: Mark Phelps <[email protected]>
Signed-off-by: Mark Phelps <[email protected]>
@markphelps markphelps force-pushed the feat/java-tls-config branch from 830f62b to 82e5446 Compare June 29, 2025 16:15
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:XXL This PR changes 1000+ lines, ignoring generated files. labels Jun 29, 2025
@markphelps markphelps requested a review from Copilot June 29, 2025 18:46
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds comprehensive TLS configuration support to the Java SDK as well as updates in related components and tests. Key changes include:

  • Adding a new TlsConfig class (with builder and static factory methods) to support custom CA certificates and mutual TLS.
  • Updating the FliptClient and ClientOptions in the Java SDK to accept TLS configuration.
  • Enhancing tests (Go, Rust, and Python) and documentation to showcase and verify TLS setup.

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test/main.go Updated container configurations to mount TLS fixtures and set HTTPS environment variables.
flipt-engine-ffi/src/lib.rs Modified TLS configuration usage with a fallback error handling mechanism for the fetcher builder.
flipt-engine-ffi/src/http.rs Added a default implementation for HTTPFetcherBuilder.
flipt-client-python/flipt_client/models.py Added certificate file validation using conditional Pydantic validators.
flipt-client-java/src/test/java/TestFliptClient.java Added TLS configuration usage in test setup for secure connections.
flipt-client-java/src/main/java/io/flipt/client/models/TlsConfig.java Introduced the new TlsConfig class implementing various TLS setup options.
flipt-client-java/src/main/java/io/flipt/client/models/ClientOptions.java Extended ClientOptions to include TLS configuration.
flipt-client-java/src/main/java/io/flipt/client/FliptClient.java Integrated TLS configuration into client instantiation and examples.
flipt-client-java/README.md Updated documentation to include examples and explanations for TLS configuration.

Copy link
Collaborator

@erka erka left a comment

Choose a reason for hiding this comment

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

nice

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jun 29, 2025
@markphelps markphelps merged commit e77a3d1 into main Jun 29, 2025
34 checks passed
@markphelps markphelps deleted the feat/java-tls-config branch June 29, 2025 23:01
markphelps added a commit that referenced this pull request Jun 29, 2025
markphelps added a commit that referenced this pull request Jun 30, 2025
* 'main' of https://github.com/flipt-io/flipt-client-sdks:
  feat: add TLS configuration support to Ruby SDK (#1136)
  feat: add TLS configuration support to Java SDK (#1135)
markphelps added a commit that referenced this pull request Jun 30, 2025
* feat: add TLS configuration support to Java SDK

Signed-off-by: Mark Phelps <[email protected]>

* chore: fmt java

Signed-off-by: Mark Phelps <[email protected]>

* chore: update java tests to use https

Signed-off-by: Mark Phelps <[email protected]>

* chore: update java test params for https

Signed-off-by: Mark Phelps <[email protected]>

* chore: add debug info for failing tests

Signed-off-by: Mark Phelps <[email protected]>

* fix: TlsConfig serialization compatibility with Rust FFI

Change TlsConfig from Lombok @value to traditional class structure
to match ClientOptions pattern and ensure proper JSON serialization

Signed-off-by: Mark Phelps <[email protected]>

* chore: fmt

Signed-off-by: Mark Phelps <[email protected]>

* chore: rm debug env vars in java tests

Signed-off-by: Mark Phelps <[email protected]>

* chore: mount tls file

Signed-off-by: Mark Phelps <[email protected]>

* chore: add default for fetcher builder

Signed-off-by: Mark Phelps <[email protected]>

* chore: check for file existence in builder

Signed-off-by: Mark Phelps <[email protected]>

* chore: add file existence checks for python too

Signed-off-by: Mark Phelps <[email protected]>

* chore: fmt

Signed-off-by: Mark Phelps <[email protected]>

* chore: default to 120 seconds on java builder

Signed-off-by: Mark Phelps <[email protected]>

* chore: only set request_timeout and update_interval in fetcher if > 0

Signed-off-by: Mark Phelps <[email protected]>

---------

Signed-off-by: Mark Phelps <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants