codenotary / codenotary/immudb-py
Add support for secure gRPC channels in ImmudbClient
- Dominant language
- Python
- Stars
- 52
- Forks
- 8
- PR merge metrics
- No merged PRs in 30d
Description
## Current Behavior
The current implementation of `ImmudbClient` only supports insecure gRPC channels (`grpc.insecure_channel`). This makes it challenging to use ImmuDB in production environments where TLS/SSL is required, such as when connecting through an Application Load Balancer (ALB) or when security policies mandate encrypted connections.
## Proposed Solution
Add support for secure gRPC channels by:
1. Adding an optional `ssl_credentials` parameter to `ImmudbClient.__init__`
2. Creating a secure channel when credentials are provided
3. Maintaining backward compatibility by defaulting to insecure channel
## Current Workaround
Users currently need to manually override the channel after client creation:
```python
credentials = grpc.ssl_channel_credentials()
channel = grpc.secure_channel(target=f"{host}:{port}", credentials=credentials)
client = ImmudbClient(...)
client.channel.close() # Close existing insecure channel
client.channel = channel
client.resetStub()
```
This workaround is functional but not ideal for production use.
Contributor guide
No contributing guide indexed for this repository
Research direction
Locate ImmudbClient.__init__ and the current grpc.insecure_channel call, then review how the channel and resetStub are initialized. Check the existing client tests or channel setup for coverage. Done means an optional ssl_credentials value creates a secure channel while the default remains backward-compatible and insecure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- grpc, python
- Domain
- api, security
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100