←
KAFKA-3
Created: 2026-02-03
•
Updated: 2026-02-03
Relationships
Loading...
Attachments
Loading...
Comments (3)
QA-Agent
·
2026-02-03
## QA Verification Complete ✅
**Status**: PASSED - All acceptance criteria met
**Test Results**: 26/26 tests passing
- All existing tests pass
- New tests added for CF token functionality
- Edge cases covered (partial credentials, backward compatibility)
**Verification Summary**:
✅ Config dataclass has CF token fields (cf_client_id, cf_client_secret)
✅ YAML config support with per-profile CF tokens
✅ Environment variable support (KAFKAHQ_CF_CLIENT_ID, KAFKAHQ_CF_CLIENT_SECRET)
✅ CLI flag support (--cf-client-id, --cf-client-secret)
✅ Priority resolution correct (CLI > env > config > defaults)
✅ HTTP headers added to client requests (CF-Access-Client-Id, CF-Access-Client-Secret)
✅ Tests updated and comprehensive
✅ Fully backward compatible with existing configs
**Files Modified**: 4 files, +137/-6 lines
- src/kafkactl/cli.py
- src/kafkactl/client.py
- src/kafkactl/config.py
- tests/test_config.py
**Edge Cases Verified**:
- Partial credentials handled correctly (headers only added when BOTH present)
- Legacy configs without CF fields continue to work
**Commit**: 31e22cf (merged to master)
**Full QA Report**: /tmp/qa-KAFKA-3.md
**Recommendation**: Ready for production use.
agent
·
2026-02-03
## Implementation Complete
**Problem Addressed:**
Added Cloudflare Access service token support to enable headless/automated authentication without browser interaction.
**Changes Made:**
1. **src/kafkactl/config.py** (lines 56-76, 78-163, 205-213, 261-291):
- Added `cf_client_id` and `cf_client_secret` fields to `KafkaCtlConfig` dataclass
- Updated `load()` method to accept CF token parameters
- Added support for `KAFKAHQ_CF_CLIENT_ID` and `KAFKAHQ_CF_CLIENT_SECRET` environment variables
- Updated `_load_from_file()` to load CF tokens from YAML config
- Updated default config template with CF token comments
2. **src/kafkactl/cli.py** (lines 83-92, 120-134, 149-158):
- Added `--cf-client-id` and `--cf-client-secret` CLI flags
- Updated docstring to document new options
- Pass CF tokens to `KafkaCtlConfig.load()`
3. **src/kafkactl/client.py** (lines 131-135):
- Added CF-Access-Client-Id and CF-Access-Client-Secret headers when BOTH credentials are provided
4. **tests/test_config.py**:
- Updated existing tests to include CF token assertions
- Added `test_config_partial_cf_credentials()` for edge case testing
- Added `test_config_cf_credentials_backward_compatible()` for backward compatibility
**Verification:**
- All 26 tests pass
- CLI `--help` shows new flags correctly
- Priority resolution works: CLI > env vars > config file > defaults
- Backward compatible with existing configs (CF fields default to None)
- Partial credentials edge case handled: headers only added when BOTH id and secret provided
**Commit:** 31e22cf - Merged to master
triage-agent
·
2026-02-03
## Feature Triage Complete
**Status:** NOT IMPLEMENTED - Ready for implementation
**Summary:** This feature adds Cloudflare Access service token support to enable headless/automated authentication without browser interaction. The implementation follows existing patterns for config fields (username/password) and requires changes to 3 files.
**Implementation Location:**
- `src/kafkactl/config.py` - Add `cf_client_id` and `cf_client_secret` dataclass fields
- `src/kafkactl/cli.py` - Add `--cf-client-id` and `--cf-client-secret` CLI flags
- `src/kafkactl/client.py` - Add CF headers to HTTP requests
**Complexity:** Low (~50 lines of code + tests)
**Dependencies:** None - uses existing httpx for headers
**Edge Cases Identified:**
1. Handle partial credentials (only one of id/secret provided)
2. Priority with browser cookie extraction (explicit tokens should win)
See full triage report at /tmp/triage-KAFKA-3.md