From 3a41b31e19c0498404138069e3b2c335608cda70 Mon Sep 17 00:00:00 2001 From: Ross Scroggs Date: Fri, 27 May 2022 13:44:43 -0700 Subject: [PATCH 1/9] Use i, not 6 (#1526) --- src/gam/gapi/directory/roleassignments.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gam/gapi/directory/roleassignments.py b/src/gam/gapi/directory/roleassignments.py index 2248e611..8648389a 100644 --- a/src/gam/gapi/directory/roleassignments.py +++ b/src/gam/gapi/directory/roleassignments.py @@ -27,7 +27,7 @@ def create(): body['scopeType']) if body['scopeType'] == 'ORG_UNIT': orgUnit, orgUnitId = gapi_directory_orgunits.getOrgUnitId( - sys.argv[6], cd) + sys.argv[i], cd) body['orgUnitId'] = orgUnitId[3:] scope = f'ORG_UNIT {orgUnit}' i = 7 From 4d116e81c82af42a241a55d44edc05b904f483db Mon Sep 17 00:00:00 2001 From: Ross Scroggs Date: Tue, 31 May 2022 08:24:37 -0700 Subject: [PATCH 2/9] Eliminate orgUnitPath encoding (#1527) --- src/gam/gapi/directory/orgunits.py | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/src/gam/gapi/directory/orgunits.py b/src/gam/gapi/directory/orgunits.py index 6be28893..ef0b404d 100644 --- a/src/gam/gapi/directory/orgunits.py +++ b/src/gam/gapi/directory/orgunits.py @@ -373,17 +373,20 @@ def makeOrgUnitPathRelative(path): def encodeOrgUnitPath(path): - if path.find('+') == -1 and path.find('%') == -1: - return path - encpath = '' - for c in path: - if c == '+': - encpath += '%2B' - elif c == '%': - encpath += '%25' - else: - encpath += c - return encpath +# 6.22 - This method no longer works. +# % no longer needs encoding and + is handled incorrectly in API with or without encoding + return path +# if path.find('+') == -1 and path.find('%') == -1: +# return path +# encpath = '' +# for c in path: +# if c == '+': +# encpath += '%2B' +# elif c == '%': +# encpath += '%25' +# else: +# encpath += c +# return encpath def getOrgUnitItem(orgUnit, pathOnly=False, absolutePath=True): From 0eafee31058ccceb40e77845d050e524afd6fd62 Mon Sep 17 00:00:00 2001 From: Jay Lee Date: Tue, 31 May 2022 11:54:13 -0400 Subject: [PATCH 3/9] [no ci] upgrade test runs to Ubuntu 22.04 --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3227755e..c746f0d9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -49,22 +49,22 @@ jobs: goal: build arch: Win32 openssl_archs: VC-WIN32 - - os: ubuntu-20.04 + - os: ubuntu-22.04 goal: test python: "3.7" jid: 7 arch: x86_64 - - os: ubuntu-20.04 + - os: ubuntu-22.04 goal: test python: "3.8" jid: 8 arch: x86_64 - - os: ubuntu-20.04 + - os: ubuntu-22.04 goal: test python: "3.9" jid: 9 arch: x86_64 - - os: ubuntu-20.04 + - os: ubuntu-22.04 goal: test python: "3.11-dev" jid: 10 From c4deb29b2189add7f0b3578c63e5b71984584092 Mon Sep 17 00:00:00 2001 From: Jay Lee Date: Tue, 31 May 2022 12:20:50 -0400 Subject: [PATCH 4/9] Update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c746f0d9..6902c2de 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -628,7 +628,7 @@ jobs: $gam print vaultmatters matterstate open $gam print vaultholds matter $matterid $gam print vaultcount matter $matterid corpus mail everyone todrive - $gam create vaultexport matter $matterid name "GHA export $newbase" corpus mail accounts $newuser use_new_export true + $gam create vaultexport matter $matterid name "GHA export $newbase" corpus mail accounts $newuser use_new_export false $gam print exports matter $matterid | $gam csv - gam info export $matterid id:~~id~~ $gam csv sample.csv gam user ~email add calendar id:$newresource $gam delete resource $newresource From d15bab5a292e312fb8d87df9dd010567c9500ea6 Mon Sep 17 00:00:00 2001 From: Jay Lee Date: Mon, 6 Jun 2022 13:43:57 -0400 Subject: [PATCH 5/9] Update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6902c2de..15e86e59 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -82,7 +82,7 @@ jobs: with: path: | bin - key: gam-${{ matrix.jid }}-20220525 + key: gam-${{ matrix.jid }}-20220606 - name: Use pre-compiled Python for testing if: matrix.python != '' From 3d149643656f860d4bea6d4853dd3ddfbf8654d3 Mon Sep 17 00:00:00 2001 From: Ross Scroggs Date: Fri, 10 Jun 2022 08:16:15 -0700 Subject: [PATCH 6/9] Add address fields to buildings (#1529) --- src/GamCommands.txt | 7 +++++++ src/gam/gapi/directory/resource.py | 26 ++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/src/GamCommands.txt b/src/GamCommands.txt index e5ccf6a6..05d34eec 100644 --- a/src/GamCommands.txt +++ b/src/GamCommands.txt @@ -682,12 +682,19 @@ Specify a collection of Users by directly specifying them or by specifying items ## Item attributes ::= + (address|addresslines )| + (city|locality )| + (country|regioncode )| (description )| (floors )| (id )| + (language|languageCode )| (latitude )| (longitude )| (name ) + (state|administrativearea )| + (sublocality )| + (zipcode|postalcode ) ::= (selected )|(hidden )|(summary )|(colorindex|colorid )|(backgroundcolor )|(foregroundcolor )| diff --git a/src/gam/gapi/directory/resource.py b/src/gam/gapi/directory/resource.py index a7b81f78..eb744934 100644 --- a/src/gam/gapi/directory/resource.py +++ b/src/gam/gapi/directory/resource.py @@ -227,6 +227,22 @@ def printFeatures(): display.write_csv_file(csvRows, titles, 'Features', to_drive) +BUILDING_ADDRESS_FIELD_MAP = { + 'address': 'addressLines', + 'addresslines': 'addressLines', + 'administrativearea': 'administrativeArea', + 'city': 'locality', + 'country': 'regionCode', + 'language': 'languageCode', + 'languagecode': 'languageCode', + 'locality': 'locality', + 'postalcode': 'postalCode', + 'regioncode': 'regionCode', + 'state': 'administrativeArea', + 'sublocality': 'sublocality', + 'zipcode': 'postalCode', + } + def _getBuildingAttributes(args, body={}): i = 0 while i < len(args): @@ -253,6 +269,16 @@ def _getBuildingAttributes(args, body={}): elif myarg == 'floors': body['floorNames'] = args[i + 1].split(',') i += 2 + elif myarg in BUILDING_ADDRESS_FIELD_MAP: + myarg = BUILDING_ADDRESS_FIELD_MAP[myarg] + body.setdefault('address', {}) + if myarg == 'addressLines': + body['address'][myarg] = args[i + 1].split('\n') + elif myarg == 'languageCode': + body['address'][myarg] = LANGUAGE_CODES_MAP.get(args[i + 1].lower(), args[i + 1]) + else: + body['address'][myarg] = args[i + 1] + i += 2 else: controlflow.invalid_argument_exit(myarg, 'gam create|update building') From b45ad5dcafc217690afc3c2e7086c1895f036172 Mon Sep 17 00:00:00 2001 From: Jay Lee Date: Fri, 17 Jun 2022 08:23:29 -0400 Subject: [PATCH 7/9] Update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 15e86e59..79bd03d5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -82,7 +82,7 @@ jobs: with: path: | bin - key: gam-${{ matrix.jid }}-20220606 + key: gam-${{ matrix.jid }}-20220617 - name: Use pre-compiled Python for testing if: matrix.python != '' From 72ff9ff7e928022921cb0833bf8b64ca3637457f Mon Sep 17 00:00:00 2001 From: Jay Lee Date: Tue, 21 Jun 2022 12:53:10 -0400 Subject: [PATCH 8/9] rebuild to start using OpenSSL 3.0.4 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 79bd03d5..19e74d4c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -82,7 +82,7 @@ jobs: with: path: | bin - key: gam-${{ matrix.jid }}-20220617 + key: gam-${{ matrix.jid }}-20220621 - name: Use pre-compiled Python for testing if: matrix.python != '' From c6334d2bcdba05b37a80d8f300672c2f0c0d4f70 Mon Sep 17 00:00:00 2001 From: Ross Scroggs Date: Mon, 27 Jun 2022 11:50:17 -0700 Subject: [PATCH 9/9] Allow super admin to delete any shared drive (#1533) --- src/GamCommands.txt | 2 +- src/gam/__init__.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/GamCommands.txt b/src/GamCommands.txt index 05d34eec..f35415a2 100644 --- a/src/GamCommands.txt +++ b/src/GamCommands.txt @@ -1846,7 +1846,7 @@ gam update teamdrive |(name ) [asad [(theme|themeid ) | ([customtheme ] [color ])] ( )* [hidden ] -gam delete teamdrive |(name ) [allowitemdeletion|nukefromorbit] +gam delete teamdrive |(name ) [asadmin] [allowitemdeletion|nukefromorbit] gam show teamdriveinfo |(name ) [asadmin] gam show teamdrives [query ] [asadmin] gam print teamdrives [query ] [todrive] [asadmin] diff --git a/src/gam/__init__.py b/src/gam/__init__.py index 1c187ce1..fc2b4c34 100755 --- a/src/gam/__init__.py +++ b/src/gam/__init__.py @@ -8243,6 +8243,9 @@ def doDeleteSharedDrive(users): allowItemDeletion = True useDomainAdminAccess = True i += 1 + elif myarg == 'asadmin': + useDomainAdminAccess = True + i += 1 else: controlflow.invalid_argument_exit( myarg, 'gam delete shareddrive')