Initial limited access, api_call_tries_limit new max
Some checks failed
Build and test GAM / build (Win64, build, 9, VC-WIN64A, windows-2022) (push) Waiting to run
Build and test GAM / build (aarch64, build, 3, linux-aarch64, [self-hosted linux arm64]) (push) Waiting to run
Build and test GAM / build (aarch64, build, 5, linux-aarch64, [self-hosted linux arm64], yes) (push) Waiting to run
Build and test GAM / build (aarch64, build, 7, darwin64-arm64, macos-14) (push) Waiting to run
Build and test GAM / build (x86_64, build, 1, linux-x86_64, ubuntu-22.04) (push) Waiting to run
Build and test GAM / build (x86_64, build, 2, linux-x86_64, ubuntu-20.04) (push) Waiting to run
Build and test GAM / build (x86_64, build, 4, linux-x86_64, ubuntu-20.04, yes) (push) Waiting to run
Build and test GAM / build (x86_64, build, 6, darwin64-x86_64, macos-13) (push) Waiting to run
Build and test GAM / build (x86_64, test, 10, ubuntu-22.04, 3.13) (push) Waiting to run
Build and test GAM / build (x86_64, test, 11, ubuntu-22.04, 3.9) (push) Waiting to run
Build and test GAM / build (x86_64, test, 12, ubuntu-22.04, 3.10) (push) Waiting to run
Build and test GAM / build (x86_64, test, 8, ubuntu-22.04, 3.11) (push) Waiting to run
Build and test GAM / merge (push) Blocked by required conditions
Build and test GAM / publish (push) Blocked by required conditions
Check for Google Root CA Updates / check-apis (push) Waiting to run
CodeQL / Analyze (python) (push) Has been cancelled

This commit is contained in:
Ross Scroggs
2024-09-29 21:05:40 -07:00
parent 46d05e37d0
commit 896f7f5d37
30 changed files with 2064 additions and 145 deletions

View File

@@ -1,3 +1,11 @@
7.00.09
Added initial support for `Folders with limited access`; you must be enrolled in the Beta preview.
Updated `api_call_tries_limit` variable to `gam.cfg` that limits the number of tries
for Google API calls that return an error that indicates a retry should be performed.
The default value is 10 and the range of allowable values is 3-30.
7.00.08
Fixed bug in `gam <UserTypeEntity> delete groups` that caused the command to fail when `enable_dasa = true` in `gam.cfg`.

View File

