Add --visualize option to admin assignments - #134
Open
saimeda32 wants to merge 2 commits into
Open
Conversation
Writes the assignment list as a self-contained interactive HTML page in addition to the normal CSV output. The page shows principals, permission sets, and accounts as three columns with a line per assignment. You can hover a node to preview its access, click it to pin the full paths, search by name or account id, or switch to a plain table view. Dark mode follows the OS setting. The file makes no network requests and embeds the data directly, so it can be opened offline. Values are escaped when injected so a hostile principal or account name cannot break out of the script tag. The filename is optional; plain --visualize writes access-graph.html. All existing filters apply to the graph as well, and the CSV output is unchanged. Includes tests for the renderer and docs with a screenshot generated from example data.
The completion message was a log line that only appears with -v. Print it in green to stderr instead, with a file:// link that most terminals make clickable. Goes to stderr so piping the CSV output stays clean.
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.
The CSV that
admin assignmentsprints is complete, but it gets hard to review once an org has more than a few accounts. Ours is around 230 rows, and answering a question like "what can this group reach" means grepping.This adds a
--visualizeoption that writes the same results as an interactive HTML page, next to the normal CSV output:What the page does:
Implementation notes:
visualize.py, no new runtime dependencies<and the JS line separators), so a hostile principal or account name cannot break out of the script element--group,--permission-set,--ou, and so on) apply to the graph too; the CSV output is unchanged; the filename is optional and defaults toaccess-graph.htmlTesting:
cli/tests(9 tests); pytest added as a dev dependencyDocs: new section in
docs/lookup.mdplus a pointer in the README.Happy to adjust naming, restructure the template, or drop the screenshot from the repo if you prefer to keep images out of it.