AltimateAI / AltimateAI/altimate-code
Warehouse password silently lost when keyring is not installed
- 主要語言
- TypeScript
- 星號
- 811
- 分支
- 134
- 平均合併
- 3 天 2 小時
- 30 天內合併 PR
- 50
描述
When adding a Snowflake warehouse connection via `warehouse_add`, the password is silently discarded if the `keyring` Python package is not installed in the altimate-engine's venv (`~/.local/share/altimate-code/engine/venv/`).
## Root Cause
`credential_store.py` → `save_connection()` always sets sensitive fields to `null` in `connections.json` and attempts to store them in the OS keychain via `keyring`. However, `_keyring_available()` returns `False` when `keyring` is not installed, and `store_credential()` silently returns `False` — so the password is removed from the JSON file but never persisted anywhere.
## Steps to Reproduce
1. Fresh install of `altimate-code` via Homebrew on macOS
2. The engine venv at `~/.local/share/altimate-code/engine/venv/` does not include `keyring`
3. Run `warehouse_add` with Snowflake credentials including a password
4. `connections.json` is written with `"password": null`
5. `warehouse_test` fails with `251006: Password is empty`
6. No error or warning is shown to the user during `warehouse_add`
## Expected Behavior
Either:
- `keyring` should be bundled as a dependency of the engine venv, OR
- If keyring is unavailable, fall back to storing the password in `connections.json` (with a warning about plaintext storage), OR
- Surface an error at `warehouse_add` time: "Warning: password could not be saved — keyring package is missing"
## Additional Context
- The MCP server process also caches `_keyring_cache = False` at the module level (`credential_store.py`), so even after installing `keyring`, a full restart of the MCP server is required before it takes effect.
- `snowflake-connector-python` was also missing from the engine venv and had to be manually installed.
## Workaround
Manually install keyring into the engine venv:
```
~/.local/share/altimate-code/engine/venv/bin/python3 -m pip install keyring
```
Then re-add the connection and restart the MCP server/IDE.
---
### Metadata
| Field | Value |
|-------|-------|
| CLI Version | v0.2.5 |
| Platform | darwin |
| Architecture | arm64 |
| OS Release | 25.3.0 |
| Category | bug |
| Working Directory | AI-Tools |
| Session ID | ses_307cc9cbaffexaotgpBFFWoqh6 |
貢獻指南
評估
這個 Issue 還沒有評估資料。