@@ -25,7 +25,7 @@ https://github.com/GAM-team/GAM/wiki
"""
__author__ = 'GAM Team <google-apps-manager@googlegroups.com>'
__version__ = '7.00.08'
__version__ = '7.00.09'
__license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
#pylint: disable=wrong-import-position
@@ -4662,6 +4662,7 @@ def clearServiceCache(service):
DISCOVERY_URIS = [googleapiclient.discovery.V1_DISCOVERY_URI, googleapiclient.discovery.V2_DISCOVERY_URI]
# Used for API.CLOUDRESOURCEMANAGER, API.SERVICEUSAGE, API.IAM, API.IAP
def getAPIService(api, httpObj):
api, version, v2discovery = API.getVersion(api)
return googleapiclient.discovery.build(api, version, http=httpObj, cache_discovery=False,
@@ -4669,6 +4670,9 @@ def getAPIService(api, httpObj):
def getService(api, httpObj):
hasLocalJSON = API.hasLocalJSON(api)
### Drive v3beta
if api == API.DRIVE3 and GC.Values[GC.DRIVE_V3_BETA]:
api = API.DRIVE3B
api, version, v2discovery = API.getVersion(api)
if api in GM.Globals[GM.CURRENT_API_SERVICES] and version in GM.Globals[GM.CURRENT_API_SERVICES][api]:
service = googleapiclient.discovery.build_from_document(GM.Globals[GM.CURRENT_API_SERVICES][api][version], http=httpObj)
@@ -4728,6 +4732,8 @@ def defaultSvcAcctScopes():
saScopes[API.DRIVE2] = saScopes[API.DRIVE3]
saScopes[API.DRIVETD] = saScopes[API.DRIVE3]
saScopes[API.SHEETSTD] = saScopes[API.SHEETS]
### Drive v3beta
saScopes[API.DRIVE3B] = saScopes[API.DRIVE3]
return saScopes
def _getSvcAcctData():
@@ -52478,6 +52484,8 @@ def getDriveFileCopyAttribute(myarg, body, parameters):
else:
Cmd.Backup()
usageErrorExit(Msg.REASON_ONLY_VALID_WITH_CONTENTRESTRICTIONS_READONLY_TRUE)
elif myarg == 'inheritedpermissionsdisabled':
body['inheritedPermissionsDisabled'] = getBoolean()
elif myarg == 'property':
driveprop = getDriveFileProperty()
body.setdefault(driveprop['visibility'], {})
@@ -53294,6 +53302,7 @@ DRIVE_FIELDS_CHOICE_MAP = {
'iconlink': 'iconLink',
'id': 'id',
'imagemediametadata': 'imageMediaMetadata',
'inheritedpermissionsdisabled': 'inheritedPermissionsDisabled',
'isappauthorized': 'isAppAuthorized',
'labelinfo': 'labelInfo',
'labels': ['modifiedByMe', 'copyRequiresWriterPermission', 'starred', 'trashed', 'viewedByMe'],
@@ -53376,8 +53385,10 @@ DRIVE_CAPABILITIES_SUBFIELDS_CHOICE_MAP = {
'candelete': 'canDelete',
'candeletechildren': 'canDeleteChildren',
'candeletedrive': 'canDeleteDrive',
'candisableinheritedpermissions': 'canDisableInheritedPermissions',
'candownload': 'canDownload',
'canedit': 'canEdit',
'canenableinheritedpermissions': 'canEnableInheritedPermissions',
'canlistchildren': 'canListChildren',
'canmanagemembers': 'canManageMembers',
'canmodifycontent': 'canModifyContent',
@@ -53452,6 +53463,7 @@ DRIVE_PERMISSIONS_SUBFIELDS_CHOICE_MAP = {
'expirationdate': 'expirationTime',
'expirationtime': 'expirationTime',
'id': 'id',
'inheritedpermissionsdisabled': 'inheritedPermissionsDisabled',
'name': 'displayName',
'pendingowner': 'pendingOwner',
'permissiondetails': 'permissionDetails',

View File

@@ -58,6 +58,7 @@ DIRECTORY_BETA = 'directory_beta'
DOCS = 'docs'
DRIVE2 = 'drive2'
DRIVE3 = 'drive3'
DRIVE3B = 'drive3b'
DRIVETD = 'drivetd'
DRIVEACTIVITY = 'driveactivity'
DRIVELABELS = 'drivelabels'
@@ -237,6 +238,7 @@ _INFO = {
DOCS: {'name': 'Docs API', 'version': 'v1', 'v2discovery': True},
DRIVE2: {'name': 'Drive API v2', 'version': 'v2', 'v2discovery': False, 'mappedAPI': 'drive'},
DRIVE3: {'name': 'Drive API v3', 'version': 'v3', 'v2discovery': False, 'mappedAPI': 'drive'},
DRIVE3B: {'name': 'Drive API v3beta', 'version': 'v3beta', 'v2discovery': False, 'mappedAPI': 'drive'},
DRIVETD: {'name': 'Drive API v3 - todrive', 'version': 'v3', 'v2discovery': False, 'mappedAPI': 'drive'},
DRIVEACTIVITY: {'name': 'Drive Activity API v2', 'version': 'v2', 'v2discovery': True},
DRIVELABELS_ADMIN: {'name': 'Drive Labels API v2beta - Admin', 'version': 'v2beta', 'v2discovery': True, 'mappedAPI': DRIVELABELS},

View File

@@ -151,6 +151,8 @@ DOMAIN = 'domain'
DRIVE_DIR = 'drive_dir'
# When retrieving lists of Drive files/folders from API, how many should be retrieved in each chunk
DRIVE_MAX_RESULTS = 'drive_max_results'
# Use Drive V3 beta
DRIVE_V3_BETA = 'drive_v3_beta'
# Use Drive V3 ntive names
DRIVE_V3_NATIVE_NAMES = 'drive_v3_native_names'
# When processing email messages in batches, how many should be processed in each batch
@@ -366,6 +368,7 @@ Defaults = {
DOMAIN: '',
DRIVE_DIR: '',
DRIVE_MAX_RESULTS: '1000',
DRIVE_V3_BETA: FALSE,
DRIVE_V3_NATIVE_NAMES: TRUE,
EMAIL_BATCH_SIZE: '50',
ENABLE_DASA: FALSE,
@@ -479,7 +482,7 @@ VAR_INFO = {
ADMIN_EMAIL: {VAR_TYPE: TYPE_STRING, VAR_ENVVAR: 'GA_ADMIN_EMAIL', VAR_LIMITS: (0, None)},
API_CALLS_RATE_CHECK: {VAR_TYPE: TYPE_BOOLEAN},
API_CALLS_RATE_LIMIT: {VAR_TYPE: TYPE_INTEGER, VAR_LIMITS: (50, None)},
API_CALLS_TRIES_LIMIT: {VAR_TYPE: TYPE_INTEGER, VAR_LIMITS: (3, 10)},
API_CALLS_TRIES_LIMIT: {VAR_TYPE: TYPE_INTEGER, VAR_LIMITS: (3, 30)},
AUTO_BATCH_MIN: {VAR_TYPE: TYPE_INTEGER, VAR_ENVVAR: 'GAM_AUTOBATCH', VAR_LIMITS: (0, 100)},
BAIL_ON_INTERNAL_ERROR_TRIES: {VAR_TYPE: TYPE_INTEGER, VAR_LIMITS: (1, 10)},
BATCH_SIZE: {VAR_TYPE: TYPE_INTEGER, VAR_ENVVAR: 'GAM_BATCH_SIZE', VAR_LIMITS: (1, 1000)},
@@ -528,6 +531,7 @@ VAR_INFO = {
DOMAIN: {VAR_TYPE: TYPE_STRING, VAR_ENVVAR: 'GA_DOMAIN', VAR_LIMITS: (0, None)},
DRIVE_DIR: {VAR_TYPE: TYPE_DIRECTORY, VAR_ENVVAR: 'GAMDRIVEDIR'},
DRIVE_MAX_RESULTS: {VAR_TYPE: TYPE_INTEGER, VAR_LIMITS: (1, 1000)},
DRIVE_V3_BETA: {VAR_TYPE: TYPE_BOOLEAN},
DRIVE_V3_NATIVE_NAMES: {VAR_TYPE: TYPE_BOOLEAN},
EMAIL_BATCH_SIZE: {VAR_TYPE: TYPE_INTEGER, VAR_LIMITS: (1, 100)},
ENABLE_DASA: {VAR_TYPE: TYPE_BOOLEAN, VAR_SIGFILE: 'enabledasa.txt', VAR_SFFT: (FALSE, TRUE)},