-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed logic flaw in
gam print|show policies
where non-matching poli…
…cies were displayed.
- Loading branch information
Showing
4 changed files
with
20 additions
and
12 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ | |
""" | ||
|
||
__author__ = 'Ross Scroggs <[email protected]>' | ||
__version__ = '7.00.37' | ||
__version__ = '7.00.38' | ||
__license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)' | ||
|
||
#pylint: disable=wrong-import-position | ||
|
@@ -35047,13 +35047,17 @@ def _cleanPolicy(policy, add_warnings, no_appnames, | |
policy['warning'] = CIPOLICY_ADDITIONAL_WARNINGS[policy['setting']['type']] | ||
if groupId := policy['policyQuery'].get('group'): | ||
_, _, policy['policyQuery']['groupEmail'] = convertGroupCloudIDToEmail(groups_ci, groupId) | ||
if groupEmailPattern is not None and not groupEmailPattern.match(policy['policyQuery']['groupEmail']): | ||
return False | ||
# all groups are in the root OU so the orgUnit attribute is useless | ||
policy['policyQuery'].pop('orgUnit', None) | ||
if groupEmailPattern is not None: | ||
return groupEmailPattern.match(policy['policyQuery']['groupEmail']) | ||
if orgUnitPathPattern is not None: | ||
return False | ||
elif orgId := policy['policyQuery'].get('orgUnit'): | ||
policy['policyQuery']['orgUnitPath'] = convertOrgUnitIDtoPath(cd, orgId) | ||
if orgUnitPathPattern is not None and not orgUnitPathPattern.match(policy['policyQuery']['orgUnitPath']): | ||
if orgUnitPathPattern is not None: | ||
return orgUnitPathPattern.match(policy['policyQuery']['orgUnitPath']) | ||
if groupEmailPattern is not None: | ||
return False | ||
return True | ||
|
||
|