mirror of
https://github.com/GAM-team/GAM.git
synced 2026-07-03 12:21:35 +00:00
Compare commits
12 Commits
v7.16.01
...
20250731.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ce7e506c29 | ||
|
|
a9d8ac27d3 | ||
|
|
58912ae7ac | ||
|
|
f882439cbd | ||
|
|
56bc52aa28 | ||
|
|
416125abac | ||
|
|
904292ded3 | ||
|
|
5f55bcc812 | ||
|
|
b35de53f5d | ||
|
|
3c34948678 | ||
|
|
0be73db60b | ||
|
|
5b57b51384 |
@@ -6597,7 +6597,7 @@ gam <UserTypeEntity> print chatemojis [todrive <ToDriveAttribute>*]
|
|||||||
(folderColorRgb <ColorValue>)|
|
(folderColorRgb <ColorValue>)|
|
||||||
(indexabletext <String>)|
|
(indexabletext <String>)|
|
||||||
(inheritedpermissionsdisabled [<Boolean>])|
|
(inheritedpermissionsdisabled [<Boolean>])|
|
||||||
(itemdownloadrestriction (restrictedforreaders [<Boolean>]) (restrictedforwriters [<Boolean>]))|
|
(itemdownloadrestriction restrictedforreaders|restrictedforwriters [<Boolean>])|
|
||||||
(keeprevisionforever|pinned)|
|
(keeprevisionforever|pinned)|
|
||||||
(lastviewedbyme <Time>)|
|
(lastviewedbyme <Time>)|
|
||||||
(mimetype <MimeType>)|
|
(mimetype <MimeType>)|
|
||||||
@@ -8703,3 +8703,11 @@ gam <UserTypeEntity> print youtubechannels [todrive <ToDriveAttribute>*]
|
|||||||
gam create|add verify|verification <DomainName>
|
gam create|add verify|verification <DomainName>
|
||||||
gam update verify|verification <DomainName> cname|txt|text|site|file
|
gam update verify|verification <DomainName> cname|txt|text|site|file
|
||||||
gam info verify|verification
|
gam info verify|verification
|
||||||
|
|
||||||
|
# Web Resourses and Sites
|
||||||
|
|
||||||
|
gam <UserTypeEntity> show webresources
|
||||||
|
gam <UserTypeEntity> print webresources [todrive <ToDriveAttribute>*]
|
||||||
|
gam <UserTypeEntity> show webmastersites
|
||||||
|
gam <UserTypeEntity> print webmastersites [todrive <ToDriveAttribute>*]
|
||||||
|
```
|
||||||
|
|||||||
@@ -1,5 +1,35 @@
|
|||||||
|
7.17.03
|
||||||
|
|
||||||
|
Fixed bug in gam <UserItem> print|show chatspaces asadmin fields <ChatSpaceFieldNameList>` that caused a trap
|
||||||
|
when `isplayname` was not in `<ChatSpaceFieldNameList>`.
|
||||||
|
|
||||||
|
7.17.02
|
||||||
|
|
||||||
|
Updated `gam <UserTypeEntity> print|show webmastersites` to handle the following error
|
||||||
|
that occurs if you haven't updated your project to include the Google Search Console API.
|
||||||
|
```
|
||||||
|
ERROR: 403: permissionDenied - Google Search Console API has not been used in project 111055363999 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/searchconsole.googleapis.com/overview?project=111055363999 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.
|
||||||
|
```
|
||||||
|
|
||||||
|
7.17.01
|
||||||
|
|
||||||
|
Fixed bug in `gam <UserTypeEntity> show webmastersites` that caused a trap.
|
||||||
|
|
||||||
|
7.17.00
|
||||||
|
|
||||||
|
Added commands to discover Sites and WebResources that managed users (previously unmanaged) may have access to for better governance and visibility.
|
||||||
|
These are special purpose commands and will not generally be used.
|
||||||
|
```
|
||||||
|
gam <UserTypeEntity> show webresources
|
||||||
|
gam <UserTypeEntity> print webresources [todrive <ToDriveAttribute>*]
|
||||||
|
gam <UserTypeEntity> show webmastersites
|
||||||
|
gam <UserTypeEntity> print webmastersites [todrive <ToDriveAttribute>*]
|
||||||
|
```
|
||||||
|
|
||||||
7.16.01
|
7.16.01
|
||||||
|
|
||||||
|
The Drive API now supports setting download restrictions on individual files.
|
||||||
|
|
||||||
Added `downloadrestictions` and `<DriveDownloadRestrictionsSubfieldName>` to `<DriveFieldName>`.
|
Added `downloadrestictions` and `<DriveDownloadRestrictionsSubfieldName>` to `<DriveFieldName>`.
|
||||||
```
|
```
|
||||||
<DriveDownloadRestrictionsSubfieldName> ::=
|
<DriveDownloadRestrictionsSubfieldName> ::=
|
||||||
@@ -7,7 +37,7 @@ Added `downloadrestictions` and `<DriveDownloadRestrictionsSubfieldName>` to `<D
|
|||||||
downloadrestrictions.effectivedownloadrestrictionwithcontext
|
downloadrestrictions.effectivedownloadrestrictionwithcontext
|
||||||
```
|
```
|
||||||
|
|
||||||
Added `itemdownloadrestriction (restrictedforreaders [<Boolean>]) (restrictedforwriters [<Boolean>])`
|
Added `itemdownloadrestriction restrictedforreaders|restrictedforwriters [<Boolean>]`
|
||||||
to `<DriveFileAttribute>`.
|
to `<DriveFileAttribute>`.
|
||||||
|
|
||||||
From the Drive API documentation:
|
From the Drive API documentation:
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ https://github.com/GAM-team/GAM/wiki
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
__author__ = 'GAM Team <google-apps-manager@googlegroups.com>'
|
__author__ = 'GAM Team <google-apps-manager@googlegroups.com>'
|
||||||
__version__ = '7.16.01'
|
__version__ = '7.17.03'
|
||||||
__license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
|
__license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
|
||||||
|
|
||||||
#pylint: disable=wrong-import-position
|
#pylint: disable=wrong-import-position
|
||||||
@@ -5688,19 +5688,22 @@ def getUserEmailFromID(uid, cd):
|
|||||||
try:
|
try:
|
||||||
result = callGAPI(cd.users(), 'get',
|
result = callGAPI(cd.users(), 'get',
|
||||||
throwReasons=GAPI.USER_GET_THROW_REASONS,
|
throwReasons=GAPI.USER_GET_THROW_REASONS,
|
||||||
|
retryReasons=GAPI.SERVICE_NOT_AVAILABLE_RETRY_REASONS,
|
||||||
userKey=uid, fields='primaryEmail')
|
userKey=uid, fields='primaryEmail')
|
||||||
return result.get('primaryEmail')
|
return result.get('primaryEmail')
|
||||||
except (GAPI.userNotFound, GAPI.domainNotFound, GAPI.domainCannotUseApis, GAPI.forbidden,
|
except (GAPI.userNotFound, GAPI.domainNotFound, GAPI.domainCannotUseApis, GAPI.forbidden,
|
||||||
GAPI.badRequest, GAPI.backendError, GAPI.systemError):
|
GAPI.badRequest, GAPI.backendError, GAPI.systemError, GAPI.serviceNotAvailable):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def getGroupEmailFromID(uid, cd):
|
def getGroupEmailFromID(uid, cd):
|
||||||
try:
|
try:
|
||||||
result = callGAPI(cd.groups(), 'get',
|
result = callGAPI(cd.groups(), 'get',
|
||||||
throwReasons=GAPI.GROUP_GET_THROW_REASONS,
|
throwReasons=GAPI.GROUP_GET_THROW_REASONS,
|
||||||
|
retryReasons=GAPI.SERVICE_NOT_AVAILABLE_RETRY_REASONS,
|
||||||
groupKey=uid, fields='email')
|
groupKey=uid, fields='email')
|
||||||
return result.get('email')
|
return result.get('email')
|
||||||
except (GAPI.groupNotFound, GAPI.domainNotFound, GAPI.domainCannotUseApis, GAPI.forbidden, GAPI.badRequest):
|
except (GAPI.groupNotFound, GAPI.domainNotFound, GAPI.domainCannotUseApis, GAPI.forbidden,
|
||||||
|
GAPI.badRequest, GAPI.serviceNotAvailable):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def getServiceAccountEmailFromID(account_id, sal=None):
|
def getServiceAccountEmailFromID(account_id, sal=None):
|
||||||
@@ -26937,7 +26940,7 @@ def printShowChatSpaces(users):
|
|||||||
substituteQueryTimes(queries, queryTimes)
|
substituteQueryTimes(queries, queryTimes)
|
||||||
pfilter = kwargsCS['query'] = queries[0]
|
pfilter = kwargsCS['query'] = queries[0]
|
||||||
kwargsCS['useAdminAccess'] = True
|
kwargsCS['useAdminAccess'] = True
|
||||||
sortName = 'displayName'
|
sortName = 'displayName' if 'displayName' in fieldsList else 'name'
|
||||||
else:
|
else:
|
||||||
sortName = 'name'
|
sortName = 'name'
|
||||||
for user in users:
|
for user in users:
|
||||||
@@ -46963,8 +46966,8 @@ def doCreateSiteVerification():
|
|||||||
printKeyValueList(['Meta HTML Header Data', webserver_meta_record['token']])
|
printKeyValueList(['Meta HTML Header Data', webserver_meta_record['token']])
|
||||||
printBlankLine()
|
printBlankLine()
|
||||||
|
|
||||||
def _showSiteVerificationInfo(site):
|
def _showSiteVerificationInfo(site, i=0, count=0):
|
||||||
printKeyValueList(['Site', site['site']['identifier']])
|
printKeyValueListWithCount(['Site', site['site']['identifier']], i, count)
|
||||||
Ind.Increment()
|
Ind.Increment()
|
||||||
printKeyValueList(['ID', unquote(site['id'])])
|
printKeyValueList(['ID', unquote(site['id'])])
|
||||||
printKeyValueList(['Type', site['site']['type']])
|
printKeyValueList(['Type', site['site']['type']])
|
||||||
@@ -47072,11 +47075,87 @@ def doInfoSiteVerification():
|
|||||||
checkForExtraneousArguments()
|
checkForExtraneousArguments()
|
||||||
sites = callGAPIitems(verif.webResource(), 'list', 'items')
|
sites = callGAPIitems(verif.webResource(), 'list', 'items')
|
||||||
if sites:
|
if sites:
|
||||||
|
count = len(sites)
|
||||||
|
i = 0
|
||||||
for site in sorted(sites, key=lambda k: (k['site']['type'], k['site']['identifier'])):
|
for site in sorted(sites, key=lambda k: (k['site']['type'], k['site']['identifier'])):
|
||||||
_showSiteVerificationInfo(site)
|
i += 1
|
||||||
|
_showSiteVerificationInfo(site, i, count)
|
||||||
else:
|
else:
|
||||||
printKeyValueList(['No Sites Verified.'])
|
printKeyValueList(['No Sites Verified.'])
|
||||||
|
|
||||||
|
# gam <UserTypeEntity> show webresources
|
||||||
|
# gam <UserTypeEntity> print webresources [todrive <ToDriveAttribute>*]
|
||||||
|
def printShowWebResources(users):
|
||||||
|
csvPF = CSVPrintFile(['User', 'site.identifier']) if Act.csvFormat() else None
|
||||||
|
while Cmd.ArgumentsRemaining():
|
||||||
|
myarg = getArgument()
|
||||||
|
if csvPF and myarg == 'todrive':
|
||||||
|
csvPF.GetTodriveParameters()
|
||||||
|
else:
|
||||||
|
unknownArgumentExit()
|
||||||
|
i, count, users = getEntityArgument(users)
|
||||||
|
for user in users:
|
||||||
|
i += 1
|
||||||
|
user, verif = buildGAPIServiceObject(API.SITEVERIFICATION, user, i, count)
|
||||||
|
if not verif:
|
||||||
|
continue
|
||||||
|
sites = callGAPIitems(verif.webResource(), 'list', 'items')
|
||||||
|
jcount = len(sites)
|
||||||
|
if not csvPF:
|
||||||
|
entityPerformActionNumItems([Ent.USER, user], jcount, Ent.WEB_RESOURCE, i, count)
|
||||||
|
Ind.Increment()
|
||||||
|
j = 0
|
||||||
|
for site in sorted(sites, key=lambda k: (k['site']['type'], k['site']['identifier'])):
|
||||||
|
j += 1
|
||||||
|
_showSiteVerificationInfo(site, j, jcount)
|
||||||
|
Ind.Decrement()
|
||||||
|
else:
|
||||||
|
for site in sites:
|
||||||
|
row = flattenJSON(site, flattened={'User': user})
|
||||||
|
csvPF.WriteRowTitles(row)
|
||||||
|
if csvPF:
|
||||||
|
csvPF.writeCSVfile('Web Resources')
|
||||||
|
|
||||||
|
# gam <UserTypeEntity> show webmastersites
|
||||||
|
# gam <UserTypeEntity> print webmastersites [todrive <ToDriveAttribute>*]
|
||||||
|
def printShowWebMasterSites(users):
|
||||||
|
csvPF = CSVPrintFile(['User', 'siteUrl']) if Act.csvFormat() else None
|
||||||
|
while Cmd.ArgumentsRemaining():
|
||||||
|
myarg = getArgument()
|
||||||
|
if csvPF and myarg == 'todrive':
|
||||||
|
csvPF.GetTodriveParameters()
|
||||||
|
else:
|
||||||
|
unknownArgumentExit()
|
||||||
|
i, count, users = getEntityArgument(users)
|
||||||
|
for user in users:
|
||||||
|
i += 1
|
||||||
|
user, searchconsole = buildGAPIServiceObject(API.SEARCHCONSOLE, user, i, count)
|
||||||
|
if not searchconsole:
|
||||||
|
continue
|
||||||
|
try:
|
||||||
|
sites = callGAPIitems(searchconsole.sites(), 'list', 'siteEntry',
|
||||||
|
throwReasons=[GAPI.PERMISSION_DENIED])
|
||||||
|
except GAPI.permissionDenied as e:
|
||||||
|
accessErrorExitNonDirectory(API.SEARCHCONSOLE, str(e))
|
||||||
|
jcount = len(sites)
|
||||||
|
if not csvPF:
|
||||||
|
entityPerformActionNumItems([Ent.USER, user], jcount, Ent.WEB_MASTERSITE, i, count)
|
||||||
|
Ind.Increment()
|
||||||
|
j = 0
|
||||||
|
for site in sorted(sites, key=lambda k: k['siteUrl']):
|
||||||
|
j += 1
|
||||||
|
printKeyValueListWithCount(['Site', site['siteUrl']], j, jcount)
|
||||||
|
Ind.Increment()
|
||||||
|
printKeyValueList(['permissionLevel', site['permissionLevel']])
|
||||||
|
Ind.Decrement()
|
||||||
|
Ind.Decrement()
|
||||||
|
else:
|
||||||
|
for site in sites:
|
||||||
|
row = flattenJSON(site, flattened={'User': user})
|
||||||
|
csvPF.WriteRowTitles(row)
|
||||||
|
if csvPF:
|
||||||
|
csvPF.writeCSVfile('Web Master Sites')
|
||||||
|
|
||||||
def checkCourseExists(croom, courseId, i=0, count=0, entityType=Ent.COURSE):
|
def checkCourseExists(croom, courseId, i=0, count=0, entityType=Ent.COURSE):
|
||||||
courseId = addCourseIdScope(courseId)
|
courseId = addCourseIdScope(courseId)
|
||||||
try:
|
try:
|
||||||
@@ -53818,6 +53897,8 @@ DRIVE_FILE_CONTENT_RESTRICTIONS_CHOICE_MAP = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
DRIVE_FILE_ITEM_DOWNLOAD_RESTRICTION_CHOICE_MAP = {
|
DRIVE_FILE_ITEM_DOWNLOAD_RESTRICTION_CHOICE_MAP = {
|
||||||
|
'downloadrestrictedforreaders': 'restrictedForReaders',
|
||||||
|
'downloadrestrictedforwriters': 'restrictedForWriters',
|
||||||
'restrictedforreaders': 'restrictedForReaders',
|
'restrictedforreaders': 'restrictedForReaders',
|
||||||
'restrictedforwriters': 'restrictedForWriters',
|
'restrictedforwriters': 'restrictedForWriters',
|
||||||
}
|
}
|
||||||
@@ -53873,6 +53954,20 @@ def getDriveFileAddRemoveParentAttribute(myarg, parameters):
|
|||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
def _getDriveFileDownloadRestrictions(myarg, body):
|
||||||
|
subField = myarg
|
||||||
|
if subField.startswith('downloadrestrictions.'):
|
||||||
|
_, subField = subField.split('.', 1)
|
||||||
|
if subField.startswith('itemdownloadrestriction.'):
|
||||||
|
_, subField = subField.split('.', 1)
|
||||||
|
if subField == 'itemdownloadrestriction':
|
||||||
|
subField = getChoice(DRIVE_FILE_ITEM_DOWNLOAD_RESTRICTION_CHOICE_MAP)
|
||||||
|
if subField in DRIVE_FILE_ITEM_DOWNLOAD_RESTRICTION_CHOICE_MAP:
|
||||||
|
body.setdefault('downloadRestrictions', {'itemDownloadRestriction': {}})
|
||||||
|
body['downloadRestrictions']['itemDownloadRestriction'][DRIVE_FILE_ITEM_DOWNLOAD_RESTRICTION_CHOICE_MAP[subField]] = getBoolean()
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
def getDriveFileCopyAttribute(myarg, body, parameters):
|
def getDriveFileCopyAttribute(myarg, body, parameters):
|
||||||
if myarg == 'ignoredefaultvisibility':
|
if myarg == 'ignoredefaultvisibility':
|
||||||
parameters[DFA_IGNORE_DEFAULT_VISIBILITY] = getBoolean()
|
parameters[DFA_IGNORE_DEFAULT_VISIBILITY] = getBoolean()
|
||||||
@@ -53908,10 +54003,8 @@ def getDriveFileCopyAttribute(myarg, body, parameters):
|
|||||||
else:
|
else:
|
||||||
Cmd.Backup()
|
Cmd.Backup()
|
||||||
usageErrorExit(Msg.REASON_ONLY_VALID_WITH_CONTENTRESTRICTIONS_READONLY_TRUE)
|
usageErrorExit(Msg.REASON_ONLY_VALID_WITH_CONTENTRESTRICTIONS_READONLY_TRUE)
|
||||||
elif myarg == 'itemdownloadrestriction':
|
elif _getDriveFileDownloadRestrictions(myarg, body):
|
||||||
body.setdefault('downloadRestrictions', {'itemDownloadRestriction': {}})
|
pass
|
||||||
restriction = getChoice(DRIVE_FILE_ITEM_DOWNLOAD_RESTRICTION_CHOICE_MAP, mapChoice=True)
|
|
||||||
body['downloadRestrictions']['itemDownloadRestriction'][restriction] = getBoolean()
|
|
||||||
elif myarg == 'inheritedpermissionsdisabled':
|
elif myarg == 'inheritedpermissionsdisabled':
|
||||||
body['inheritedPermissionsDisabled'] = getBoolean()
|
body['inheritedPermissionsDisabled'] = getBoolean()
|
||||||
elif myarg == 'property':
|
elif myarg == 'property':
|
||||||
@@ -78284,6 +78377,8 @@ USER_COMMANDS_WITH_OBJECTS = {
|
|||||||
Cmd.ARG_USERLIST: doPrintUserList,
|
Cmd.ARG_USERLIST: doPrintUserList,
|
||||||
Cmd.ARG_VACATION: printShowVacation,
|
Cmd.ARG_VACATION: printShowVacation,
|
||||||
Cmd.ARG_VAULTHOLD: printShowUserVaultHolds,
|
Cmd.ARG_VAULTHOLD: printShowUserVaultHolds,
|
||||||
|
Cmd.ARG_WEBMASTERSITE: printShowWebMasterSites,
|
||||||
|
Cmd.ARG_WEBRESOURCE: printShowWebResources,
|
||||||
Cmd.ARG_WORKINGLOCATION: printShowWorkingLocation,
|
Cmd.ARG_WORKINGLOCATION: printShowWorkingLocation,
|
||||||
Cmd.ARG_YOUTUBECHANNEL: printShowYouTubeChannel,
|
Cmd.ARG_YOUTUBECHANNEL: printShowYouTubeChannel,
|
||||||
}
|
}
|
||||||
@@ -78394,6 +78489,8 @@ USER_COMMANDS_WITH_OBJECTS = {
|
|||||||
Cmd.ARG_TOKEN: printShowTokens,
|
Cmd.ARG_TOKEN: printShowTokens,
|
||||||
Cmd.ARG_VAULTHOLD: printShowUserVaultHolds,
|
Cmd.ARG_VAULTHOLD: printShowUserVaultHolds,
|
||||||
Cmd.ARG_VACATION: printShowVacation,
|
Cmd.ARG_VACATION: printShowVacation,
|
||||||
|
Cmd.ARG_WEBMASTERSITE: printShowWebMasterSites,
|
||||||
|
Cmd.ARG_WEBRESOURCE: printShowWebResources,
|
||||||
Cmd.ARG_WORKINGLOCATION: printShowWorkingLocation,
|
Cmd.ARG_WORKINGLOCATION: printShowWorkingLocation,
|
||||||
Cmd.ARG_YOUTUBECHANNEL: printShowYouTubeChannel,
|
Cmd.ARG_YOUTUBECHANNEL: printShowYouTubeChannel,
|
||||||
}
|
}
|
||||||
@@ -78645,6 +78742,8 @@ USER_COMMANDS_OBJ_ALIASES = {
|
|||||||
Cmd.ARG_USERS: Cmd.ARG_USER,
|
Cmd.ARG_USERS: Cmd.ARG_USER,
|
||||||
Cmd.ARG_VAULTHOLDS: Cmd.ARG_VAULTHOLD,
|
Cmd.ARG_VAULTHOLDS: Cmd.ARG_VAULTHOLD,
|
||||||
Cmd.ARG_VERIFICATIONCODES: Cmd.ARG_BACKUPCODE,
|
Cmd.ARG_VERIFICATIONCODES: Cmd.ARG_BACKUPCODE,
|
||||||
|
Cmd.ARG_WEBMASTERSITES: Cmd.ARG_WEBMASTERSITE,
|
||||||
|
Cmd.ARG_WEBRESOURCES: Cmd.ARG_WEBRESOURCE,
|
||||||
Cmd.ARG_WORKINGLOCATIONS: Cmd.ARG_WORKINGLOCATION,
|
Cmd.ARG_WORKINGLOCATIONS: Cmd.ARG_WORKINGLOCATION,
|
||||||
Cmd.ARG_YOUTUBECHANNELS: Cmd.ARG_YOUTUBECHANNEL,
|
Cmd.ARG_YOUTUBECHANNELS: Cmd.ARG_YOUTUBECHANNEL,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -85,6 +85,7 @@ PRINTERS = 'printers'
|
|||||||
PUBSUB = 'pubsub'
|
PUBSUB = 'pubsub'
|
||||||
REPORTS = 'reports'
|
REPORTS = 'reports'
|
||||||
RESELLER = 'reseller'
|
RESELLER = 'reseller'
|
||||||
|
SEARCHCONSOLE = 'searchconsole'
|
||||||
SERVICEACCOUNTLOOKUP = 'serviceaccountlookup'
|
SERVICEACCOUNTLOOKUP = 'serviceaccountlookup'
|
||||||
SERVICEMANAGEMENT = 'servicemanagement'
|
SERVICEMANAGEMENT = 'servicemanagement'
|
||||||
SERVICEUSAGE = 'serviceusage'
|
SERVICEUSAGE = 'serviceusage'
|
||||||
@@ -198,6 +199,7 @@ PROJECT_APIS = [
|
|||||||
'people.googleapis.com',
|
'people.googleapis.com',
|
||||||
'pubsub.googleapis.com',
|
'pubsub.googleapis.com',
|
||||||
'reseller.googleapis.com',
|
'reseller.googleapis.com',
|
||||||
|
'searchconsole.googleapis.com',
|
||||||
'sheets.googleapis.com',
|
'sheets.googleapis.com',
|
||||||
'siteverification.googleapis.com',
|
'siteverification.googleapis.com',
|
||||||
'storage-api.googleapis.com',
|
'storage-api.googleapis.com',
|
||||||
@@ -271,6 +273,7 @@ _INFO = {
|
|||||||
PUBSUB: {'name': 'Pub / Sub API', 'version': 'v1', 'v2discovery': True},
|
PUBSUB: {'name': 'Pub / Sub API', 'version': 'v1', 'v2discovery': True},
|
||||||
REPORTS: {'name': 'Reports API', 'version': 'reports_v1', 'v2discovery': True, 'mappedAPI': 'admin'},
|
REPORTS: {'name': 'Reports API', 'version': 'reports_v1', 'v2discovery': True, 'mappedAPI': 'admin'},
|
||||||
RESELLER: {'name': 'Reseller API', 'version': 'v1', 'v2discovery': True},
|
RESELLER: {'name': 'Reseller API', 'version': 'v1', 'v2discovery': True},
|
||||||
|
SEARCHCONSOLE: {'name': 'Search Console API', 'version': 'v1', 'v2discovery': True},
|
||||||
SERVICEACCOUNTLOOKUP: {'name': 'Service Account Lookup pseudo-API', 'version': 'v1', 'v2discovery': True, 'localjson': True},
|
SERVICEACCOUNTLOOKUP: {'name': 'Service Account Lookup pseudo-API', 'version': 'v1', 'v2discovery': True, 'localjson': True},
|
||||||
SERVICEMANAGEMENT: {'name': 'Service Management API', 'version': 'v1', 'v2discovery': True},
|
SERVICEMANAGEMENT: {'name': 'Service Management API', 'version': 'v1', 'v2discovery': True},
|
||||||
SERVICEUSAGE: {'name': 'Service Usage API', 'version': 'v1', 'v2discovery': True},
|
SERVICEUSAGE: {'name': 'Service Usage API', 'version': 'v1', 'v2discovery': True},
|
||||||
@@ -697,10 +700,20 @@ _SVCACCT_SCOPES = [
|
|||||||
'api': PEOPLE_OTHERCONTACTS,
|
'api': PEOPLE_OTHERCONTACTS,
|
||||||
'subscopes': [],
|
'subscopes': [],
|
||||||
'scope': 'https://www.googleapis.com/auth/contacts.other.readonly'},
|
'scope': 'https://www.googleapis.com/auth/contacts.other.readonly'},
|
||||||
|
{'name': 'Search Console API - read only',
|
||||||
|
'api': SEARCHCONSOLE,
|
||||||
|
'subscopes': [],
|
||||||
|
'offByDefault': True,
|
||||||
|
'scope': 'https://www.googleapis.com/auth/webmasters.readonly'},
|
||||||
{'name': 'Sheets API',
|
{'name': 'Sheets API',
|
||||||
'api': SHEETS,
|
'api': SHEETS,
|
||||||
'subscopes': READONLY,
|
'subscopes': READONLY,
|
||||||
'scope': 'https://www.googleapis.com/auth/spreadsheets'},
|
'scope': 'https://www.googleapis.com/auth/spreadsheets'},
|
||||||
|
{'name': 'Site Verification API',
|
||||||
|
'api': SITEVERIFICATION,
|
||||||
|
'subscopes': [],
|
||||||
|
'offByDefault': True,
|
||||||
|
'scope': 'https://www.googleapis.com/auth/siteverification'},
|
||||||
{'name': 'Tag Manager API - Accounts, Containers, Workspaces, Tags - read only',
|
{'name': 'Tag Manager API - Accounts, Containers, Workspaces, Tags - read only',
|
||||||
'api': TAGMANAGER,
|
'api': TAGMANAGER,
|
||||||
'subscopes': [],
|
'subscopes': [],
|
||||||
|
|||||||
@@ -830,6 +830,10 @@ class GamCLArgs():
|
|||||||
ARG_VERIFICATION = 'verification'
|
ARG_VERIFICATION = 'verification'
|
||||||
ARG_VERIFICATIONCODES = 'verificationcodes'
|
ARG_VERIFICATIONCODES = 'verificationcodes'
|
||||||
ARG_VERIFY = 'verify'
|
ARG_VERIFY = 'verify'
|
||||||
|
ARG_WEBMASTERSITE = 'webmastersite'
|
||||||
|
ARG_WEBMASTERSITES = 'webmastersites'
|
||||||
|
ARG_WEBRESOURCE = 'webresource'
|
||||||
|
ARG_WEBRESOURCES = 'webresources'
|
||||||
ARG_WORKINGLOCATION = 'workinglocation'
|
ARG_WORKINGLOCATION = 'workinglocation'
|
||||||
ARG_WORKINGLOCATIONS = 'workinglocations'
|
ARG_WORKINGLOCATIONS = 'workinglocations'
|
||||||
ARG_YOUTUBECHANNEL = 'youtubechannel'
|
ARG_YOUTUBECHANNEL = 'youtubechannel'
|
||||||
|
|||||||
@@ -394,6 +394,8 @@ class GamEntity():
|
|||||||
VAULT_MATTER_ID = 'vlmi'
|
VAULT_MATTER_ID = 'vlmi'
|
||||||
VAULT_OPERATION = 'vlto'
|
VAULT_OPERATION = 'vlto'
|
||||||
VAULT_QUERY = 'vltq'
|
VAULT_QUERY = 'vltq'
|
||||||
|
WEB_MASTERSITE = 'wems'
|
||||||
|
WEB_RESOURCE = 'were'
|
||||||
WEBCLIPS_ENABLED = 'webc'
|
WEBCLIPS_ENABLED = 'webc'
|
||||||
YOUTUBE_CHANNEL = 'ytch'
|
YOUTUBE_CHANNEL = 'ytch'
|
||||||
# _NAMES[0] is plural, _NAMES[1] is singular unless the item name is explicitly plural (Calendar Settings)
|
# _NAMES[0] is plural, _NAMES[1] is singular unless the item name is explicitly plural (Calendar Settings)
|
||||||
@@ -752,6 +754,8 @@ class GamEntity():
|
|||||||
VAULT_OPERATION: ['Vault Operations', 'Vault Operation'],
|
VAULT_OPERATION: ['Vault Operations', 'Vault Operation'],
|
||||||
VAULT_QUERY: ['Vault Queries', 'Vault Query'],
|
VAULT_QUERY: ['Vault Queries', 'Vault Query'],
|
||||||
WEBCLIPS_ENABLED: ['Web Clips Enabled', 'Web Clips Enabled'],
|
WEBCLIPS_ENABLED: ['Web Clips Enabled', 'Web Clips Enabled'],
|
||||||
|
WEB_MASTERSITE: ['Web Master Sites', 'Web Master Site'],
|
||||||
|
WEB_RESOURCE: ['Web Resources', 'Web Resource'],
|
||||||
YOUTUBE_CHANNEL: ['YouTube Channels', 'YouTube Channel'],
|
YOUTUBE_CHANNEL: ['YouTube Channels', 'YouTube Channel'],
|
||||||
ROLE_MANAGER: ['Managers', 'Manager'],
|
ROLE_MANAGER: ['Managers', 'Manager'],
|
||||||
ROLE_MEMBER: ['Members', 'Member'],
|
ROLE_MEMBER: ['Members', 'Member'],
|
||||||
|
|||||||
@@ -10,6 +10,51 @@ Add the `-s` option to the end of the above commands to suppress creating the `g
|
|||||||
|
|
||||||
See [Downloads-Installs-GAM7](https://github.com/GAM-team/GAM/wiki/Downloads-Installs) for Windows or other options, including manual installation
|
See [Downloads-Installs-GAM7](https://github.com/GAM-team/GAM/wiki/Downloads-Installs) for Windows or other options, including manual installation
|
||||||
|
|
||||||
|
### 7.17.02
|
||||||
|
|
||||||
|
Updated `gam <UserTypeEntity> print|show webmastersites` to handle the following error
|
||||||
|
that occurs if you haven't updated your project to include the Google Search Console API.
|
||||||
|
```
|
||||||
|
ERROR: 403: permissionDenied - Google Search Console API has not been used in project 111055363999 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/searchconsole.googleapis.com/overview?project=111055363999 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.
|
||||||
|
```
|
||||||
|
|
||||||
|
### 7.17.01
|
||||||
|
|
||||||
|
Fixed bug in `gam <UserTypeEntity> show webmastersites` that caused a trap.
|
||||||
|
|
||||||
|
### 7.17.00
|
||||||
|
|
||||||
|
Added commands to discover Sites and WebResources that managed users (previously unmanaged) may have access to for better governance and visibility.
|
||||||
|
These are special purpose commands and will not generally be used.
|
||||||
|
```
|
||||||
|
gam <UserTypeEntity> show webresources
|
||||||
|
gam <UserTypeEntity> print webresources [todrive <ToDriveAttribute>*]
|
||||||
|
gam <UserTypeEntity> show webmastersites
|
||||||
|
gam <UserTypeEntity> print webmastersites [todrive <ToDriveAttribute>*]
|
||||||
|
```
|
||||||
|
|
||||||
|
### 7.16.01
|
||||||
|
|
||||||
|
The Drive API now supports setting download restrictions on individual files.
|
||||||
|
|
||||||
|
Added `downloadrestictions` and `<DriveDownloadRestrictionsSubfieldName>` to `<DriveFieldName>`.
|
||||||
|
```
|
||||||
|
<DriveDownloadRestrictionsSubfieldName> ::=
|
||||||
|
downloadrestrictions.itemdownloadrestriction|
|
||||||
|
downloadrestrictions.effectivedownloadrestrictionwithcontext
|
||||||
|
```
|
||||||
|
|
||||||
|
Added `itemdownloadrestriction (restrictedforreaders [<Boolean>]) (restrictedforwriters [<Boolean>])`
|
||||||
|
to `<DriveFileAttribute>`.
|
||||||
|
|
||||||
|
From the Drive API documentation:
|
||||||
|
```
|
||||||
|
itemDownloadRestriction - The download restriction of the file applied directly by the owner or organizer. This does not take into account shared drive settings or DLP rules.
|
||||||
|
effectiveDownloadRestrictionWithContext - Output only. The effective download restriction applied to this file. This considers all restriction settings and DLP rules.
|
||||||
|
restrictedForReaders - Whether download and copy is restricted for readers.
|
||||||
|
restrictedForWriters - Whether download and copy is restricted for writers. If true, download is also restricted for readers.
|
||||||
|
```
|
||||||
|
|
||||||
### 7.16.00
|
### 7.16.00
|
||||||
|
|
||||||
Removed `drive_v3_native_names` from `gam.cfg`; GAM now only uses Drive API v3 fields names on output.
|
Removed `drive_v3_native_names` from `gam.cfg`; GAM now only uses Drive API v3 fields names on output.
|
||||||
|
|||||||
@@ -252,7 +252,7 @@ writes the credentials into the file oauth2.txt.
|
|||||||
admin@server:/Users/admin$ rm -f /Users/admin/GAMConfig/oauth2.txt
|
admin@server:/Users/admin$ rm -f /Users/admin/GAMConfig/oauth2.txt
|
||||||
admin@server:/Users/admin$ gam version
|
admin@server:/Users/admin$ gam version
|
||||||
WARNING: Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: /Users/admin/GAMConfig/oauth2.txt, Not Found
|
WARNING: Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: /Users/admin/GAMConfig/oauth2.txt, Not Found
|
||||||
GAM 7.16.00 - https://github.com/GAM-team/GAM - pyinstaller
|
GAM 7.17.02 - https://github.com/GAM-team/GAM - pyinstaller
|
||||||
GAM Team <google-apps-manager@googlegroups.com>
|
GAM Team <google-apps-manager@googlegroups.com>
|
||||||
Python 3.13.5 64-bit final
|
Python 3.13.5 64-bit final
|
||||||
MacOS Sequoia 15.5 x86_64
|
MacOS Sequoia 15.5 x86_64
|
||||||
@@ -990,7 +990,7 @@ writes the credentials into the file oauth2.txt.
|
|||||||
C:\>del C:\GAMConfig\oauth2.txt
|
C:\>del C:\GAMConfig\oauth2.txt
|
||||||
C:\>gam version
|
C:\>gam version
|
||||||
WARNING: Config File: C:\GAMConfig\gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: C:\GAMConfig\oauth2.txt, Not Found
|
WARNING: Config File: C:\GAMConfig\gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: C:\GAMConfig\oauth2.txt, Not Found
|
||||||
GAM 7.16.00 - https://github.com/GAM-team/GAM - pythonsource
|
GAM 7.17.02 - https://github.com/GAM-team/GAM - pythonsource
|
||||||
GAM Team <google-apps-manager@googlegroups.com>
|
GAM Team <google-apps-manager@googlegroups.com>
|
||||||
Python 3.13.5 64-bit final
|
Python 3.13.5 64-bit final
|
||||||
Windows-10-10.0.17134 AMD64
|
Windows-10-10.0.17134 AMD64
|
||||||
|
|||||||
@@ -157,12 +157,16 @@
|
|||||||
contentrestrictions.restrictiontime|
|
contentrestrictions.restrictiontime|
|
||||||
contentrestrictions.type
|
contentrestrictions.type
|
||||||
|
|
||||||
<DriveLabelInfoSubfieldName> ::=
|
<DriveDownloadRestrictionsSubfieldName> ::=
|
||||||
|
downloadrestrictions.itemdownloadrestriction|
|
||||||
|
downloadrestrictions.effectivedownloadrestrictionwithcontext
|
||||||
|
|
||||||
|
<ClassificationLabelInfoSubfieldName> ::=
|
||||||
labels.id| # modifiedByMe
|
labels.id| # modifiedByMe
|
||||||
labels.revisionid| # copyRequiresWriterPermission
|
labels.revisionid| # copyRequiresWriterPermission
|
||||||
labels.fields # viewedByMe
|
labels.fields # viewedByMe
|
||||||
|
|
||||||
<DriveLabelsSubfieldName> ::=
|
<ClassificationLabelsSubfieldName~> ::=
|
||||||
labels.modified| # modifiedByMe
|
labels.modified| # modifiedByMe
|
||||||
labels.restricted| # copyRequiresWriterPermission
|
labels.restricted| # copyRequiresWriterPermission
|
||||||
labels.starred| # starred
|
labels.starred| # starred
|
||||||
@@ -251,6 +255,8 @@
|
|||||||
copyrequireswriterpermission|
|
copyrequireswriterpermission|
|
||||||
createddate|createdtime|
|
createddate|createdtime|
|
||||||
description|
|
description|
|
||||||
|
downloadrestictions|
|
||||||
|
<DriveDownloadRestrictionsSubfieldName>|
|
||||||
driveid|
|
driveid|
|
||||||
drivename|
|
drivename|
|
||||||
editable|
|
editable|
|
||||||
@@ -269,9 +275,9 @@
|
|||||||
inheritedpermissionsdisabled|
|
inheritedpermissionsdisabled|
|
||||||
isappauthorized|
|
isappauthorized|
|
||||||
labelinfo|
|
labelinfo|
|
||||||
<DriveLabelInfoSubfieldName>|
|
<ClassificationLabelInfoSubfieldName>|
|
||||||
labels|
|
labels|
|
||||||
<DriveLabelsSubfieldName>|
|
<ClassificationLabelsSubfieldName>|
|
||||||
lastmodifyinguser|
|
lastmodifyinguser|
|
||||||
<DriveLastModifyingUserSubfieldName>|
|
<DriveLastModifyingUserSubfieldName>|
|
||||||
lastmodifyingusername|
|
lastmodifyingusername|
|
||||||
|
|||||||
@@ -125,6 +125,7 @@
|
|||||||
(folderColorRgb <ColorValue>)|
|
(folderColorRgb <ColorValue>)|
|
||||||
(indexabletext <String>)|
|
(indexabletext <String>)|
|
||||||
(inheritedpermissionsdisabled [<Boolean>])|
|
(inheritedpermissionsdisabled [<Boolean>])|
|
||||||
|
(itemdownloadrestriction restrictedforreaders|restrictedforwriters [<Boolean>])|
|
||||||
(keeprevisionforever|pinned)|
|
(keeprevisionforever|pinned)|
|
||||||
(lastviewedbyme <Time>)|
|
(lastviewedbyme <Time>)|
|
||||||
(mimetype <MimeType>)|
|
(mimetype <MimeType>)|
|
||||||
|
|||||||
48
wiki/Users-Web-Resources-and-Sites.md
Normal file
48
wiki/Users-Web-Resources-and-Sites.md
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
# Users - Web Resources and Sites
|
||||||
|
- [API documentation](#api-documentation)
|
||||||
|
- [Introduction](#introduction)
|
||||||
|
- [Definitions](#definitions)
|
||||||
|
- [Display Web Resources](#display-web-resources)
|
||||||
|
- [Display Web Sites](#display-web-sites)
|
||||||
|
|
||||||
|
## API documentation
|
||||||
|
* [Web Resources](https://developers.google.com/site-verification/v1/webResource/list)
|
||||||
|
* [Web Sites](https://developers.google.com/webmaster-tools/v1/sites/list)
|
||||||
|
|
||||||
|
|
||||||
|
## Introduction
|
||||||
|
These features were added in version 7.17.00.
|
||||||
|
|
||||||
|
To use these commands you add the 'Search Console API' to your project and update your service account authorization.
|
||||||
|
```
|
||||||
|
gam update project
|
||||||
|
gam user user@domain.com update serviceaccount
|
||||||
|
...
|
||||||
|
[*] 39) Search Console API - read only
|
||||||
|
[*] 42) Site Verification API
|
||||||
|
|
||||||
|
```
|
||||||
|
## Definitions
|
||||||
|
* [`<UserTypeEntity>`](Collections-of-Users)
|
||||||
|
|
||||||
|
## Display Web Resources
|
||||||
|
```
|
||||||
|
gam <UserItem> show webresources
|
||||||
|
```
|
||||||
|
Gam displays the information as an indented list of keys and values.
|
||||||
|
|
||||||
|
```
|
||||||
|
gam <UserItem> print webresources [todrive <ToDriveAttribute>*]
|
||||||
|
```
|
||||||
|
Gam displays the information as columns of fields.
|
||||||
|
|
||||||
|
## Display Web Sites
|
||||||
|
```
|
||||||
|
gam <UserItem> show websites
|
||||||
|
```
|
||||||
|
Gam displays the information as an indented list of keys and values.
|
||||||
|
|
||||||
|
```
|
||||||
|
gam <UserItem> print websites [todrive <ToDriveAttribute>*]
|
||||||
|
```
|
||||||
|
Gam displays the information as columns of fields.
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
Print the current version of Gam with details
|
Print the current version of Gam with details
|
||||||
```
|
```
|
||||||
gam version
|
gam version
|
||||||
GAM 7.16.00 - https://github.com/GAM-team/GAM - pyinstaller
|
GAM 7.17.02 - https://github.com/GAM-team/GAM - pyinstaller
|
||||||
GAM Team <google-apps-manager@googlegroups.com>
|
GAM Team <google-apps-manager@googlegroups.com>
|
||||||
Python 3.13.5 64-bit final
|
Python 3.13.5 64-bit final
|
||||||
MacOS Sequoia 15.5 x86_64
|
MacOS Sequoia 15.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
|
Print the current version of Gam with details and time offset information
|
||||||
```
|
```
|
||||||
gam version timeoffset
|
gam version timeoffset
|
||||||
GAM 7.16.00 - https://github.com/GAM-team/GAM - pyinstaller
|
GAM 7.17.02 - https://github.com/GAM-team/GAM - pyinstaller
|
||||||
GAM Team <google-apps-manager@googlegroups.com>
|
GAM Team <google-apps-manager@googlegroups.com>
|
||||||
Python 3.13.5 64-bit final
|
Python 3.13.5 64-bit final
|
||||||
MacOS Sequoia 15.5 x86_64
|
MacOS Sequoia 15.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
|
Print the current version of Gam with extended details and SSL information
|
||||||
```
|
```
|
||||||
gam version extended
|
gam version extended
|
||||||
GAM 7.16.00 - https://github.com/GAM-team/GAM - pyinstaller
|
GAM 7.17.02 - https://github.com/GAM-team/GAM - pyinstaller
|
||||||
GAM Team <google-apps-manager@googlegroups.com>
|
GAM Team <google-apps-manager@googlegroups.com>
|
||||||
Python 3.13.5 64-bit final
|
Python 3.13.5 64-bit final
|
||||||
MacOS Sequoia 15.5 x86_64
|
MacOS Sequoia 15.5 x86_64
|
||||||
@@ -64,7 +64,7 @@ MacOS High Sierra 10.13.6 x86_64
|
|||||||
Path: /Users/Admin/bin/gam7
|
Path: /Users/Admin/bin/gam7
|
||||||
Version Check:
|
Version Check:
|
||||||
Current: 5.35.08
|
Current: 5.35.08
|
||||||
Latest: 7.16.00
|
Latest: 7.17.02
|
||||||
echo $?
|
echo $?
|
||||||
1
|
1
|
||||||
```
|
```
|
||||||
@@ -72,7 +72,7 @@ echo $?
|
|||||||
Print the current version number without details
|
Print the current version number without details
|
||||||
```
|
```
|
||||||
gam version simple
|
gam version simple
|
||||||
7.16.00
|
7.17.02
|
||||||
```
|
```
|
||||||
In Linux/MacOS you can do:
|
In Linux/MacOS you can do:
|
||||||
```
|
```
|
||||||
@@ -82,7 +82,7 @@ echo $VER
|
|||||||
Print the current version of Gam and address of this Wiki
|
Print the current version of Gam and address of this Wiki
|
||||||
```
|
```
|
||||||
gam help
|
gam help
|
||||||
GAM 7.16.00 - https://github.com/GAM-team/GAM
|
GAM 7.17.02 - https://github.com/GAM-team/GAM
|
||||||
GAM Team <google-apps-manager@googlegroups.com>
|
GAM Team <google-apps-manager@googlegroups.com>
|
||||||
Python 3.13.5 64-bit final
|
Python 3.13.5 64-bit final
|
||||||
MacOS Sequoia 15.5 x86_64
|
MacOS Sequoia 15.5 x86_64
|
||||||
|
|||||||
@@ -174,6 +174,7 @@ Service Account Access
|
|||||||
* [Users - Tag Manager](Users-Tag-Manager)
|
* [Users - Tag Manager](Users-Tag-Manager)
|
||||||
* [Users - Tasks](Users-Tasks)
|
* [Users - Tasks](Users-Tasks)
|
||||||
* [Users - YouTube](Users-YouTube)
|
* [Users - YouTube](Users-YouTube)
|
||||||
|
* [Users - Web Resources and Sites](Users-Web-Resources-and-Sites)
|
||||||
|
|
||||||
GAM Tutorials
|
GAM Tutorials
|
||||||
* [Account Auditing](l-ExamplesAccountAuditing)
|
* [Account Auditing](l-ExamplesAccountAuditing)
|
||||||
|
|||||||
Reference in New Issue
Block a user