listrules.py v2.0#265
Open
tomstarr wants to merge 6 commits into
Open
Conversation
Assisted-by: Microsoft Copilot
Trimmed down some of the code that was surplus and added if statement to handle special user (principalTypes) when used in combination with unsupported operator types.
Changes: Removed the original 'listrules.py' from this branch. Renamed 'newlistrules.py' to 'listrules.py'. Changed csv 'csvheader' option to 'headeroff' and set the default to including a header to ensure the same default behaviour as listrules.py v1.0 was persisted. Changed VALID_PERMISSIONS from being a set to a list to ensure the permissions order returned is consistent. Renamed columns and results for: createdTimestamp --> creationTimeStamp modifiedTimestamp --> modifiedTimeStamp New features: Option to print filter and REST call without submitting Option to filter by createdBy and modifiedBy Bugfix: Fixed a bug (through the column and result renamed) affecting the created* and modified* timestamp filters didn't work.
Changes: Added usage note to -h Added limit option Added sort-by option and error handling Added sort-order option Added count-only option Added error message for when no rules are found Changed: Changed 'printfilter' option to 'print-filter' Updated -h file Signed-off-by: Tom <tom.starr@sas.com>
I, Tom <tom.starr@sas.com>, hereby add my Signed-off-by to this commit: 509b2a3 I, Tom <tom.starr@sas.com>, hereby add my Signed-off-by to this commit: 7ebce12 I, Tom <tom.starr@sas.com>, hereby add my Signed-off-by to this commit: 3f6bcb6 I, Tom <tom.starr@sas.com>, hereby add my Signed-off-by to this commit: 5029cb8 Signed-off-by: Tom <tom.starr@sas.com>
Member
|
@tomstarr I did some testing, a lot of nice functionality. I did find a change in behavior that might impact existing users. The default query in the current version uses contains on the URI. But the default in the new one is equals. Can we change the default to contains so that we preserver backward compatibility. You can test with: ./listrules.py -u /identities/groups -p SASAdministrators -o csv It should return the same for new and old. Thanks. |
Collaborator
Author
|
@gerrynelson63 thanks for testing and for highlighting the potential for a regression issue. I tried a quick fix on Monday, but found it to be a little more complicated than I'd hoped for. |
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.
Complete rewrite of listrules.py to provide greater capabilities for filtering a rule search with integrated error handling.
New capabilities: