Add standalone --directory UDS corporate-directory harvest - #26
Merged
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Adds --directory and --directory-outfile CLI args that harvest the unauthenticated CUCM UDS corporate directory, always printing a console table and writing a CSV, then exiting. Requires -H/--host. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Remove developer-local cwd= from all three subprocess.run calls so tests run on any machine. Add sqlite3 assertion to confirm uds_directory table is populated when --db is passed. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Wires args.directory_outfile into the --userenum directory export so the README's documented override is real, hoists the sqlite3 import, and adds a regression test for the --userenum --directory-outfile path. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The harvest and uds_directory table already capture middleName, but _DIRECTORY_CSV_COLUMNS and the --show-db companion SELECTs dropped it, silently losing the field on export. Add middle_name in all three aligned spots (column tuple + both SELECTs) so live --directory and DB-sourced exports stay in sync. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The /cucm-uds/users response exposes 17 fields; the harvest previously dropped nickName, directoryUri, and pager. Add all three across the field map, CSV columns, table schema, INSERT/upsert, and the --show-db SELECTs (kept in a single canonical column order). Existing thief.db files are migrated with ALTER TABLE ADD COLUMN since CREATE TABLE IF NOT EXISTS does not add columns to an already-created table. directoryUri is the notable add — it is the user's SIP/email-style directory address. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Removes the --uds-devices / --uds-user / --uds-password feature and its
backing functions (get_user_devices_authenticated,
enumerate_devices_authenticated, parse_uds_device_collection). This was the
only path that authenticated to UDS with end-user credentials to sweep
per-user /cucm-uds/user/{id}[/devices] records.
The unauthenticated device probe (get_user_devices_unauthenticated,
enumerate_devices_unauthenticated, used by --userenum), the uds_devices
table, parse_uds_devices, and download_uds_discovered_configs are all kept.
Drops the dedicated CLI test file and the authenticated-path unit tests;
updates README and --uds-port help text.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--directoryflag that harvests the unauthenticated CUCM UDS corporate directory (/cucm-uds/users) — usernames, extensions (phoneNumber), and contact fields (email, department, title, home/mobile numbers) — without the device probing, config downloads, or password spraying that--userenumperforms.cucm_directory.csvby default (override with--directory-outfile), prints a console summary table, and persists to theuds_directorytable unless--no-db.--userenumnow always writes its companion directory CSV instead of silently requiring--csv.--directory-outfileis honored on both paths.print_directory_tablehelper. README documents the flag, including an honest note that the unauthenticated UDS directory exposes no dedicated DID field (phoneNumberis the extension/DN, which in some dial plans is the full DID; true external DIDs require authenticated AXL).Test Plan
uv run pytest -q— 242 passed, 2 skipped--directoryrequires-H; writes CSV + table without--csv;--no-dbstill writes CSV + persists check;--userenumwrites directory without--csv;--userenumhonors--directory-outfileprint_directory_table(rows + display-name fallback + empty-list safety)🤖 Generated with Claude Code