Handled Google Directory API bug in gam print groups that caused a trap.

This commit is contained in:
Ross Scroggs
2023-08-09 15:17:55 -07:00
parent cccc51283a
commit 790d38b646
3 changed files with 18 additions and 5 deletions

View File

@ -10,6 +10,10 @@ Add the `-s` option to the end of the above commands to suppress creating the `g
See [Downloads](https://github.com/taers232c/GAMADV-XTD3/wiki/Downloads) for Windows or other options, including manual installation.
### 6.62.03
Handled Google Directory API bug in `gam print groups` that caused a trap.
### 6.62.02
Fixed bug introduced in 6.62.01 that caused a trap that broke `redirect csv ... multiprocess`.

View File

@ -2,6 +2,10 @@
Merged GAM-Team version
6.62.03
Handled Google Directory API bug in `gam print groups` that caused a trap.
6.62.02
Fixed bug introduced in 6.62.01 that caused a trap that broke `redirect csv ... multiprocess`.

View File

@ -2375,8 +2375,11 @@ def invalidQuery(query):
def invalidMember(kwargs):
if 'userKey' in kwargs:
badRequestWarning(Ent.GROUP, Ent.MEMBER, kwargs['userKey'])
else:
return True
if 'query' in kwargs:
badRequestWarning(Ent.GROUP, Ent.QUERY, invalidQuery(kwargs['query']))
return True
return False
def invalidUserSchema(schema):
if isinstance(schema, list):
@ -30821,8 +30824,9 @@ def doPrintGroups():
pageMessage=getPageMessage(showFirstLastItems=True), messageAttribute='email',
throwReasons=GAPI.GROUP_LIST_USERKEY_THROW_REASONS,
orderBy='email', fields=cdfieldsnp, maxResults=maxResults, **kwargs)
except (GAPI.invalidMember, GAPI.invalidInput):
invalidMember(kwargs)
except (GAPI.invalidMember, GAPI.invalidInput) as e:
if not invalidMember(kwargs):
entityActionFailedExit([Ent.GROUP, None], str(e))
entityList = []
except (GAPI.resourceNotFound, GAPI.domainNotFound, GAPI.forbidden, GAPI.badRequest):
if kwargs.get('domain'):
@ -31052,8 +31056,9 @@ def getGroupMembersEntityList(cd, entityList, matchPatterns, fieldsList, kwargs)
pageMessage=getPageMessage(showFirstLastItems=True), messageAttribute='email',
throwReasons=GAPI.GROUP_LIST_USERKEY_THROW_REASONS,
orderBy='email', fields=f'nextPageToken,groups({",".join(set(fieldsList))})', **kwargs)
except (GAPI.invalidMember, GAPI.invalidInput):
invalidMember(kwargs)
except (GAPI.invalidMember, GAPI.invalidInput) as e:
if not invalidMember(kwargs):
entityActionFailedExit([Ent.GROUP, None], str(e))
entityList = []
except (GAPI.resourceNotFound, GAPI.domainNotFound, GAPI.forbidden, GAPI.badRequest):
if kwargs.get('domain'):