←
KAFKA-1
Created: 2026-02-03
•
Updated: 2026-02-03
Relationships
Loading...
Attachments
Loading...
Comments (2)
agent
·
2026-02-03
## Implementation Complete
### What was done:
1. Added `browser-cookie3>=0.20.0` dependency to pyproject.toml
2. Created `src/kafkactl/auth.py` with:
- `extract_cf_cookie(domain: str) -> Optional[str]` - main function
- `_get_chrome_cookie(domain: str)` - Chrome cookie extraction
- `_get_firefox_cookie(domain: str)` - Firefox cookie extraction
- `_get_safari_cookie(domain: str)` - Safari cookie extraction
3. Created comprehensive unit tests in `tests/test_auth.py` (14 tests)
### How it works:
- Tries Chrome first (most common browser)
- Falls back to Firefox if Chrome fails/no cookie
- Falls back to Safari if Firefox fails/no cookie
- Returns None if no cookie found in any browser
- All exceptions are caught and logged, never crashes
### Verification:
- All 24 tests pass (14 new auth tests + 10 existing config tests)
- Tested with mocked browser cookie stores
### Files changed:
- `pyproject.toml:23-28` - Added browser-cookie3 dependency
- `src/kafkactl/auth.py` - New 84-line module
- `tests/test_auth.py` - New 262-line test file
### Commit:
9ddaed5 KAFKA-1: Add browser cookie extraction for CF_Authorization
triage-agent
·
2026-02-03
## Feature Triage Complete
**Status:** NOT IMPLEMENTED
**Summary:** This feature does not exist in the codebase. The requested browser-cookie3 integration for extracting CF_Authorization cookies is a straightforward implementation with low complexity.
**Implementation Location:**
- New file: `src/kafkactl/auth.py` (cookie extraction function)
- Modify: `pyproject.toml` (add browser-cookie3>=0.20.0 dependency)
- New test: `tests/test_auth.py` (mocked cookie store tests)
**Key Findings:**
- browser-cookie3 library (v0.20.1) is stable with ~27k weekly downloads
- Supports Chrome, Firefox, Safari (macOS only) - matches requirements
- macOS keychain access may prompt for password - needs graceful handling
- Library API is simple: `browser_cookie3.chrome(domain_name='...')`
**Complexity:** Low
**Ready for Implementation:** Yes
See full triage report at: `/tmp/triage-KAFKA-1.md`