Fixed bug in gam <UserTypeEntity> print shareddrives ... formatjson that caused a trap.

This commit is contained in:
Ross Scroggs
2024-04-25 08:46:14 -07:00
parent fc792bf454
commit f87e013ec4
7 changed files with 29 additions and 15 deletions

View File

@@ -10,6 +10,10 @@ 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.74.02
Fixed bug in `gam <UserTypeEntity> print shareddrives ... formatjson` that caused a trap.
### 6.74.01
Updated `gam create|update drivefileacl <DriveFileEntity> ... expiration <Time>` to handle

View File

@@ -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.74.01 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
GAMADV-XTD3 6.74.02 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com>
Python 3.12.3 64-bit final
MacOS Sonoma 14.4.1 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.74.01 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
GAMADV-XTD3 6.74.02 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com>
Python 3.12.3 64-bit final
Windows-10-10.0.17134 AMD64

View File

@@ -143,7 +143,8 @@ Get Shared Drives ID and Name
```
gam redirect csv ./SharedDrives.csv print shareddrives fields id,name
```
Options:
Options for the `gam report drive` commands below:
* `maxactivities 1` - Limits the number of activities displayed for Shared Drives with activity.
* `shownoactivities` - Displays a row for Shared Drives with no activity.
* `addcsvdata shared_drive_id "~id"` adds the Shared Drive ID to the output.

View File

@@ -3,7 +3,7 @@
Print the current version of Gam with details
```
gam version
GAMADV-XTD3 6.74.01 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
GAMADV-XTD3 6.74.02 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com>
Python 3.12.3 64-bit final
MacOS Sonoma 14.4.1 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.74.01 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
GAMADV-XTD3 6.74.02 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com>
Python 3.12.3 64-bit final
MacOS Sonoma 14.4.1 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.74.01 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
GAMADV-XTD3 6.74.02 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com>
Python 3.12.3 64-bit final
MacOS Sonoma 14.4.1 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.74.01
Latest: 6.74.02
echo $?
1
```
@@ -72,7 +72,7 @@ echo $?
Print the current version number without details
```
gam version simple
6.74.01
6.74.02
```
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.74.01 - https://github.com/taers232c/GAMADV-XTD3
GAM 6.74.02 - https://github.com/taers232c/GAMADV-XTD3
Ross Scroggs <ross.scroggs@gmail.com>
Python 3.12.3 64-bit final
MacOS Sonoma 14.4.1 x86_64

View File

@@ -2,6 +2,10 @@
Merged GAM-Team version
6.74.02
Fixed bug in `gam <UserTypeEntity> print shareddrives ... formatjson` that caused a trap.
6.74.01
Updated `gam create|update drivefileacl <DriveFileEntity> ... expiration <Time>` to handle

View File

@@ -10813,7 +10813,7 @@ class Credentials(google.oauth2.credentials.Credentials):
'client_id': client_id,
'client_secret': client_secret,
'redirect_uris': ['http://localhost'],
'auth_uri': 'https://accounts.google.com/o/oauth2/v2/auth',
'auth_uri': API.GOOGLE_OAUTH2_ENDPOINT,
'token_uri': API.GOOGLE_OAUTH2_TOKEN_ENDPOINT,
}
}
@@ -11271,8 +11271,8 @@ def _createClientSecretsOauth2service(httpObj, login_hint, appInfo, projectInfo,
# Deleted: "redirect_uris": ["http://localhost", "urn:ietf:wg:oauth:2.0:oob"],
cs_data = f'''{{
"installed": {{
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"auth_uri": "https://accounts.google.com/o/oauth2/v2/auth",
"auth_provider_x509_cert_url": "{API.GOOGLE_AUTH_PROVIDER_X509_CERT_URL}",
"auth_uri": "{API.GOOGLE_OAUTH2_ENDPOINT}",
"client_id": "{client_id}",
"client_secret": "{client_secret}",
"created_by": "{login_hint}",
@@ -12317,8 +12317,8 @@ def _generatePrivateKeyAndPublicCert(projectId, clientEmail, name, key_size, b64
def _formatOAuth2ServiceData(service_data):
quotedEmail = quote(service_data.get('client_email', ''))
service_data['auth_provider_x509_cert_url'] = 'https://www.googleapis.com/oauth2/v1/certs'
service_data['auth_uri'] = 'https://accounts.google.com/o/oauth2/auth'
service_data['auth_provider_x509_cert_url'] = API.GOOGLE_AUTH_PROVIDER_X509_CERT_URL
service_data['auth_uri'] = API.GOOGLE_OAUTH2_ENDPOINT
service_data['client_x509_cert_url'] = f'https://www.googleapis.com/robot/v1/metadata/x509/{quotedEmail}'
service_data['token_uri'] = API.GOOGLE_OAUTH2_TOKEN_ENDPOINT
service_data['type'] = 'service_account'
@@ -62959,6 +62959,9 @@ def printShowSharedDrives(users, useDomainAdminAccess=False):
if fieldsList:
showFields.add('role')
csvPF.AddTitle('role')
if FJQC.formatJSON:
csvPF.AddJSONTitles(['role'])
csvPF.MoveJSONTitlesToEnd(['JSON'])
if showOrgUnitPaths and useDomainAdminAccess and ((not showFields) or ('orgUnitId' in showFields)):
orgUnitIdToPathMap = getOrgUnitIdToPathMap(cd)
if showFields:

View File

@@ -95,7 +95,9 @@ YOUTUBE = 'youtube'
CHROMEVERSIONHISTORY_URL = 'https://versionhistory.googleapis.com/v1/chrome/platforms'
DRIVE_SCOPE = 'https://www.googleapis.com/auth/drive'
GMAIL_SEND_SCOPE = 'https://www.googleapis.com/auth/gmail.send'
GOOGLE_OAUTH2_TOKEN_ENDPOINT = "https://oauth2.googleapis.com/token"
GOOGLE_AUTH_PROVIDER_X509_CERT_URL = 'https://www.googleapis.com/oauth2/v1/certs'
GOOGLE_OAUTH2_ENDPOINT = 'https://accounts.google.com/o/oauth2/v2/auth'
GOOGLE_OAUTH2_TOKEN_ENDPOINT = 'https://oauth2.googleapis.com/token'
CLOUD_PLATFORM_SCOPE = 'https://www.googleapis.com/auth/cloud-platform'
IAM_SCOPE = 'https://www.googleapis.com/auth/iam'
PEOPLE_SCOPE = 'https://www.googleapis.com/auth/contacts'