gam7 7.6.9__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 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.09'
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
- hosts = ['api.github.com',
9362
- 'raw.githubusercontent.com',
9363
- 'accounts.google.com',
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}/{host_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
- continue
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
- if success_count == host_count:
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
- if member['type'] != Ent.TYPE_GROUP:
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
- if member['type'] != Ent.TYPE_GROUP:
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
- if member['type'] != Ent.TYPE_GROUP:
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
- if member['type'] != Ent.TYPE_GROUP:
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': False},
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},
gam/gamlib/glskus.py CHANGED
@@ -144,6 +144,8 @@ _SKUS = {
144
144
  'product': 'Google-Apps', 'aliases': ['wsflw', 'workspacefrontline', 'workspacefrontlineworker'], 'displayName': 'Google Workspace Frontline Starter'},
145
145
  '1010020031': {
146
146
  'product': 'Google-Apps', 'aliases': ['wsflwstan', 'workspacefrontlinestan', 'workspacefrontlineworkerstan'], 'displayName': 'Google Workspace Frontline Standard'},
147
+ '1010020034': {
148
+ 'product': 'Google-Apps', 'aliases': ['wsflwplus', 'workspacefrontlineplus', 'workspacefrontlineworkerplus'], 'displayName': 'Google Workspace Frontline Plus'},
147
149
  '1010340001': {
148
150
  'product': '101034', 'aliases': ['gseau', 'enterprisearchived', 'gsuiteenterprisearchived'], 'displayName': 'Google Workspace Enterprise Plus - Archived User'},
149
151
  '1010340002': {
gam/gamlib/glverlibs.py CHANGED
@@ -20,14 +20,19 @@
20
20
 
21
21
  """
22
22
 
23
- GAM_VER_LIBS = ['cryptography',
24
- 'filelock',
25
- 'google-api-python-client',
26
- 'google-auth-httplib2',
27
- 'google-auth-oauthlib',
28
- 'google-auth',
29
- 'httplib2',
30
- 'passlib',
31
- 'python-dateutil',
32
- 'yubikey-manager',
33
- ]
23
+ GAM_VER_LIBS = [
24
+ 'chardet',
25
+ 'cryptography',
26
+ 'filelock',
27
+ 'google-api-python-client',
28
+ 'google-auth-httplib2',
29
+ 'google-auth-oauthlib',
30
+ 'google-auth',
31
+ 'lxml',
32
+ 'httplib2',
33
+ 'passlib',
34
+ 'pathvalidate',
35
+ 'pyscard',
36
+ 'python-dateutil',
37
+ 'yubikey-manager',
38
+ ]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gam7
3
- Version: 7.6.9
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
@@ -18,22 +18,22 @@ Classifier: Programming Language :: Python :: 3.11
18
18
  Classifier: Programming Language :: Python :: 3.12
19
19
  Classifier: Programming Language :: Python :: 3.13
20
20
  Requires-Python: >=3.9
21
- Requires-Dist: chardet
22
- Requires-Dist: cryptography
21
+ Requires-Dist: chardet>=5.2.0
22
+ Requires-Dist: cryptography>=44.0.2
23
23
  Requires-Dist: distro; sys_platform == 'linux'
24
- Requires-Dist: filelock
25
- Requires-Dist: google-api-python-client>=2.1
26
- Requires-Dist: google-auth-httplib2
27
- Requires-Dist: google-auth-oauthlib>=0.4.1
28
- Requires-Dist: google-auth>=2.3.2
29
- Requires-Dist: httplib2>=0.17.0
30
- Requires-Dist: lxml
31
- Requires-Dist: passlib>=1.7.2
32
- Requires-Dist: pathvalidate
24
+ Requires-Dist: filelock>=3.18.0
25
+ Requires-Dist: google-api-python-client>=2.167.0
26
+ Requires-Dist: google-auth-httplib2>=0.2.0
27
+ Requires-Dist: google-auth-oauthlib>=1.2.2
28
+ Requires-Dist: google-auth>=2.39.0
29
+ Requires-Dist: httplib2>=0.22.0
30
+ Requires-Dist: lxml>=5.4.0
31
+ Requires-Dist: passlib>=1.7.4
32
+ Requires-Dist: pathvalidate>=3.2.3
33
33
  Requires-Dist: pyscard==2.2.1
34
34
  Requires-Dist: python-dateutil
35
35
  Provides-Extra: yubikey
36
- Requires-Dist: yubikey-manager>=5.0; extra == 'yubikey'
36
+ Requires-Dist: yubikey-manager>=5.6.1; extra == 'yubikey'
37
37
  Description-Content-Type: text/markdown
38
38
 
39
39
  GAM is a command line tool for Google Workspace admins to manage domain and user settings quickly and easily.
@@ -1,4 +1,4 @@
1
- gam/__init__.py,sha256=It60fhbeNSIintbA7ttBwvgGF9jsA9_FTRtl1Zoxkqo,3493033
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=EAQXkaM13t6jjh9vL4eHJqIZRI5kmzeneiFs5xcWXfg,34304
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
@@ -32,9 +32,9 @@ gam/gamlib/glgdata.py,sha256=weRppttWm6uRyqtBoGPKoHiNZ2h28nhfUV4J_mbCszY,2707
32
32
  gam/gamlib/glglobals.py,sha256=Y73xM1RNhIbtcqnMv1gcZF3wDWOeLWW-7SvoQyWw6tA,9659
33
33
  gam/gamlib/glindent.py,sha256=RfBa2LDfLIqPLL5vMfC689TCVmqn8xf-qulSzkiatrc,1228
34
34
  gam/gamlib/glmsgs.py,sha256=3wqw8Hq-l2n_TGkf7xhjQS9W6Xz5Ic2ErgsW3h-7qNM,33465
35
- gam/gamlib/glskus.py,sha256=Gi0jjrSGwhCD4SvtqQfuAXwtEiL2zU4c8qXdxO1yY9k,15058
35
+ gam/gamlib/glskus.py,sha256=xJ1E2BZ_CGHN6I19c9i8DApb5bT5VT-hGyMEmQ5hSRY,15241
36
36
  gam/gamlib/gluprop.py,sha256=IyPLCyvn7-NHTUenM71YPQPXRZXx6CB5q-GtJ-FYd1c,11461
37
- gam/gamlib/glverlibs.py,sha256=XXYhmjOVti78JTy7NNr4ShIwiOX7LrfrmFSlqSWixrE,1077
37
+ gam/gamlib/glverlibs.py,sha256=A8rvegBF2nD6etbBRb8hsv-oZyjpD4VcUQ8PffW-bqU,992
38
38
  gam/gamlib/yubikey.py,sha256=-UC-3oue9qarYK3LT7YL6Gmqs7TMK8oz9_AoxdaG2FA,7925
39
39
  gam/gdata/__init__.py,sha256=uvjmSza2EdL7lGaoJ04-uXHGeYa0i1dBQHIetBybcUQ,29637
40
40
  gam/gdata/service.py,sha256=CuImJDRVcNMM1dfo7V6T0LrztzqTNrIraaLkHXpL0Tw,70045
@@ -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.9.dist-info/METADATA,sha256=1BF0s8Y--r2XYAJ2uLJgJd9nyXPhFTuFox5klAt8YjY,2918
69
- gam7-7.6.9.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
70
- gam7-7.6.9.dist-info/entry_points.txt,sha256=HVUM5J7dA8YwvJfG30jiLefR19ExMs387TWugWd9sf4,42
71
- gam7-7.6.9.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
72
- gam7-7.6.9.dist-info/RECORD,,
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