gam7 7.6.10__py3-none-any.whl → 7.6.11__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 +64 -34
- gam/gamlib/glapi.py +1 -1
- {gam7-7.6.10.dist-info → gam7-7.6.11.dist-info}/METADATA +2 -2
- {gam7-7.6.10.dist-info → gam7-7.6.11.dist-info}/RECORD +7 -7
- {gam7-7.6.10.dist-info → gam7-7.6.11.dist-info}/WHEEL +0 -0
- {gam7-7.6.10.dist-info → gam7-7.6.11.dist-info}/entry_points.txt +0 -0
- {gam7-7.6.10.dist-info → gam7-7.6.11.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.06.
|
|
28
|
+
__version__ = '7.06.11'
|
|
29
29
|
__license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
|
|
30
30
|
|
|
31
31
|
#pylint: disable=wrong-import-position
|
|
@@ -95,6 +95,8 @@ import wsgiref.simple_server
|
|
|
95
95
|
import wsgiref.util
|
|
96
96
|
import zipfile
|
|
97
97
|
|
|
98
|
+
# disable legacy stuff we don't use and isn't secure
|
|
99
|
+
os.environ['CRYPTOGRAPHY_OPENSSL_NO_LEGACY'] = "1"
|
|
98
100
|
from cryptography import x509
|
|
99
101
|
from cryptography.hazmat.backends import default_backend
|
|
100
102
|
from cryptography.hazmat.primitives import hashes, serialization
|
|
@@ -9358,32 +9360,9 @@ def getOSPlatform():
|
|
|
9358
9360
|
|
|
9359
9361
|
# gam checkconnection
|
|
9360
9362
|
def doCheckConnection():
|
|
9361
|
-
|
|
9362
|
-
|
|
9363
|
-
|
|
9364
|
-
'workspace.google.com',
|
|
9365
|
-
'oauth2.googleapis.com',
|
|
9366
|
-
'www.googleapis.com']
|
|
9367
|
-
fix_hosts = {'calendar-json.googleapis.com': 'www.googleapis.com',
|
|
9368
|
-
'storage-api.googleapis.com': 'storage.googleapis.com'}
|
|
9369
|
-
api_hosts = ['apps-apis.google.com',
|
|
9370
|
-
'sites.google.com',
|
|
9371
|
-
'versionhistory.googleapis.com',
|
|
9372
|
-
'www.google.com']
|
|
9373
|
-
for host in API.PROJECT_APIS:
|
|
9374
|
-
host = fix_hosts.get(host, host)
|
|
9375
|
-
if host not in api_hosts and host not in hosts:
|
|
9376
|
-
api_hosts.append(host)
|
|
9377
|
-
hosts.extend(sorted(api_hosts))
|
|
9378
|
-
host_count = len(hosts)
|
|
9379
|
-
httpObj = getHttpObj(timeout=30)
|
|
9380
|
-
httpObj.follow_redirects = False
|
|
9381
|
-
headers = {'user-agent': GAM_USER_AGENT}
|
|
9382
|
-
okay = createGreenText('OK')
|
|
9383
|
-
not_okay = createRedText('ERROR')
|
|
9384
|
-
try_count = 0
|
|
9385
|
-
success_count = 0
|
|
9386
|
-
for host in hosts:
|
|
9363
|
+
|
|
9364
|
+
def check_host(host):
|
|
9365
|
+
nonlocal try_count, okay, not_okay, success_count
|
|
9387
9366
|
try_count += 1
|
|
9388
9367
|
dns_err = None
|
|
9389
9368
|
ip = 'unknown'
|
|
@@ -9393,12 +9372,12 @@ def doCheckConnection():
|
|
|
9393
9372
|
dns_err = f'{not_okay}\n DNS failure: {str(e)}\n'
|
|
9394
9373
|
except Exception as e:
|
|
9395
9374
|
dns_err = f'{not_okay}\n Unknown DNS failure: {str(e)}\n'
|
|
9396
|
-
check_line = f'Checking {host} ({ip}) ({try_count}
|
|
9375
|
+
check_line = f'Checking {host} ({ip}) ({try_count})...'
|
|
9397
9376
|
writeStdout(f'{check_line:<100}')
|
|
9398
9377
|
flushStdout()
|
|
9399
9378
|
if dns_err:
|
|
9400
9379
|
writeStdout(dns_err)
|
|
9401
|
-
|
|
9380
|
+
return
|
|
9402
9381
|
gen_firewall = 'You probably have security software or a firewall on your machine or network that is preventing GAM from making Internet connections. Check your network configuration or try running GAM on a hotspot or home network to see if the problem exists only on your organization\'s network.'
|
|
9403
9382
|
try:
|
|
9404
9383
|
if host.startswith('http'):
|
|
@@ -9427,7 +9406,54 @@ def doCheckConnection():
|
|
|
9427
9406
|
writeStdout(f'{not_okay}\n Timed out trying to connect to host\n')
|
|
9428
9407
|
except Exception as e:
|
|
9429
9408
|
writeStdout(f'{not_okay}\n {str(e)}\n')
|
|
9430
|
-
|
|
9409
|
+
|
|
9410
|
+
try_count = 0
|
|
9411
|
+
httpObj = getHttpObj(timeout=30)
|
|
9412
|
+
httpObj.follow_redirects = False
|
|
9413
|
+
headers = {'user-agent': GAM_USER_AGENT}
|
|
9414
|
+
okay = createGreenText('OK')
|
|
9415
|
+
not_okay = createRedText('ERROR')
|
|
9416
|
+
success_count = 0
|
|
9417
|
+
initial_hosts = ['api.github.com',
|
|
9418
|
+
'raw.githubusercontent.com',
|
|
9419
|
+
'accounts.google.com',
|
|
9420
|
+
'oauth2.googleapis.com',
|
|
9421
|
+
'www.googleapis.com']
|
|
9422
|
+
for host in initial_hosts:
|
|
9423
|
+
check_host(host)
|
|
9424
|
+
api_hosts = ['apps-apis.google.com',
|
|
9425
|
+
'www.google.com']
|
|
9426
|
+
for host in api_hosts:
|
|
9427
|
+
check_host(host)
|
|
9428
|
+
# For v2 discovery APIs, GAM gets discovery file from <api>.googleapis.com so
|
|
9429
|
+
# add those domains.
|
|
9430
|
+
disc_hosts = []
|
|
9431
|
+
for api, config in API._INFO.items():
|
|
9432
|
+
if config.get('v2discovery') and not config.get('localdiscovery'):
|
|
9433
|
+
if mapped_api := config.get('mappedAPI'):
|
|
9434
|
+
api = mapped_api
|
|
9435
|
+
host = f'{api}.googleapis.com'
|
|
9436
|
+
if host not in disc_hosts:
|
|
9437
|
+
disc_hosts.append(host)
|
|
9438
|
+
for host in disc_hosts:
|
|
9439
|
+
check_host(host)
|
|
9440
|
+
checked_hosts = initial_hosts + api_hosts + disc_hosts
|
|
9441
|
+
# now we need to "build" each API and check it's base URL host
|
|
9442
|
+
# if we haven't already. This may not be any hosts at all but
|
|
9443
|
+
# to ensure we are checking all hosts GAM may use we should
|
|
9444
|
+
# keep this.
|
|
9445
|
+
for api in API._INFO:
|
|
9446
|
+
if api in [API.CONTACTS, API.EMAIL_AUDIT]:
|
|
9447
|
+
continue
|
|
9448
|
+
svc = getService(api, httpObj)
|
|
9449
|
+
base_url = svc._rootDesc.get('baseUrl')
|
|
9450
|
+
parsed_base_url = urlparse(base_url)
|
|
9451
|
+
base_host = parsed_base_url.netloc
|
|
9452
|
+
if base_host not in checked_hosts:
|
|
9453
|
+
print(f'checking {base_host} for {api}')
|
|
9454
|
+
check_host(base_host)
|
|
9455
|
+
checked_hosts.append(base_host)
|
|
9456
|
+
if success_count == try_count:
|
|
9431
9457
|
writeStdout(createGreenText('All hosts passed!\n'))
|
|
9432
9458
|
else:
|
|
9433
9459
|
systemErrorExit(3, createYellowText('Some hosts failed to connect! Please follow the recommendations for those hosts to correct any issues and try again.'))
|
|
@@ -34179,7 +34205,8 @@ def getGroupMembers(cd, groupEmail, memberRoles, membersList, membersSet, i, cou
|
|
|
34179
34205
|
elif memberOptions[MEMBEROPTION_NODUPLICATES]:
|
|
34180
34206
|
groupMemberList = []
|
|
34181
34207
|
for member in groupMembers:
|
|
34182
|
-
|
|
34208
|
+
namespace = member['email'].find('@') == -1
|
|
34209
|
+
if member['type'] != Ent.TYPE_GROUP or namespace:
|
|
34183
34210
|
if ((member['type'] in typesSet and
|
|
34184
34211
|
checkMemberMatch(member, memberOptions) and
|
|
34185
34212
|
_checkMemberRoleIsSuspendedIsArchived(member, validRoles, memberOptions[MEMBEROPTION_ISSUSPENDED], memberOptions[MEMBEROPTION_ISARCHIVED]) and
|
|
@@ -34208,7 +34235,8 @@ def getGroupMembers(cd, groupEmail, memberRoles, membersList, membersSet, i, cou
|
|
|
34208
34235
|
memberOptions, memberDisplayOptions, level+1, typesSet)
|
|
34209
34236
|
else:
|
|
34210
34237
|
for member in groupMembers:
|
|
34211
|
-
|
|
34238
|
+
namespace = member['email'].find('@') == -1
|
|
34239
|
+
if member['type'] != Ent.TYPE_GROUP or namespace:
|
|
34212
34240
|
if ((member['type'] in typesSet) and
|
|
34213
34241
|
checkMemberMatch(member, memberOptions) and
|
|
34214
34242
|
_checkMemberRoleIsSuspendedIsArchived(member, validRoles,
|
|
@@ -36307,7 +36335,8 @@ def getCIGroupMembers(ci, groupName, memberRoles, membersList, membersSet, i, co
|
|
|
36307
36335
|
for member in groupMembers:
|
|
36308
36336
|
getCIGroupMemberRoleFixType(member)
|
|
36309
36337
|
memberName = member.get('preferredMemberKey', {}).get('id', '')
|
|
36310
|
-
|
|
36338
|
+
namespace = member.get('preferredMemberKey', {}).get('namespace', '')
|
|
36339
|
+
if member['type'] != Ent.TYPE_GROUP or namespace:
|
|
36311
36340
|
if (member['type'] in typesSet and
|
|
36312
36341
|
checkCIMemberMatch(member, memberOptions) and
|
|
36313
36342
|
_checkMemberRole(member, validRoles) and
|
|
@@ -36335,7 +36364,8 @@ def getCIGroupMembers(ci, groupName, memberRoles, membersList, membersSet, i, co
|
|
|
36335
36364
|
for member in groupMembers:
|
|
36336
36365
|
getCIGroupMemberRoleFixType(member)
|
|
36337
36366
|
memberName = member.get('preferredMemberKey', {}).get('id', '')
|
|
36338
|
-
|
|
36367
|
+
namespace = member.get('preferredMemberKey', {}).get('namespace', '')
|
|
36368
|
+
if member['type'] != Ent.TYPE_GROUP or namespace:
|
|
36339
36369
|
if (member['type'] in typesSet and
|
|
36340
36370
|
checkCIMemberMatch(member, memberOptions) and
|
|
36341
36371
|
_checkMemberRole(member, validRoles) and
|
gam/gamlib/glapi.py
CHANGED
|
@@ -244,7 +244,7 @@ _INFO = {
|
|
|
244
244
|
EMAIL_AUDIT: {'name': 'Email Audit API', 'version': 'v1', 'v2discovery': False},
|
|
245
245
|
FORMS: {'name': 'Forms API', 'version': 'v1', 'v2discovery': True},
|
|
246
246
|
GMAIL: {'name': 'Gmail API', 'version': 'v1', 'v2discovery': True},
|
|
247
|
-
GROUPSMIGRATION: {'name': 'Groups Migration API', 'version': 'v1', 'v2discovery':
|
|
247
|
+
GROUPSMIGRATION: {'name': 'Groups Migration API', 'version': 'v1', 'v2discovery': True},
|
|
248
248
|
GROUPSSETTINGS: {'name': 'Groups Settings API', 'version': 'v1', 'v2discovery': True},
|
|
249
249
|
IAM: {'name': 'Identity and Access Management API', 'version': 'v1', 'v2discovery': True},
|
|
250
250
|
IAM_CREDENTIALS: {'name': 'Identity and Access Management Credentials API', 'version': 'v1', 'v2discovery': True},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: gam7
|
|
3
|
-
Version: 7.6.
|
|
3
|
+
Version: 7.6.11
|
|
4
4
|
Summary: CLI tool to manage Google Workspace
|
|
5
5
|
Project-URL: Homepage, https://github.com/GAM-team/GAM
|
|
6
6
|
Project-URL: Issues, https://github.com/GAM-team/GAM/issues
|
|
@@ -27,7 +27,7 @@ Requires-Dist: google-auth-httplib2>=0.2.0
|
|
|
27
27
|
Requires-Dist: google-auth-oauthlib>=1.2.2
|
|
28
28
|
Requires-Dist: google-auth>=2.39.0
|
|
29
29
|
Requires-Dist: httplib2>=0.22.0
|
|
30
|
-
Requires-Dist: lxml
|
|
30
|
+
Requires-Dist: lxml>=5.4.0
|
|
31
31
|
Requires-Dist: passlib>=1.7.4
|
|
32
32
|
Requires-Dist: pathvalidate>=3.2.3
|
|
33
33
|
Requires-Dist: pyscard==2.2.1
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
gam/__init__.py,sha256=
|
|
1
|
+
gam/__init__.py,sha256=KNiJQfBNceRyEsGzIhstQ26VaUkrBHLR6ye51XOO_Og,3494245
|
|
2
2
|
gam/__main__.py,sha256=amz0-959ph6zkZKqjaar4n60yho-T37w6qWI36qx0CA,1049
|
|
3
3
|
gam/cacerts.pem,sha256=nJuWha0xm5dHw_5ptGphwRoO-r36Ccpqiww9pCEDbSc,67484
|
|
4
4
|
gam/cbcm-v1.1beta1.json,sha256=xO5XloCQQULmPbFBx5bckdqmbLFQ7sJ2TImhE1ysDIY,19439
|
|
@@ -23,7 +23,7 @@ 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=
|
|
26
|
+
gam/gamlib/glapi.py,sha256=vESjTXRX5-8SXknfsOCjN1AECe4crBgO3Z9J-SfjWO8,34303
|
|
27
27
|
gam/gamlib/glcfg.py,sha256=cV011FpIWge4oi5_dJrdof66vUqX6UCvTGWWTNVmYEg,28055
|
|
28
28
|
gam/gamlib/glclargs.py,sha256=9i8FVqQmidkgazG7sOKrY-JeyhK8JioxVZMyClgCafY,42306
|
|
29
29
|
gam/gamlib/glentity.py,sha256=ZLbyMl9NhN-MBf9Rxmho2dBYeS4SNLMctpeaKFZSbQ4,33801
|
|
@@ -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.6.
|
|
69
|
-
gam7-7.6.
|
|
70
|
-
gam7-7.6.
|
|
71
|
-
gam7-7.6.
|
|
72
|
-
gam7-7.6.
|
|
68
|
+
gam7-7.6.11.dist-info/METADATA,sha256=lVjnaGjA2rm0vI16EhPTGlj_1fIr--Von8e2q7kwfc8,2970
|
|
69
|
+
gam7-7.6.11.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
70
|
+
gam7-7.6.11.dist-info/entry_points.txt,sha256=HVUM5J7dA8YwvJfG30jiLefR19ExMs387TWugWd9sf4,42
|
|
71
|
+
gam7-7.6.11.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
72
|
+
gam7-7.6.11.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|