immudb-py
immudb-py copied to clipboard
Add SSL credentials support for secure gRPC channels
trafficstars
Description
This PR adds native support for secure gRPC channels in the ImmuDB Python client by introducing an optional ssl_credentials parameter to the ImmudbClient constructor.
Changes
- Added
ssl_credentialsparameter toImmudbClient.__init__ - Modified channel creation logic to support both secure and insecure channels
- Updated documentation to reflect new parameter
- Maintained backward compatibility with existing implementations
Example Usage
Create secure channel
credentials = grpc.ssl_channel_credentials()
client = ImmudbClient(immudUrl="host:port", ssl_credentials=credentials)
Existing usage remains unchanged
client = ImmudbClient(immudUrl="host:port") # Creates insecure channel
Related Issue
Closes #79
Testing
- Tested with both secure and insecure connections
- Verified backward compatibility
- Tested with production ALB setup
Documentation
Updated docstring in ImmudbClient.__init__ to document the new parameter.