gam7 7.6.6__py3-none-any.whl → 7.6.8__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 +12 -12
- gam/gamlib/glmsgs.py +7 -3
- {gam7-7.6.6.dist-info → gam7-7.6.8.dist-info}/METADATA +2 -1
- {gam7-7.6.6.dist-info → gam7-7.6.8.dist-info}/RECORD +7 -7
- {gam7-7.6.6.dist-info → gam7-7.6.8.dist-info}/WHEEL +0 -0
- {gam7-7.6.6.dist-info → gam7-7.6.8.dist-info}/entry_points.txt +0 -0
- {gam7-7.6.6.dist-info → gam7-7.6.8.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.08'
|
|
29
29
|
__license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
|
|
30
30
|
|
|
31
31
|
#pylint: disable=wrong-import-position
|
|
@@ -11384,25 +11384,26 @@ def _waitForSvcAcctCompletion(i):
|
|
|
11384
11384
|
sys.stdout.write(Msg.WAITING_FOR_ITEM_CREATION_TO_COMPLETE_SLEEPING.format(Ent.Singular(Ent.SVCACCT), sleep_time))
|
|
11385
11385
|
time.sleep(sleep_time)
|
|
11386
11386
|
|
|
11387
|
-
def _grantRotateRights(iam, projectId, service_account,
|
|
11387
|
+
def _grantRotateRights(iam, projectId, service_account, account_type='serviceAccount'):
|
|
11388
11388
|
body = {'policy': {'bindings': [{'role': 'roles/iam.serviceAccountKeyAdmin',
|
|
11389
|
-
'members': [f'{account_type}:{
|
|
11389
|
+
'members': [f'{account_type}:{service_account}']}]}}
|
|
11390
11390
|
maxRetries = 10
|
|
11391
|
-
|
|
11392
|
-
|
|
11391
|
+
kvList = [Ent.PROJECT, projectId, Ent.SVCACCT, service_account]
|
|
11392
|
+
printEntityMessage(kvList, Msg.GRANTING_RIGHTS_TO_ROTATE_ITS_OWN_PRIVATE_KEY.format('Granting'))
|
|
11393
11393
|
for retry in range(1, maxRetries+1):
|
|
11394
11394
|
try:
|
|
11395
11395
|
callGAPI(iam.projects().serviceAccounts(), 'setIamPolicy',
|
|
11396
11396
|
throwReasons=[GAPI.INVALID_ARGUMENT],
|
|
11397
11397
|
resource=f'projects/{projectId}/serviceAccounts/{service_account}', body=body)
|
|
11398
|
+
printEntityMessage(kvList, Msg.GRANTING_RIGHTS_TO_ROTATE_ITS_OWN_PRIVATE_KEY.format('Granted'))
|
|
11398
11399
|
return True
|
|
11399
11400
|
except GAPI.invalidArgument as e:
|
|
11400
|
-
entityActionFailedWarning(
|
|
11401
|
+
entityActionFailedWarning(kvList, str(e))
|
|
11401
11402
|
if 'does not exist' not in str(e) or retry == maxRetries:
|
|
11402
11403
|
return False
|
|
11403
11404
|
_waitForSvcAcctCompletion(retry)
|
|
11404
11405
|
except Exception as e:
|
|
11405
|
-
entityActionFailedWarning(
|
|
11406
|
+
entityActionFailedWarning(kvList, str(e))
|
|
11406
11407
|
return False
|
|
11407
11408
|
|
|
11408
11409
|
def _createOauth2serviceJSON(httpObj, projectInfo, svcAcctInfo, create_key=True):
|
|
@@ -11420,6 +11421,7 @@ def _createOauth2serviceJSON(httpObj, projectInfo, svcAcctInfo, create_key=True)
|
|
|
11420
11421
|
return False
|
|
11421
11422
|
except GAPI.alreadyExists as e:
|
|
11422
11423
|
entityActionFailedWarning([Ent.PROJECT, projectInfo['projectId'], Ent.SVCACCT, svcAcctInfo['name']], str(e))
|
|
11424
|
+
writeStderr(Msg.RERUN_THE_COMMAND_AND_SPECIFY_A_NEW_SANAME)
|
|
11423
11425
|
return False
|
|
11424
11426
|
GM.Globals[GM.SVCACCT_SCOPES_DEFINED] = False
|
|
11425
11427
|
if create_key and not doProcessSvcAcctKeys(mode='retainexisting', iam=iam,
|
|
@@ -11428,7 +11430,7 @@ def _createOauth2serviceJSON(httpObj, projectInfo, svcAcctInfo, create_key=True)
|
|
|
11428
11430
|
clientId=service_account['uniqueId']):
|
|
11429
11431
|
return False
|
|
11430
11432
|
sa_email = service_account['name'].rsplit('/', 1)[-1]
|
|
11431
|
-
return _grantRotateRights(iam, projectInfo['projectId'], sa_email
|
|
11433
|
+
return _grantRotateRights(iam, projectInfo['projectId'], sa_email)
|
|
11432
11434
|
|
|
11433
11435
|
def _createClientSecretsOauth2service(httpObj, login_hint, appInfo, projectInfo, svcAcctInfo, create_key=True):
|
|
11434
11436
|
def _checkClientAndSecret(csHttpObj, client_id, client_secret):
|
|
@@ -11921,9 +11923,7 @@ def doUpdateProject():
|
|
|
11921
11923
|
continue
|
|
11922
11924
|
iam = getAPIService(API.IAM, httpObj)
|
|
11923
11925
|
_getSvcAcctData() # needed to read in GM.OAUTH2SERVICE_JSON_DATA
|
|
11924
|
-
_grantRotateRights(iam, projectId,
|
|
11925
|
-
GM.Globals[GM.OAUTH2SERVICE_JSON_DATA]['client_email'],
|
|
11926
|
-
GM.Globals[GM.OAUTH2SERVICE_JSON_DATA]['client_email'])
|
|
11926
|
+
_grantRotateRights(iam, projectId, GM.Globals[GM.OAUTH2SERVICE_JSON_DATA]['client_email'])
|
|
11927
11927
|
Ind.Decrement()
|
|
11928
11928
|
|
|
11929
11929
|
# gam delete project [[admin] <EmailAddress>] [<ProjectIDEntity>]
|
|
@@ -12786,7 +12786,7 @@ def doUploadSvcAcctKeys():
|
|
|
12786
12786
|
iam = getAPIService(API.IAM, httpObj)
|
|
12787
12787
|
if doProcessSvcAcctKeys(mode='upload', iam=iam):
|
|
12788
12788
|
sa_email = GM.Globals[GM.OAUTH2SERVICE_JSON_DATA]['client_email']
|
|
12789
|
-
_grantRotateRights(iam, GM.Globals[GM.OAUTH2SERVICE_JSON_DATA]['project_id'], sa_email
|
|
12789
|
+
_grantRotateRights(iam, GM.Globals[GM.OAUTH2SERVICE_JSON_DATA]['project_id'], sa_email)
|
|
12790
12790
|
sys.stdout.write(Msg.YOUR_GAM_PROJECT_IS_CREATED_AND_READY_TO_USE)
|
|
12791
12791
|
|
|
12792
12792
|
# gam delete sakeys <ServiceAccountKeyList>
|
gam/gamlib/glmsgs.py
CHANGED
|
@@ -72,7 +72,7 @@ Please go to:
|
|
|
72
72
|
24. Paste it at the "Enter your Client Secret: " prompt in your terminal
|
|
73
73
|
25. Press return/enter in your terminal
|
|
74
74
|
26. Switch back to the browser
|
|
75
|
-
27. Click "
|
|
75
|
+
27. Click "OK"
|
|
76
76
|
28. These steps are complete
|
|
77
77
|
'''
|
|
78
78
|
ENTER_YOUR_CLIENT_ID = '\nEnter your Client ID: '
|
|
@@ -287,6 +287,7 @@ GAM_OUT_OF_MEMORY = 'GAM has run out of memory. If this is a large Google Worksp
|
|
|
287
287
|
GENERATING_NEW_PRIVATE_KEY = 'Generating new private key'
|
|
288
288
|
GETTING = 'Getting'
|
|
289
289
|
GETTING_ALL = 'Getting all'
|
|
290
|
+
GRANTING_RIGHTS_TO_ROTATE_ITS_OWN_PRIVATE_KEY = '{0} rights to rotate its own private key'
|
|
290
291
|
GOOGLE_DELEGATION_ERROR = 'Google delegation error, delegator and delegate both exist and are valid for delegation'
|
|
291
292
|
GOT = 'Got'
|
|
292
293
|
GROUP_MAPS_TO_MULTIPLE_OUS = 'File: {0}, Group: {1} references multiple OUs: {2}'
|
|
@@ -294,13 +295,12 @@ GROUP_MAPS_TO_OU_INVALID_ROW = 'File: {0}, Invalid row, must contain non-blank <
|
|
|
294
295
|
GUARDIAN_INVITATION_STATUS_NOT_PENDING = 'Guardian invitation status is not PENDING'
|
|
295
296
|
HAS_CHILD_ORGS = 'Has child {0}'
|
|
296
297
|
HAS_INVALID_FORMAT = '{0}: {1}, Has invalid format'
|
|
297
|
-
HAS_RIGHTS_TO_ROTATE_OWN_PRIVATE_KEY = 'Giving account {0} rights to rotate {1} private key'
|
|
298
298
|
HEADER_NOT_FOUND_IN_CSV_HEADERS = 'Header "{0}" not found in CSV headers of "{1}".'
|
|
299
299
|
HELP_SYNTAX = 'Help: Syntax in file {0}\n'
|
|
300
300
|
HELP_WIKI = 'Help: Documentation is at {0}\n'
|
|
301
301
|
IGNORED = 'Ignored'
|
|
302
302
|
INSTRUCTIONS_CLIENT_SECRETS_JSON = 'Please run\n\ngam create|use project\ngam oauth create\n\nto create and authorize a Client account.\n'
|
|
303
|
-
INSTRUCTIONS_OAUTH2SERVICE_JSON = 'Please run\n\ngam create|use project\ngam user <user>
|
|
303
|
+
INSTRUCTIONS_OAUTH2SERVICE_JSON = 'Please run\n\ngam create|use project\ngam user <user> update serviceaccount\n\nto create and authorize a Service account.\n'
|
|
304
304
|
INSUFFICIENT_PERMISSIONS_TO_PERFORM_TASK = 'Insufficient permissions to perform this task'
|
|
305
305
|
INTER_BATCH_WAIT_INCREASED = 'inter_batch_wait increased to {0:.2f}'
|
|
306
306
|
INVALID = 'Invalid'
|
|
@@ -468,6 +468,10 @@ REFUSING_TO_DEPROVISION_DEVICES = 'Refusing to deprovision {0} devices because a
|
|
|
468
468
|
REPLY_TO_CUSTOM_REQUIRES_EMAIL_ADDRESS = 'replyto REPLY_TO_CUSTOM requires customReplyTo <EmailAddress>'
|
|
469
469
|
REQUEST_COMPLETED_NO_FILES = 'Request completed but no results/files were returned, try requesting again'
|
|
470
470
|
REQUEST_NOT_COMPLETE = 'Request needs to be completed before downloading, current status is: {0}'
|
|
471
|
+
RERUN_THE_COMMAND_AND_SPECIFY_A_NEW_SANAME = """
|
|
472
|
+
Re-run the command specify a new service account name with: saname <ServiceAccountName>
|
|
473
|
+
See: https://github.com/GAM-team/GAM/wiki/Authorization#advanced-use
|
|
474
|
+
"""
|
|
471
475
|
RESOURCE_CAPACITY_FLOOR_REQUIRED = 'Options "capacity <Number>" (<Number> > 0) and "floor <String>" required'
|
|
472
476
|
RESOURCE_FLOOR_REQUIRED = 'Option "floor <String>" required'
|
|
473
477
|
RESULTS_TOO_LARGE_FOR_GOOGLE_SPREADSHEET = 'Results are too large for Google Spreadsheets. Uploading as a regular CSV file.'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: gam7
|
|
3
|
-
Version: 7.6.
|
|
3
|
+
Version: 7.6.8
|
|
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
|
|
@@ -30,6 +30,7 @@ Requires-Dist: httplib2>=0.17.0
|
|
|
30
30
|
Requires-Dist: lxml
|
|
31
31
|
Requires-Dist: passlib>=1.7.2
|
|
32
32
|
Requires-Dist: pathvalidate
|
|
33
|
+
Requires-Dist: pyscard==2.2.1
|
|
33
34
|
Requires-Dist: python-dateutil
|
|
34
35
|
Provides-Extra: yubikey
|
|
35
36
|
Requires-Dist: yubikey-manager>=5.0; extra == 'yubikey'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
gam/__init__.py,sha256=
|
|
1
|
+
gam/__init__.py,sha256=nt7hcXtRNmwE1EKjsg3m4Y_FG6EqTMfVxqeEm0DO2eg,3492389
|
|
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
|
|
@@ -31,7 +31,7 @@ gam/gamlib/glgapi.py,sha256=xk3pEaIE-zHrTNCn5rJYERqqpbN55E1wXlKoqvWP44E,39232
|
|
|
31
31
|
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
|
-
gam/gamlib/glmsgs.py,sha256=
|
|
34
|
+
gam/gamlib/glmsgs.py,sha256=3wqw8Hq-l2n_TGkf7xhjQS9W6Xz5Ic2ErgsW3h-7qNM,33465
|
|
35
35
|
gam/gamlib/glskus.py,sha256=Gi0jjrSGwhCD4SvtqQfuAXwtEiL2zU4c8qXdxO1yY9k,15058
|
|
36
36
|
gam/gamlib/gluprop.py,sha256=IyPLCyvn7-NHTUenM71YPQPXRZXx6CB5q-GtJ-FYd1c,11461
|
|
37
37
|
gam/gamlib/glverlibs.py,sha256=XXYhmjOVti78JTy7NNr4ShIwiOX7LrfrmFSlqSWixrE,1077
|
|
@@ -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.8.dist-info/METADATA,sha256=g-ghBkYsY2v72Za5GgyYmrueLAyThQX5PXkLIyGOkXg,2918
|
|
69
|
+
gam7-7.6.8.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
70
|
+
gam7-7.6.8.dist-info/entry_points.txt,sha256=HVUM5J7dA8YwvJfG30jiLefR19ExMs387TWugWd9sf4,42
|
|
71
|
+
gam7-7.6.8.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
72
|
+
gam7-7.6.8.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|