mirror of
https://github.com/GAM-team/GAM.git
synced 2026-07-03 12:21:35 +00:00
Cleanup
This commit is contained in:
@@ -10,6 +10,15 @@ Add the `-s` option to the end of the above commands to suppress creating the `g
|
||||
|
||||
See [Downloads](https://github.com/taers232c/GAMADV-XTD3/wiki/Downloads) for Windows or other options, including manual installation
|
||||
|
||||
### 6.77.01
|
||||
|
||||
Thanks to Jay, added column `verificationCodesCount` to `gam <UserTypeEntity> print backupcodes`
|
||||
that displays the number of available backup codes in addtion to the codes.
|
||||
|
||||
Added option `countsonly` that displays only the number of available backup codes but not the codes themselves.
|
||||
|
||||
Thanks to Jay, added option `nokey` to `gam create project` that creates a project with no service account key, `oauth2service.json`.
|
||||
|
||||
### 6.77.00
|
||||
|
||||
Added option `individualstudentassignments copy|delete|maptoall` to `gam create|update course ... copyfrom`
|
||||
|
||||
@@ -335,7 +335,7 @@ writes the credentials into the file oauth2.txt.
|
||||
admin@server:/Users/admin/bin/gamadv-xtd3$ rm -f /Users/admin/GAMConfig/oauth2.txt
|
||||
admin@server:/Users/admin/bin/gamadv-xtd3$ ./gam version
|
||||
WARNING: Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: /Users/admin/GAMConfig/oauth2.txt, Not Found
|
||||
GAMADV-XTD3 6.77.00 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
||||
GAMADV-XTD3 6.77.01 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
||||
Ross Scroggs <ross.scroggs@gmail.com>
|
||||
Python 3.12.4 64-bit final
|
||||
MacOS Sonoma 14.5 x86_64
|
||||
@@ -1009,7 +1009,7 @@ writes the credentials into the file oauth2.txt.
|
||||
C:\GAMADV-XTD3>del C:\GAMConfig\oauth2.txt
|
||||
C:\GAMADV-XTD3>gam version
|
||||
WARNING: Config File: C:\GAMConfig\gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: C:\GAMConfig\oauth2.txt, Not Found
|
||||
GAMADV-XTD3 6.77.00 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
||||
GAMADV-XTD3 6.77.01 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
||||
Ross Scroggs <ross.scroggs@gmail.com>
|
||||
Python 3.12.4 64-bit final
|
||||
Windows-10-10.0.17134 AMD64
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
Print the current version of Gam with details
|
||||
```
|
||||
gam version
|
||||
GAMADV-XTD3 6.77.00 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
||||
GAMADV-XTD3 6.77.01 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
||||
Ross Scroggs <ross.scroggs@gmail.com>
|
||||
Python 3.12.4 64-bit final
|
||||
MacOS Sonoma 14.5 x86_64
|
||||
@@ -15,7 +15,7 @@ Time: 2023-06-02T21:10:00-07:00
|
||||
Print the current version of Gam with details and time offset information
|
||||
```
|
||||
gam version timeoffset
|
||||
GAMADV-XTD3 6.77.00 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
||||
GAMADV-XTD3 6.77.01 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
||||
Ross Scroggs <ross.scroggs@gmail.com>
|
||||
Python 3.12.4 64-bit final
|
||||
MacOS Sonoma 14.5 x86_64
|
||||
@@ -27,7 +27,7 @@ Your system time differs from www.googleapis.com by less than 1 second
|
||||
Print the current version of Gam with extended details and SSL information
|
||||
```
|
||||
gam version extended
|
||||
GAMADV-XTD3 6.77.00 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
||||
GAMADV-XTD3 6.77.01 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
||||
Ross Scroggs <ross.scroggs@gmail.com>
|
||||
Python 3.12.4 64-bit final
|
||||
MacOS Sonoma 14.5 x86_64
|
||||
@@ -64,7 +64,7 @@ MacOS High Sierra 10.13.6 x86_64
|
||||
Path: /Users/Admin/bin/gamadv-xtd3
|
||||
Version Check:
|
||||
Current: 5.35.08
|
||||
Latest: 6.77.00
|
||||
Latest: 6.77.01
|
||||
echo $?
|
||||
1
|
||||
```
|
||||
@@ -72,7 +72,7 @@ echo $?
|
||||
Print the current version number without details
|
||||
```
|
||||
gam version simple
|
||||
6.77.00
|
||||
6.77.01
|
||||
```
|
||||
In Linux/MacOS you can do:
|
||||
```
|
||||
@@ -82,7 +82,7 @@ echo $VER
|
||||
Print the current version of Gam and address of this Wiki
|
||||
```
|
||||
gam help
|
||||
GAM 6.77.00 - https://github.com/taers232c/GAMADV-XTD3
|
||||
GAM 6.77.01 - https://github.com/taers232c/GAMADV-XTD3
|
||||
Ross Scroggs <ross.scroggs@gmail.com>
|
||||
Python 3.12.4 64-bit final
|
||||
MacOS Sonoma 14.5 x86_64
|
||||
|
||||
@@ -1346,7 +1346,7 @@ gam create project [admin <EmailAddress>] [project <ProjectID>]
|
||||
[(algorithm KEY_ALG_RSA_1024|KEY_ALG_RSA_2048)|
|
||||
(localkeysize 1024|2048|4096 [validityhours <Number>])|
|
||||
(yubikey yubikey_pin yubikey_slot AUTHENTICATION|SIGNATURE yubikey_serialnumber <Number>)|
|
||||
(nokey)]
|
||||
nokey]
|
||||
gam use project [<EmailAddress>] [<ProjectID>]
|
||||
gam use project [admin <EmailAddress>] [project <ProjectID>]
|
||||
[saname <ServiceAccountName>] [sadisplayname <ServiceAccountDisplayName>]
|
||||
@@ -5628,8 +5628,7 @@ gam <UserTypeEntity> update backupcodes|verificationcodes
|
||||
gam <UserTypeEntity> delete backupcodes|verificationcodes
|
||||
gam <UserTypeEntity> show backupcodes|verificationcodes
|
||||
gam <UserTypeEntity> print backupcodes|verificationcodes [todrive <ToDriveAttribute>*]
|
||||
[delimiter <Character>]
|
||||
[countsonly]
|
||||
[delimiter <Character>] [countsonly]
|
||||
|
||||
# Users - Calendars
|
||||
|
||||
|
||||
@@ -2,6 +2,15 @@
|
||||
|
||||
Merged GAM-Team version
|
||||
|
||||
6.77.01
|
||||
|
||||
Thanks to Jay, added column `verificationCodesCount` to `gam <UserTypeEntity> print backupcodes`
|
||||
that displays the number of available backup codes in addtion to the codes.
|
||||
|
||||
Added option `countsonly` that displays only the number of available backup codes but not the codes themselves.
|
||||
|
||||
Thanks to Jay, added option `nokey` to `gam create project` that creates a project with no service account key, `oauth2service.json`.
|
||||
|
||||
6.77.00
|
||||
|
||||
Added option `individualstudentassignments copy|delete|maptoall` to `gam create|update course ... copyfrom`
|
||||
|
||||
@@ -11213,8 +11213,10 @@ def _createOauth2serviceJSON(httpObj, projectInfo, svcAcctInfo, create_key=True)
|
||||
entityActionFailedWarning([Ent.PROJECT, projectInfo['projectId'], Ent.SVCACCT, svcAcctInfo['name']], str(e))
|
||||
return False
|
||||
GM.Globals[GM.SVCACCT_SCOPES_DEFINED] = False
|
||||
if create_key and not doProcessSvcAcctKeys(mode='retainexisting', iam=iam, projectId=service_account['projectId'],
|
||||
clientEmail=service_account['email'], clientId=service_account['uniqueId']):
|
||||
if create_key and not doProcessSvcAcctKeys(mode='retainexisting', iam=iam,
|
||||
projectId=service_account['projectId'],
|
||||
clientEmail=service_account['email'],
|
||||
clientId=service_account['uniqueId']):
|
||||
return False
|
||||
sa_email = service_account['name'].rsplit('/', 1)[-1]
|
||||
_grantRotateRights(iam, projectInfo['projectId'], sa_email, sa_email)
|
||||
@@ -11231,7 +11233,6 @@ def setGAMProjectConsentScreen(httpObj, projectId, appInfo):
|
||||
pass
|
||||
|
||||
def _createClientSecretsOauth2service(httpObj, login_hint, appInfo, projectInfo, svcAcctInfo, create_key=True):
|
||||
|
||||
def _checkClientAndSecret(csHttpObj, client_id, client_secret):
|
||||
post_data = {'client_id': client_id, 'client_secret': client_secret,
|
||||
'code': 'ThisIsAnInvalidCodeOnlyBeingUsedToTestIfClientAndSecretAreValid',
|
||||
@@ -11391,7 +11392,7 @@ def _getLoginHintProjectInfo(createCmd):
|
||||
svcAcctInfo = {'name': '', 'displayName': '', 'description': ''}
|
||||
if not Cmd.PeekArgumentPresent(['admin', 'appname', 'supportemail', 'project', 'parent',
|
||||
'projectname', 'saname', 'sadisplayname', 'sadescription',
|
||||
'algorithm', 'localkeysize', 'validityhours', 'yubikey']):
|
||||
'algorithm', 'localkeysize', 'validityhours', 'yubikey', 'nokey']):
|
||||
login_hint = getString(Cmd.OB_EMAIL_ADDRESS, optional=True)
|
||||
if login_hint and login_hint.find('@') == -1:
|
||||
Cmd.Backup()
|
||||
@@ -11611,7 +11612,7 @@ def doCreateGCPFolder():
|
||||
# [(algorithm KEY_ALG_RSA_1024|KEY_ALG_RSA_2048)|
|
||||
# (localkeysize 1024|2048|4096 [validityhours <Number>])|
|
||||
# (yubikey yubikey_pin yubikey_slot AUTHENTICATION yubikey_serialnumber <String>)|
|
||||
# (nokey)]
|
||||
# nokey]
|
||||
def doCreateProject():
|
||||
_checkForExistingProjectFiles([GC.Values[GC.OAUTH2SERVICE_JSON], GC.Values[GC.CLIENT_SECRETS_JSON]])
|
||||
sys.stdout.write(Msg.TRUST_GAM_CLIENT_ID.format(GAM_PROJECT_CREATION, GAM_PROJECT_CREATION_CLIENT_ID))
|
||||
@@ -48587,11 +48588,12 @@ def deleteBackupCodes(users):
|
||||
entityActionNotPerformedWarning([Ent.USER, user, Ent.BACKUP_VERIFICATION_CODES, None],
|
||||
Msg.IS_SUSPENDED_NO_BACKUPCODES, i, count)
|
||||
|
||||
# gam <UserTypeEntity> print backupcodes|verificationcodes [todrive <ToDriveAttribute>*] [delimiter <Character>] [countsonly]
|
||||
# gam <UserTypeEntity> print backupcodes|verificationcodes [todrive <ToDriveAttribute>*]
|
||||
# [delimiter <Character>] [countsonly]
|
||||
# gam <UserTypeEntity> show backupcodes|verificationcodes
|
||||
def printShowBackupCodes(users):
|
||||
cd = buildGAPIObject(API.DIRECTORY)
|
||||
csvPF = CSVPrintFile(['User', 'verificationCodes', 'verificationCodesCount']) if Act.csvFormat() else None
|
||||
csvPF = CSVPrintFile(['User', 'verificationCodesCount', 'verificationCodes']) if Act.csvFormat() else None
|
||||
delimiter = GC.Values[GC.CSV_OUTPUT_FIELD_DELIMITER]
|
||||
counts_only = False
|
||||
while Cmd.ArgumentsRemaining():
|
||||
@@ -48604,12 +48606,13 @@ def printShowBackupCodes(users):
|
||||
counts_only = True
|
||||
else:
|
||||
unknownArgumentExit()
|
||||
i, count, users = getEntityArgument(users)
|
||||
# if we're only getting counts, we don't want actual codes pulled down
|
||||
if counts_only:
|
||||
csvPF.RemoveTitles('verificationCodes')
|
||||
fields = 'items(etag)'
|
||||
else:
|
||||
fields = 'items(verificationCode)'
|
||||
i, count, users = getEntityArgument(users)
|
||||
for user in users:
|
||||
i += 1
|
||||
user = normalizeEmailAddressOrUID(user)
|
||||
|
||||
Reference in New Issue
Block a user