gam7 7.8.2__py3-none-any.whl → 7.9.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of gam7 might be problematic. Click here for more details.
- gam/__init__.py +113 -43
- gam/gamlib/glapi.py +12 -5
- gam/gamlib/glcfg.py +4 -0
- gam/gamlib/glmsgs.py +4 -3
- {gam7-7.8.2.dist-info → gam7-7.9.1.dist-info}/METADATA +1 -1
- {gam7-7.8.2.dist-info → gam7-7.9.1.dist-info}/RECORD +9 -9
- {gam7-7.8.2.dist-info → gam7-7.9.1.dist-info}/WHEEL +0 -0
- {gam7-7.8.2.dist-info → gam7-7.9.1.dist-info}/entry_points.txt +0 -0
- {gam7-7.8.2.dist-info → gam7-7.9.1.dist-info}/licenses/LICENSE +0 -0
gam/__init__.py
CHANGED
|
@@ -25,7 +25,7 @@ https://github.com/GAM-team/GAM/wiki
|
|
|
25
25
|
"""
|
|
26
26
|
|
|
27
27
|
__author__ = 'GAM Team <google-apps-manager@googlegroups.com>'
|
|
28
|
-
__version__ = '7.
|
|
28
|
+
__version__ = '7.09.01'
|
|
29
29
|
__license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
|
|
30
30
|
|
|
31
31
|
#pylint: disable=wrong-import-position
|
|
@@ -4785,8 +4785,9 @@ def defaultSvcAcctScopes():
|
|
|
4785
4785
|
scopesList = API.getSvcAcctScopesList(GC.Values[GC.USER_SERVICE_ACCOUNT_ACCESS_ONLY], False)
|
|
4786
4786
|
saScopes = {}
|
|
4787
4787
|
for scope in scopesList:
|
|
4788
|
-
|
|
4789
|
-
|
|
4788
|
+
if not scope.get('offByDefault'):
|
|
4789
|
+
saScopes.setdefault(scope['api'], [])
|
|
4790
|
+
saScopes[scope['api']].append(scope['scope'])
|
|
4790
4791
|
saScopes[API.DRIVEACTIVITY].append(API.DRIVE_SCOPE)
|
|
4791
4792
|
saScopes[API.DRIVE2] = saScopes[API.DRIVE3]
|
|
4792
4793
|
saScopes[API.DRIVETD] = saScopes[API.DRIVE3]
|
|
@@ -12232,7 +12233,7 @@ def checkServiceAccount(users):
|
|
|
12232
12233
|
|
|
12233
12234
|
def authorizeScopes(message):
|
|
12234
12235
|
long_url = ('https://admin.google.com/ac/owl/domainwidedelegation'
|
|
12235
|
-
f'?clientScopeToAdd={",".join(checkScopes)}'
|
|
12236
|
+
f'?clientScopeToAdd={",".join(sorted(checkScopes))}'
|
|
12236
12237
|
f'&clientIdToAdd={service_account}&overwriteClientId=true')
|
|
12237
12238
|
if GC.Values[GC.DOMAIN]:
|
|
12238
12239
|
long_url += f'&dn={GC.Values[GC.DOMAIN]}'
|
|
@@ -12244,10 +12245,12 @@ def checkServiceAccount(users):
|
|
|
12244
12245
|
allScopes = API.getSvcAcctScopes(GC.Values[GC.USER_SERVICE_ACCOUNT_ACCESS_ONLY], Act.Get() == Act.UPDATE)
|
|
12245
12246
|
checkScopesSet = set()
|
|
12246
12247
|
saScopes = {}
|
|
12248
|
+
checkDeprecatedScopes = True
|
|
12247
12249
|
useColor = False
|
|
12248
12250
|
while Cmd.ArgumentsRemaining():
|
|
12249
12251
|
myarg = getArgument()
|
|
12250
12252
|
if myarg in {'scope', 'scopes'}:
|
|
12253
|
+
checkDeprecatedScopes = False
|
|
12251
12254
|
for scope in getString(Cmd.OB_API_SCOPE_URL_LIST).lower().replace(',', ' ').split():
|
|
12252
12255
|
api = API.getSvcAcctScopeAPI(scope)
|
|
12253
12256
|
if api is not None:
|
|
@@ -12264,10 +12267,12 @@ def checkServiceAccount(users):
|
|
|
12264
12267
|
testPass = createGreenText('PASS')
|
|
12265
12268
|
testFail = createRedText('FAIL')
|
|
12266
12269
|
testWarn = createYellowText('WARN')
|
|
12270
|
+
testDeprecated = createRedText('DEPRECATED')
|
|
12267
12271
|
else:
|
|
12268
12272
|
testPass = 'PASS'
|
|
12269
12273
|
testFail = 'FAIL'
|
|
12270
12274
|
testWarn = 'WARN'
|
|
12275
|
+
testDeprecated = 'DEPRECATED'
|
|
12271
12276
|
if Act.Get() == Act.CHECK:
|
|
12272
12277
|
if not checkScopesSet:
|
|
12273
12278
|
for scope in iter(GM.Globals[GM.SVCACCT_SCOPES].values()):
|
|
@@ -12275,7 +12280,7 @@ def checkServiceAccount(users):
|
|
|
12275
12280
|
else:
|
|
12276
12281
|
if not checkScopesSet:
|
|
12277
12282
|
scopesList = API.getSvcAcctScopesList(GC.Values[GC.USER_SERVICE_ACCOUNT_ACCESS_ONLY], True)
|
|
12278
|
-
selectedScopes = getScopesFromUser(scopesList, False, GM.Globals[GM.SVCACCT_SCOPES])
|
|
12283
|
+
selectedScopes = getScopesFromUser(scopesList, False, GM.Globals[GM.SVCACCT_SCOPES] if GM.Globals[GM.SVCACCT_SCOPES_DEFINED] else None)
|
|
12279
12284
|
if selectedScopes is None:
|
|
12280
12285
|
return False
|
|
12281
12286
|
i = 0
|
|
@@ -12337,7 +12342,7 @@ def checkServiceAccount(users):
|
|
|
12337
12342
|
if saTokenStatus == testFail:
|
|
12338
12343
|
invalidOauth2serviceJsonExit(f'Authentication{auth_error}')
|
|
12339
12344
|
_getSvcAcctData() # needed to read in GM.OAUTH2SERVICE_JSON_DATA
|
|
12340
|
-
if
|
|
12345
|
+
if API.IAM not in GM.Globals[GM.SVCACCT_SCOPES]:
|
|
12341
12346
|
GM.Globals[GM.SVCACCT_SCOPES][API.IAM] = [API.IAM_SCOPE]
|
|
12342
12347
|
key_type = GM.Globals[GM.OAUTH2SERVICE_JSON_DATA].get('key_type', 'default')
|
|
12343
12348
|
if key_type == 'default':
|
|
@@ -12399,6 +12404,38 @@ def checkServiceAccount(users):
|
|
|
12399
12404
|
allScopesPass = False
|
|
12400
12405
|
printPassFail(scope, f'{scopeStatus}{currentCount(j, jcount)}')
|
|
12401
12406
|
Ind.Decrement()
|
|
12407
|
+
if checkDeprecatedScopes:
|
|
12408
|
+
deprecatedScopes = sorted(API.DEPRECATED_SCOPES)
|
|
12409
|
+
jcount = len(deprecatedScopes)
|
|
12410
|
+
printKeyValueListWithCount([Msg.DEPRECATED_SCOPES, '',
|
|
12411
|
+
Ent.Singular(Ent.USER), user,
|
|
12412
|
+
Ent.Choose(Ent.SCOPE, jcount), jcount],
|
|
12413
|
+
i, count)
|
|
12414
|
+
Ind.Increment()
|
|
12415
|
+
j = 0
|
|
12416
|
+
for scope in deprecatedScopes:
|
|
12417
|
+
j += 1
|
|
12418
|
+
# try with and without email scope
|
|
12419
|
+
for scopes in [[scope, API.USERINFO_EMAIL_SCOPE], [scope]]:
|
|
12420
|
+
try:
|
|
12421
|
+
credentials = getSvcAcctCredentials(scopes, user)
|
|
12422
|
+
credentials.refresh(request)
|
|
12423
|
+
break
|
|
12424
|
+
except (httplib2.HttpLib2Error, google.auth.exceptions.TransportError, RuntimeError) as e:
|
|
12425
|
+
handleServerError(e)
|
|
12426
|
+
except google.auth.exceptions.RefreshError:
|
|
12427
|
+
continue
|
|
12428
|
+
if credentials.token:
|
|
12429
|
+
token_info = callGAPI(oa2, 'tokeninfo', access_token=credentials.token)
|
|
12430
|
+
if scope in token_info.get('scope', '').split(' ') and user == token_info.get('email', user).lower():
|
|
12431
|
+
scopeStatus = testDeprecated
|
|
12432
|
+
allScopesPass = False
|
|
12433
|
+
else:
|
|
12434
|
+
scopeStatus = testPass
|
|
12435
|
+
else:
|
|
12436
|
+
scopeStatus = testPass
|
|
12437
|
+
printPassFail(scope, f'{scopeStatus}{currentCount(j, jcount)}')
|
|
12438
|
+
Ind.Decrement()
|
|
12402
12439
|
service_account = GM.Globals[GM.OAUTH2SERVICE_JSON_DATA]['client_id']
|
|
12403
12440
|
if allScopesPass:
|
|
12404
12441
|
if Act.Get() == Act.CHECK:
|
|
@@ -28081,6 +28118,7 @@ def simplifyChromeSchema(schema):
|
|
|
28081
28118
|
'settings': {}
|
|
28082
28119
|
}
|
|
28083
28120
|
fieldDescriptions = schema['fieldDescriptions']
|
|
28121
|
+
savedSettingName = ''
|
|
28084
28122
|
for mtype in schema['definition']['messageType']:
|
|
28085
28123
|
for setting in mtype['field']:
|
|
28086
28124
|
setting_name = setting['name']
|
|
@@ -28089,6 +28127,9 @@ def simplifyChromeSchema(schema):
|
|
|
28089
28127
|
'descriptions': [],
|
|
28090
28128
|
'type': setting['type'],
|
|
28091
28129
|
}
|
|
28130
|
+
if setting_dict['type'] == 'TYPE_INT64' and savedSettingName:
|
|
28131
|
+
setting_dict['name'] = savedSettingName
|
|
28132
|
+
savedSettingName = ''
|
|
28092
28133
|
if setting_dict['type'] == 'TYPE_STRING' and setting.get('label') == 'LABEL_REPEATED':
|
|
28093
28134
|
setting_dict['type'] = 'TYPE_LIST'
|
|
28094
28135
|
if setting_dict['type'] == 'TYPE_ENUM':
|
|
@@ -28110,6 +28151,7 @@ def simplifyChromeSchema(schema):
|
|
|
28110
28151
|
break
|
|
28111
28152
|
break
|
|
28112
28153
|
elif setting_dict['type'] == 'TYPE_MESSAGE':
|
|
28154
|
+
savedSettingName = setting_name
|
|
28113
28155
|
continue
|
|
28114
28156
|
else:
|
|
28115
28157
|
setting_dict['enums'] = None
|
|
@@ -28215,14 +28257,11 @@ def doDeleteChromePolicy():
|
|
|
28215
28257
|
entityActionFailedWarning(kvList, str(e))
|
|
28216
28258
|
|
|
28217
28259
|
CHROME_SCHEMA_SPECIAL_CASES = {
|
|
28260
|
+
# duration
|
|
28218
28261
|
'chrome.users.AutoUpdateCheckPeriodNewV2':
|
|
28219
28262
|
{'autoupdatecheckperiodminutesnew':
|
|
28220
28263
|
{'casedField': 'autoUpdateCheckPeriodMinutesNew',
|
|
28221
28264
|
'type': 'duration', 'minVal': 1, 'maxVal': 720}},
|
|
28222
|
-
'chrome.users.Avatar':
|
|
28223
|
-
{'useravatarimage':
|
|
28224
|
-
{'casedField': 'userAvatarImage',
|
|
28225
|
-
'type': 'downloadUri'}},
|
|
28226
28265
|
'chrome.users.BrowserSwitcherDelayDurationV2':
|
|
28227
28266
|
{'browserswitcherdelayduration':
|
|
28228
28267
|
{'casedField': 'browserSwitcherDelayDuration',
|
|
@@ -28264,10 +28303,6 @@ CHROME_SCHEMA_SPECIAL_CASES = {
|
|
|
28264
28303
|
{'maxinvalidationfetchdelay':
|
|
28265
28304
|
{'casedField': 'maxInvalidationFetchDelay',
|
|
28266
28305
|
'type': 'duration', 'minVal': 1, 'maxVal': 30, 'default': 10}},
|
|
28267
|
-
'chrome.users.PrintingMaxSheetsAllowed':
|
|
28268
|
-
{'printingmaxsheetsallowednullable':
|
|
28269
|
-
{'casedField': 'printingMaxSheetsAllowedNullable',
|
|
28270
|
-
'type': 'value', 'minVal': 1, 'maxVal': None}},
|
|
28271
28306
|
'chrome.users.PrintJobHistoryExpirationPeriodNewV2':
|
|
28272
28307
|
{'printjobhistoryexpirationperioddaysnew':
|
|
28273
28308
|
{'casedField': 'printJobHistoryExpirationPeriodDaysNew',
|
|
@@ -28291,10 +28326,6 @@ CHROME_SCHEMA_SPECIAL_CASES = {
|
|
|
28291
28326
|
'updatessuppressedstarttime':
|
|
28292
28327
|
{'casedField': 'updatesSuppressedStartTime',
|
|
28293
28328
|
'type': 'timeOfDay'}},
|
|
28294
|
-
'chrome.users.Wallpaper':
|
|
28295
|
-
{'wallpaperimage':
|
|
28296
|
-
{'casedField': 'wallpaperImage',
|
|
28297
|
-
'type': 'downloadUri'}},
|
|
28298
28329
|
'chrome.devices.EnableReportUploadFrequencyV2':
|
|
28299
28330
|
{'reportdeviceuploadfrequency':
|
|
28300
28331
|
{'casedField': 'reportDeviceUploadFrequency',
|
|
@@ -28303,10 +28334,6 @@ CHROME_SCHEMA_SPECIAL_CASES = {
|
|
|
28303
28334
|
{'uptimelimitduration':
|
|
28304
28335
|
{'casedField': 'uptimeLimitDuration',
|
|
28305
28336
|
'type': 'duration', 'minVal': 1, 'maxVal': 365}},
|
|
28306
|
-
'chrome.devices.SignInWallpaperImage':
|
|
28307
|
-
{'devicewallpaperimage':
|
|
28308
|
-
{'casedField': 'deviceWallpaperImage',
|
|
28309
|
-
'type': 'downloadUri'}},
|
|
28310
28337
|
'chrome.devices.kiosk.AcPowerSettingsV2':
|
|
28311
28338
|
{'acidletimeout':
|
|
28312
28339
|
{'casedField': 'acIdleTimeout',
|
|
@@ -28333,10 +28360,6 @@ CHROME_SCHEMA_SPECIAL_CASES = {
|
|
|
28333
28360
|
'batteryscreenofftimeout':
|
|
28334
28361
|
{'casedField': 'batteryScreenOffTimeout',
|
|
28335
28362
|
'type': 'duration', 'minVal': 0, 'maxVal': 35000}},
|
|
28336
|
-
'chrome.devices.managedguest.Avatar':
|
|
28337
|
-
{'useravatarimage':
|
|
28338
|
-
{'casedField': 'userAvatarImage',
|
|
28339
|
-
'type': 'downloadUri'}},
|
|
28340
28363
|
'chrome.devices.managedguest.BrowsingDataLifetimeV2':
|
|
28341
28364
|
{'browsinghistoryttl':
|
|
28342
28365
|
{'casedField': 'browsingHistoryTtl',
|
|
@@ -28378,6 +28401,56 @@ CHROME_SCHEMA_SPECIAL_CASES = {
|
|
|
28378
28401
|
{'sessiondurationlimit':
|
|
28379
28402
|
{'casedField': 'sessionDurationLimit',
|
|
28380
28403
|
'type': 'duration', 'minVal': 1, 'maxVal': 1440}},
|
|
28404
|
+
# value
|
|
28405
|
+
'chrome.users.GaiaLockScreenOfflineSigninTimeLimitDays':
|
|
28406
|
+
{'gaialockscreenofflinesignintimelimitdays':
|
|
28407
|
+
{'casedField': 'gaiaLockScreenOfflineSigninTimeLimitDays',
|
|
28408
|
+
'type': 'value', 'minVal': 0, 'maxVal': 365}},
|
|
28409
|
+
'chrome.users.GaiaOfflineSigninTimeLimitDays':
|
|
28410
|
+
{'gaiaofflinesignintimelimitdays':
|
|
28411
|
+
{'casedField': 'gaiaOfflineSigninTimeLimitDays',
|
|
28412
|
+
'type': 'value', 'minVal': 0, 'maxVal': 365}},
|
|
28413
|
+
'chrome.users.PrintingMaxSheetsAllowed':
|
|
28414
|
+
{'printingmaxsheetsallowednullable':
|
|
28415
|
+
{'casedField': 'printingMaxSheetsAllowedNullable',
|
|
28416
|
+
'type': 'value', 'minVal': 1, 'maxVal': None}},
|
|
28417
|
+
'chrome.users.RemoteAccessHostClipboardSizeBytes':
|
|
28418
|
+
{'remoteaccesshostclipboardsizebytes':
|
|
28419
|
+
{'casedField': 'remoteAccessHostClipboardSizeBytes',
|
|
28420
|
+
'type': 'value', 'minVal': 0, 'maxVal': 2147483647}},
|
|
28421
|
+
'chrome.users.SamlLockScreenOfflineSigninTimeLimitDays':
|
|
28422
|
+
{'samllockscreenofflinesignintimelimitdays':
|
|
28423
|
+
{'casedField': 'samlLockScreenOfflineSigninTimeLimitDays',
|
|
28424
|
+
'type': 'value', 'minVal': 0, 'maxVal': 365}},
|
|
28425
|
+
'chrome.devices.ExtensionCacheSize':
|
|
28426
|
+
{'extensioncachesize':
|
|
28427
|
+
{'casedField': 'extensionCacheSize',
|
|
28428
|
+
'type': 'value', 'minVal': 1048576, 'maxVal': None, 'default': 268435456}},
|
|
28429
|
+
'chrome.devices.managedguest.PrintingMaxSheetsAllowed':
|
|
28430
|
+
{'printingmaxsheetsallowednullable':
|
|
28431
|
+
{'casedField': 'printingMaxSheetsAllowedNullable',
|
|
28432
|
+
'type': 'value', 'minVal': 1, 'maxVal': None}},
|
|
28433
|
+
'chrome.devices.managedguest.RemoteAccessHostClipboardSizeBytes':
|
|
28434
|
+
{'remoteaccesshostclipboardsizebytes':
|
|
28435
|
+
{'casedField': 'remoteAccessHostClipboardSizeBytes',
|
|
28436
|
+
'type': 'value', 'minVal': 0, 'maxVal': 2147483647}},
|
|
28437
|
+
# downloadUri
|
|
28438
|
+
'chrome.users.Avatar':
|
|
28439
|
+
{'useravatarimage':
|
|
28440
|
+
{'casedField': 'userAvatarImage',
|
|
28441
|
+
'type': 'downloadUri'}},
|
|
28442
|
+
'chrome.users.Wallpaper':
|
|
28443
|
+
{'wallpaperimage':
|
|
28444
|
+
{'casedField': 'wallpaperImage',
|
|
28445
|
+
'type': 'downloadUri'}},
|
|
28446
|
+
'chrome.devices.SignInWallpaperImage':
|
|
28447
|
+
{'devicewallpaperimage':
|
|
28448
|
+
{'casedField': 'deviceWallpaperImage',
|
|
28449
|
+
'type': 'downloadUri'}},
|
|
28450
|
+
'chrome.devices.managedguest.Avatar':
|
|
28451
|
+
{'useravatarimage':
|
|
28452
|
+
{'casedField': 'userAvatarImage',
|
|
28453
|
+
'type': 'downloadUri'}},
|
|
28381
28454
|
'chrome.devices.managedguest.Wallpaper':
|
|
28382
28455
|
{'wallpaperimage':
|
|
28383
28456
|
{'casedField': 'wallpaperImage',
|
|
@@ -57259,6 +57332,7 @@ def printDiskUsage(users):
|
|
|
57259
57332
|
topFolder['path'] = f'{SHARED_DRIVES}{pathDelimiter}{topFolder["name"]}'
|
|
57260
57333
|
else:
|
|
57261
57334
|
topFolder['path'] = topFolder['name']
|
|
57335
|
+
topFolder.pop('ownedByMe', None)
|
|
57262
57336
|
elif topFolder['name'] == MY_DRIVE and not topFolder.get('parents'):
|
|
57263
57337
|
topFolder['path'] = MY_DRIVE
|
|
57264
57338
|
else:
|
|
@@ -57269,7 +57343,6 @@ def printDiskUsage(users):
|
|
|
57269
57343
|
if owners:
|
|
57270
57344
|
topFolder['Owner'] = owners[0].get('emailAddress', 'Unknown')
|
|
57271
57345
|
trashFolder['Owner'] = topFolder['Owner']
|
|
57272
|
-
topFolder.pop('ownedByMe', None)
|
|
57273
57346
|
topFolder.pop('parents', None)
|
|
57274
57347
|
topFolder.update(zeroFolderInfo)
|
|
57275
57348
|
topFolder.pop(sizeField, None)
|
|
@@ -58716,7 +58789,7 @@ def initCopyMoveOptions(copyCmd):
|
|
|
58716
58789
|
'showPermissionMessages': False,
|
|
58717
58790
|
'sendEmailIfRequired': False,
|
|
58718
58791
|
'useDomainAdminAccess': False,
|
|
58719
|
-
'enforceExpansiveAccess':
|
|
58792
|
+
'enforceExpansiveAccess': GC.Values[GC.ENFORCE_EXPANSIVE_ACCESS],
|
|
58720
58793
|
'copiedShortcutsPointToCopiedFiles': True,
|
|
58721
58794
|
'createShortcutsForNonmovableFiles': False,
|
|
58722
58795
|
'duplicateFiles': DUPLICATE_FILE_OVERWRITE_OLDER,
|
|
@@ -62096,7 +62169,8 @@ def transferDrive(users):
|
|
|
62096
62169
|
targetUserFolderPattern = '#user# old files'
|
|
62097
62170
|
targetUserOrphansFolderPattern = '#user# orphaned files'
|
|
62098
62171
|
targetIds = [None, None]
|
|
62099
|
-
createShortcutsForNonmovableFiles =
|
|
62172
|
+
createShortcutsForNonmovableFiles = False
|
|
62173
|
+
enforceExpansiveAccess = GC.Values[GC.ENFORCE_EXPANSIVE_ACCESS]
|
|
62100
62174
|
mergeWithTarget = False
|
|
62101
62175
|
thirdPartyOwners = {}
|
|
62102
62176
|
skipFileIdEntity = initDriveFileEntity()
|
|
@@ -62402,7 +62476,8 @@ def transferOwnership(users):
|
|
|
62402
62476
|
body = {}
|
|
62403
62477
|
newOwner = getEmailAddress()
|
|
62404
62478
|
OBY = OrderBy(DRIVEFILE_ORDERBY_CHOICE_MAP)
|
|
62405
|
-
changeParents =
|
|
62479
|
+
changeParents = filepath = includeTrashed = noRecursion = False
|
|
62480
|
+
enforceExpansiveAccess = GC.Values[GC.ENFORCE_EXPANSIVE_ACCESS]
|
|
62406
62481
|
pathDelimiter = '/'
|
|
62407
62482
|
csvPF = fileTree = None
|
|
62408
62483
|
addParents = ''
|
|
@@ -62728,7 +62803,8 @@ def claimOwnership(users):
|
|
|
62728
62803
|
onlyOwners = set()
|
|
62729
62804
|
skipOwners = set()
|
|
62730
62805
|
subdomains = []
|
|
62731
|
-
|
|
62806
|
+
filepath = includeTrashed = False
|
|
62807
|
+
enforceExpansiveAccess = GC.Values[GC.ENFORCE_EXPANSIVE_ACCESS]
|
|
62732
62808
|
pathDelimiter = '/'
|
|
62733
62809
|
addParents = ''
|
|
62734
62810
|
parentBody = {}
|
|
@@ -63503,7 +63579,7 @@ def doCreateDriveFileACL():
|
|
|
63503
63579
|
def updateDriveFileACLs(users, useDomainAdminAccess=False):
|
|
63504
63580
|
fileIdEntity = getDriveFileEntity()
|
|
63505
63581
|
isEmail, permissionId = getPermissionId()
|
|
63506
|
-
enforceExpansiveAccess =
|
|
63582
|
+
enforceExpansiveAccess = GC.Values[GC.ENFORCE_EXPANSIVE_ACCESS]
|
|
63507
63583
|
removeExpiration = showTitles = updateSheetProtectedRanges = False
|
|
63508
63584
|
showDetails = True
|
|
63509
63585
|
csvPF = None
|
|
@@ -63541,9 +63617,6 @@ def updateDriveFileACLs(users, useDomainAdminAccess=False):
|
|
|
63541
63617
|
_checkFileIdEntityDomainAccess(fileIdEntity, useDomainAdminAccess)
|
|
63542
63618
|
if 'role' not in body:
|
|
63543
63619
|
missingArgumentExit(f'role {formatChoiceList(DRIVEFILE_ACL_ROLES_MAP)}')
|
|
63544
|
-
updateKwargs = {'useDomainAdminAccess': useDomainAdminAccess}
|
|
63545
|
-
if enforceExpansiveAccess is not None:
|
|
63546
|
-
updateKwargs['enforceExpansiveAccess'] = enforceExpansiveAccess
|
|
63547
63620
|
printKeys, timeObjects = _getDriveFileACLPrintKeysTimeObjects()
|
|
63548
63621
|
if csvPF and showTitles:
|
|
63549
63622
|
csvPF.AddTitles(fileNameTitle)
|
|
@@ -63581,7 +63654,7 @@ def updateDriveFileACLs(users, useDomainAdminAccess=False):
|
|
|
63581
63654
|
permission = callGAPI(drive.permissions(), 'update',
|
|
63582
63655
|
bailOnInternalError=True,
|
|
63583
63656
|
throwReasons=GAPI.DRIVE_ACCESS_THROW_REASONS+GAPI.DRIVE3_UPDATE_ACL_THROW_REASONS+[GAPI.FILE_NEVER_WRITABLE],
|
|
63584
|
-
|
|
63657
|
+
useDomainAdminAccess=useDomainAdminAccess, enforceExpansiveAccess=enforceExpansiveAccess,
|
|
63585
63658
|
fileId=fileId, permissionId=permissionId, removeExpiration=removeExpiration,
|
|
63586
63659
|
transferOwnership=body.get('role', '') == 'owner', body=body, fields='*', supportsAllDrives=True)
|
|
63587
63660
|
if updateSheetProtectedRanges and mimeType == MIMETYPE_GA_SPREADSHEET:
|
|
@@ -63832,7 +63905,7 @@ def doCreatePermissions():
|
|
|
63832
63905
|
def deleteDriveFileACLs(users, useDomainAdminAccess=False):
|
|
63833
63906
|
fileIdEntity = getDriveFileEntity()
|
|
63834
63907
|
isEmail, permissionId = getPermissionId()
|
|
63835
|
-
enforceExpansiveAccess =
|
|
63908
|
+
enforceExpansiveAccess = GC.Values[GC.ENFORCE_EXPANSIVE_ACCESS]
|
|
63836
63909
|
showTitles = updateSheetProtectedRanges = False
|
|
63837
63910
|
while Cmd.ArgumentsRemaining():
|
|
63838
63911
|
myarg = getArgument()
|
|
@@ -63847,9 +63920,6 @@ def deleteDriveFileACLs(users, useDomainAdminAccess=False):
|
|
|
63847
63920
|
else:
|
|
63848
63921
|
unknownArgumentExit()
|
|
63849
63922
|
_checkFileIdEntityDomainAccess(fileIdEntity, useDomainAdminAccess)
|
|
63850
|
-
deleteKwargs = {'useDomainAdminAccess': useDomainAdminAccess}
|
|
63851
|
-
if enforceExpansiveAccess is not None:
|
|
63852
|
-
deleteKwargs['enforceExpansiveAccess'] = enforceExpansiveAccess
|
|
63853
63923
|
i, count, users = getEntityArgument(users)
|
|
63854
63924
|
for user in users:
|
|
63855
63925
|
i += 1
|
|
@@ -63882,7 +63952,7 @@ def deleteDriveFileACLs(users, useDomainAdminAccess=False):
|
|
|
63882
63952
|
break
|
|
63883
63953
|
callGAPI(drive.permissions(), 'delete',
|
|
63884
63954
|
throwReasons=GAPI.DRIVE_ACCESS_THROW_REASONS+GAPI.DRIVE3_DELETE_ACL_THROW_REASONS+[GAPI.FILE_NEVER_WRITABLE],
|
|
63885
|
-
|
|
63955
|
+
useDomainAdminAccess=useDomainAdminAccess, enforceExpansiveAccess=enforceExpansiveAccess,
|
|
63886
63956
|
fileId=fileId, permissionId=permissionId, supportsAllDrives=True)
|
|
63887
63957
|
entityActionPerformed([Ent.USER, user, entityType, fileName, Ent.PERMISSION_ID, permissionId], j, jcount)
|
|
63888
63958
|
if updateSheetProtectedRanges and mimeType == MIMETYPE_GA_SPREADSHEET:
|
|
@@ -63961,7 +64031,7 @@ def deletePermissions(users, useDomainAdminAccess=False):
|
|
|
63961
64031
|
jsonData = getJSON([])
|
|
63962
64032
|
PM = PermissionMatch()
|
|
63963
64033
|
PM.SetDefaultMatch(False, {'role': 'owner'})
|
|
63964
|
-
enforceExpansiveAccess =
|
|
64034
|
+
enforceExpansiveAccess = GC.Values[GC.ENFORCE_EXPANSIVE_ACCESS]
|
|
63965
64035
|
while Cmd.ArgumentsRemaining():
|
|
63966
64036
|
myarg = getArgument()
|
|
63967
64037
|
if myarg in ADMIN_ACCESS_OPTIONS:
|
|
@@ -66200,7 +66270,7 @@ def printSharedDriveOrganizers(users, useDomainAdminAccess=False):
|
|
|
66200
66270
|
useDomainAdminAccess=useDomainAdminAccess,
|
|
66201
66271
|
fileId=shareddrive['id'], fields=fields, supportsAllDrives=True)
|
|
66202
66272
|
for permission in permissions:
|
|
66203
|
-
if permission['type'] in includeTypes and permission['role'] in roles:
|
|
66273
|
+
if permission['type'] in includeTypes and permission['role'] in roles and permission.get('emailAddress', ''):
|
|
66204
66274
|
if domainList:
|
|
66205
66275
|
_, domain = permission['emailAddress'].lower().split('@', 1)
|
|
66206
66276
|
if domain not in domainList:
|
gam/gamlib/glapi.py
CHANGED
|
@@ -118,6 +118,7 @@ JWT_APIS = {
|
|
|
118
118
|
ACCESSCONTEXTMANAGER: [CLOUD_PLATFORM_SCOPE],
|
|
119
119
|
CHAT: ['https://www.googleapis.com/auth/chat.bot'],
|
|
120
120
|
CLOUDRESOURCEMANAGER: [CLOUD_PLATFORM_SCOPE],
|
|
121
|
+
IAM: [IAM_SCOPE],
|
|
121
122
|
ORGPOLICY: [CLOUD_PLATFORM_SCOPE],
|
|
122
123
|
}
|
|
123
124
|
#
|
|
@@ -131,6 +132,12 @@ APIS_NEEDING_ACCESS_TOKEN = {
|
|
|
131
132
|
CBCM: ['https://www.googleapis.com/auth/admin.directory.device.chromebrowsers']
|
|
132
133
|
}
|
|
133
134
|
#
|
|
135
|
+
DEPRECATED_SCOPES = {
|
|
136
|
+
'https://www.googleapis.com/auth/cloud-identity',
|
|
137
|
+
'https://www.googleapis.com/auth/cloud-platform',
|
|
138
|
+
'https://www.googleapis.com/auth/iam',
|
|
139
|
+
}
|
|
140
|
+
#
|
|
134
141
|
REFRESH_PERM_ERRORS = [
|
|
135
142
|
'invalid_grant: reauth related error (rapt_required)', # no way to reauth today
|
|
136
143
|
'invalid_grant: Token has been expired or revoked',
|
|
@@ -645,11 +652,11 @@ _SVCACCT_SCOPES = [
|
|
|
645
652
|
'api': GMAIL,
|
|
646
653
|
'subscopes': [],
|
|
647
654
|
'scope': 'https://www.googleapis.com/auth/gmail.settings.sharing'},
|
|
648
|
-
{'name': 'Identity and Access Management API',
|
|
649
|
-
'api': IAM,
|
|
650
|
-
'offByDefault': True,
|
|
651
|
-
'subscopes': [],
|
|
652
|
-
'scope':
|
|
655
|
+
# {'name': 'Identity and Access Management API',
|
|
656
|
+
# 'api': IAM,
|
|
657
|
+
# 'offByDefault': True,
|
|
658
|
+
# 'subscopes': [],
|
|
659
|
+
# 'scope': CLOUD_PLATFORM_SCOPE},
|
|
653
660
|
{'name': 'Keep API',
|
|
654
661
|
'api': KEEP,
|
|
655
662
|
'subscopes': READONLY,
|
gam/gamlib/glcfg.py
CHANGED
|
@@ -163,6 +163,8 @@ EMAIL_BATCH_SIZE = 'email_batch_size'
|
|
|
163
163
|
ENABLE_DASA = 'enable_dasa'
|
|
164
164
|
# Enable Cloud Session Reauthentication by borrowing a RAPT token from gcloud command
|
|
165
165
|
ENABLE_GCLOUD_REAUTH = 'enable_gcloud_reauth'
|
|
166
|
+
# Value for enforceExpansiveAccess for commands that delete or update drive file ACLs/permissions.
|
|
167
|
+
ENFORCE_EXPANSIVE_ACCESS = 'enforce_expansive_access'
|
|
166
168
|
# When retrieving lists of calendar events from API, how many should be retrieved in each chunk
|
|
167
169
|
EVENT_MAX_RESULTS = 'event_max_results'
|
|
168
170
|
# Path to extra_args.txt
|
|
@@ -377,6 +379,7 @@ Defaults = {
|
|
|
377
379
|
DEVICE_MAX_RESULTS: '200',
|
|
378
380
|
DOMAIN: '',
|
|
379
381
|
DRIVE_DIR: '',
|
|
382
|
+
ENFORCE_EXPANSIVE_ACCESS: FALSE,
|
|
380
383
|
DRIVE_MAX_RESULTS: '1000',
|
|
381
384
|
DRIVE_V3_BETA: FALSE,
|
|
382
385
|
DRIVE_V3_NATIVE_NAMES: TRUE,
|
|
@@ -545,6 +548,7 @@ VAR_INFO = {
|
|
|
545
548
|
DEVICE_MAX_RESULTS: {VAR_TYPE: TYPE_INTEGER, VAR_LIMITS: (1, 200)},
|
|
546
549
|
DOMAIN: {VAR_TYPE: TYPE_STRING, VAR_ENVVAR: 'GA_DOMAIN', VAR_LIMITS: (0, None)},
|
|
547
550
|
DRIVE_DIR: {VAR_TYPE: TYPE_DIRECTORY, VAR_ENVVAR: 'GAMDRIVEDIR'},
|
|
551
|
+
ENFORCE_EXPANSIVE_ACCESS: {VAR_TYPE: TYPE_BOOLEAN},
|
|
548
552
|
DRIVE_MAX_RESULTS: {VAR_TYPE: TYPE_INTEGER, VAR_LIMITS: (1, 1000)},
|
|
549
553
|
DRIVE_V3_BETA: {VAR_TYPE: TYPE_BOOLEAN},
|
|
550
554
|
DRIVE_V3_NATIVE_NAMES: {VAR_TYPE: TYPE_BOOLEAN},
|
gam/gamlib/glmsgs.py
CHANGED
|
@@ -140,12 +140,13 @@ SERVICE_ACCOUNT_PRIVATE_KEY_AGE = 'Service Account Private Key age: {0} days'
|
|
|
140
140
|
SERVICE_ACCOUNT_SKIPPING_KEY_AGE_CHECK = 'Skipping Private Key age check: {0} rotation not necessary'
|
|
141
141
|
UPDATE_PROJECT_TO_VIEW_MANAGE_SAKEYS = 'Please run "gam update project" to view/manage service account keys'
|
|
142
142
|
DOMAIN_WIDE_DELEGATION_AUTHENTICATION = 'Domain-wide Delegation authentication'
|
|
143
|
+
DEPRECATED_SCOPES = 'Deprecated scopes that GAM should NEVER have DwD access to'
|
|
143
144
|
SCOPE_AUTHORIZATION_PASSED = '''All scopes PASSED!
|
|
144
145
|
|
|
145
146
|
Service Account Client name: {0} is fully authorized.
|
|
146
147
|
'''
|
|
147
148
|
SCOPE_AUTHORIZATION_UPDATE_PASSED = '''All scopes PASSED!
|
|
148
|
-
To
|
|
149
|
+
To update authorization (in case some scopes were unselected), please go to the following link in your browser:
|
|
149
150
|
{0}
|
|
150
151
|
{1}
|
|
151
152
|
|
|
@@ -156,8 +157,8 @@ Click AUTHORIZE
|
|
|
156
157
|
When the box closes you're done
|
|
157
158
|
After authorizing it may take some time for this test to pass so wait a few moments and then try this command again.
|
|
158
159
|
'''
|
|
159
|
-
SCOPE_AUTHORIZATION_FAILED = '''Some scopes FAILED!
|
|
160
|
-
To
|
|
160
|
+
SCOPE_AUTHORIZATION_FAILED = '''Some scopes FAILED or should be DISABLED!
|
|
161
|
+
To update authorization, please go to the following link in your browser:
|
|
161
162
|
{0}
|
|
162
163
|
{1}
|
|
163
164
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
gam/__init__.py,sha256=
|
|
1
|
+
gam/__init__.py,sha256=EqqD1dpkkwSbBFUVS-L2B4ud6trEg59VU3z24ADlvj0,3517246
|
|
2
2
|
gam/__main__.py,sha256=amz0-959ph6zkZKqjaar4n60yho-T37w6qWI36qx0CA,1049
|
|
3
3
|
gam/cacerts.pem,sha256=82Ak7btW_2XvocLUvAwPmpx8Chi0oqtZUG1gseLK_t4,50235
|
|
4
4
|
gam/cbcm-v1.1beta1.json,sha256=xO5XloCQQULmPbFBx5bckdqmbLFQ7sJ2TImhE1ysDIY,19439
|
|
@@ -23,15 +23,15 @@ gam/atom/token_store.py,sha256=7E6Ecvxa86WCvl1pJAhv78jg9OxQv8pMtIUcPhZCq04,3803
|
|
|
23
23
|
gam/atom/url.py,sha256=pxO1TlORxyKQTQ1bkBE1unFzjnv9c8LjJkm-UEORShY,4276
|
|
24
24
|
gam/gamlib/__init__.py,sha256=z5mF-y0j8pm-YNFBaiuxB4M_GAUPG-cXWwrhYwrVReM,679
|
|
25
25
|
gam/gamlib/glaction.py,sha256=1Il_HrChVnPkzZwiZs5au4mFQVtq4K1Z42uIuR6qdnI,9419
|
|
26
|
-
gam/gamlib/glapi.py,sha256=
|
|
27
|
-
gam/gamlib/glcfg.py,sha256=
|
|
26
|
+
gam/gamlib/glapi.py,sha256=7epQ2Hk9SK4Q6SImdJfvGvT5txftyfb5_jrF5K9cMpk,34253
|
|
27
|
+
gam/gamlib/glcfg.py,sha256=moWpsBv5iaASEvI1VfiQiI85jUjX6tYXa1uD1Oz3Y5M,28297
|
|
28
28
|
gam/gamlib/glclargs.py,sha256=zB6GMmDR_y5IRj7LuoM6-Bk_ETfNQ6sTqCNB6RdPfyg,42350
|
|
29
29
|
gam/gamlib/glentity.py,sha256=fqWUlxQqPKlfFrkuPjCK2lZhhFBIZboCuO0qCxuEwqA,33691
|
|
30
30
|
gam/gamlib/glgapi.py,sha256=cGtvFvvBU3XQJLgtLCjs_V5VBUem_k0b5uUrK21VmeA,39491
|
|
31
31
|
gam/gamlib/glgdata.py,sha256=weRppttWm6uRyqtBoGPKoHiNZ2h28nhfUV4J_mbCszY,2707
|
|
32
32
|
gam/gamlib/glglobals.py,sha256=J0xcHggVrUBzHJ5GruenKV-qV1zPKcK2qWgAgN3i5Jw,9608
|
|
33
33
|
gam/gamlib/glindent.py,sha256=RfBa2LDfLIqPLL5vMfC689TCVmqn8xf-qulSzkiatrc,1228
|
|
34
|
-
gam/gamlib/glmsgs.py,sha256=
|
|
34
|
+
gam/gamlib/glmsgs.py,sha256=jiu6jRSspnbF25IbaTOV1NzvtCZlE-5ltfntitH2V5k,33677
|
|
35
35
|
gam/gamlib/glskus.py,sha256=xJ1E2BZ_CGHN6I19c9i8DApb5bT5VT-hGyMEmQ5hSRY,15241
|
|
36
36
|
gam/gamlib/gluprop.py,sha256=IyPLCyvn7-NHTUenM71YPQPXRZXx6CB5q-GtJ-FYd1c,11461
|
|
37
37
|
gam/gamlib/glverlibs.py,sha256=A8rvegBF2nD6etbBRb8hsv-oZyjpD4VcUQ8PffW-bqU,992
|
|
@@ -65,8 +65,8 @@ gam/googleapiclient/discovery_cache/base.py,sha256=yCDPtxnbNN-p5_9fzBacC6P3wcUPl
|
|
|
65
65
|
gam/googleapiclient/discovery_cache/file_cache.py,sha256=sim3Mg4HgRYo3vX75jvcKy_aV568EvIrtBfvfbw-044,4774
|
|
66
66
|
gam/iso8601/__init__.py,sha256=Z2PsYbXgAH5a5xzUvgczCboPzqWpm65kRcIngCnhViU,1218
|
|
67
67
|
gam/iso8601/iso8601.py,sha256=Li2FHZ4sBTWuthuQhyCvmvj0j6At8JbGzkSv2fc2RHU,4384
|
|
68
|
-
gam7-7.
|
|
69
|
-
gam7-7.
|
|
70
|
-
gam7-7.
|
|
71
|
-
gam7-7.
|
|
72
|
-
gam7-7.
|
|
68
|
+
gam7-7.9.1.dist-info/METADATA,sha256=bBb1CBudSxPlVO_9OsXduoRE_D8RJs0MHCgIQUOt8b4,2977
|
|
69
|
+
gam7-7.9.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
70
|
+
gam7-7.9.1.dist-info/entry_points.txt,sha256=HVUM5J7dA8YwvJfG30jiLefR19ExMs387TWugWd9sf4,42
|
|
71
|
+
gam7-7.9.1.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
72
|
+
gam7-7.9.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|