-
Notifications
You must be signed in to change notification settings - Fork 19
feat: add TLS configuration support to FFI engine #1133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1133 +/- ##
==========================================
- Coverage 80.36% 75.48% -4.88%
==========================================
Files 8 9 +1
Lines 4165 4467 +302
==========================================
+ Hits 3347 3372 +25
- Misses 818 1095 +277 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Add TlsConfig struct with support for custom CA certificates, insecure skip verify, and client certificates for mutual TLS. Fixes #1132 Signed-off-by: Mark Phelps <[email protected]>
2214bd5
to
e30f7bd
Compare
Signed-off-by: Mark Phelps <[email protected]>
Update error! macro calls to use inline format arguments instead of positional arguments for better readability. Signed-off-by: Mark Phelps <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Implements initial TLS configuration support in the FFI engine, allowing clients to supply CA and client certificates (file or base64 data) and skip verification for development.
- Introduced
TlsConfig
inEngineOpts
with optional fields for CA and client certificates. - Integrated TLS settings into
HTTPFetcherBuilder
viaconfigure_tls()
. - Added unit tests covering all TLS configuration permutations and error cases.
Reviewed Changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
release/README.md | Removed a stray list marker in the release script instructions |
flipt-engine-wasm/src/lib.rs | Switched panic logging to Rust’s {e} interpolation in eprintln! calls |
flipt-engine-ffi/src/lib.rs | Added TlsConfig type, wired into EngineOpts default and FFI init paths |
flipt-engine-ffi/src/http.rs | Added configure_tls() to apply TLS options on reqwest::ClientBuilder |
Comments suppressed due to low confidence (3)
flipt-engine-ffi/src/http.rs:495
- [nitpick] Consider documenting the precedence rules (e.g.,
ca_cert_data
takes priority overca_cert_file
, and likewise for client certs) so users know which option is used when both are set.
fn configure_tls(
flipt-engine-ffi/src/lib.rs:106
- [nitpick] Add
#[serde(rename_all = "snake_case")]
toTlsConfig
to explicitly enforce and document the JSON key naming convention.
pub struct TlsConfig {
flipt-engine-ffi/src/http.rs:183
- [nitpick] Add an integration test for
HTTPFetcherBuilder::build()
with a non-Nonetls_config
to verify that the resulting client applies the expected TLS settings.
pub fn tls_config(mut self, tls_config: TlsConfig) -> Self {
Signed-off-by: Mark Phelps <[email protected]>
Signed-off-by: Mark Phelps <[email protected]>
Signed-off-by: Mark Phelps <[email protected]>
Signed-off-by: Mark Phelps <[email protected]>
Summary
Implements Phase 1 of self-signed certificate support by adding comprehensive TLS configuration to the FFI engine. This enables FFI-based client SDKs (Python, Java, C#, Ruby, Dart) to connect to Flipt servers using self-signed certificates.
Changes
Core Implementation
TlsConfig
struct inEngineOpts
with support for:ca_cert_file
/ca_cert_data
- Custom CA certificates (file path or base64 encoded)insecure_skip_verify
- Skip certificate verification (development only)client_cert_file/data
+client_key_file/data
- Client certificates for mutual TLSHTTP Client Integration
tls_config()
method toHTTPFetcherBuilder
configure_tls()
function that configuresreqwest::Client
with custom TLS settingsTesting
Usage Example
FFI clients can now pass TLS configuration via JSON:
Or with base64-encoded certificate data:
Security Considerations
insecure_skip_verify
requires explicit opt-inTesting
All tests pass including new TLS-specific tests:
Next Steps
This implements the foundation for self-signed certificate support. Future phases will:
Related
Re: #1132
Related to discussion: https://github.com/orgs/flipt-io/discussions/4366
Breaking Changes
None - all changes are backward compatible.