Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,9 @@ subs = client.subscriptions_sync()
- `REDIS_CLOUD_API_SECRET` - API secret
- `REDIS_CLOUD_BASE_URL` - Base URL (optional)

Python `CloudClient.from_env()` also accepts the legacy aliases
`REDIS_CLOUD_ACCOUNT_KEY`, `REDIS_CLOUD_SECRET_KEY`, and `REDIS_CLOUD_USER_KEY`.

## API Coverage

This library provides comprehensive coverage of the Redis Cloud REST API:
Expand Down
2 changes: 1 addition & 1 deletion python/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ impl PyCloudClient {
.or_else(|_| std::env::var("REDIS_CLOUD_USER_KEY"))
.map_err(|_| {
pyo3::exceptions::PyValueError::new_err(
"API secret not found. Set REDIS_CLOUD_API_SECRET",
"API secret not found. Set REDIS_CLOUD_API_SECRET, REDIS_CLOUD_SECRET_KEY, or REDIS_CLOUD_USER_KEY",
)
})?;

Expand Down
7 changes: 6 additions & 1 deletion python/tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,13 @@ def test_from_env_missing_api_secret(self):
os.environ.pop(var, None)

try:
with pytest.raises(ValueError, match="API secret not found"):
with pytest.raises(ValueError, match="API secret not found") as exc_info:
CloudClient.from_env()

message = str(exc_info.value)
assert "REDIS_CLOUD_API_SECRET" in message
assert "REDIS_CLOUD_SECRET_KEY" in message
assert "REDIS_CLOUD_USER_KEY" in message
finally:
os.environ.pop("REDIS_CLOUD_API_KEY", None)

Expand Down
Loading