Compare commits

...

6 Commits

Author SHA1 Message Date
Ross Scroggs
e95fcbaa38 Deleted commands to display Analytic UA properties; the API has been deprecated.
Some checks failed
Build and test GAM / build (build, 1, Build Intel Ubuntu Jammy, ubuntu-22.04) (push) Has been cancelled
Build and test GAM / build (build, 10, Build Intel Windows, windows-2022) (push) Has been cancelled
Build and test GAM / build (build, 11, Build Arm Windows, windows-11-arm) (push) Has been cancelled
Build and test GAM / build (build, 2, Build Intel Ubuntu Noble, ubuntu-24.04) (push) Has been cancelled
Build and test GAM / build (build, 3, Build Arm Ubuntu Noble, ubuntu-24.04-arm) (push) Has been cancelled
Build and test GAM / build (build, 4, Build Arm Ubuntu Jammy, ubuntu-22.04-arm) (push) Has been cancelled
Build and test GAM / build (build, 5, Build Intel StaticX Legacy, ubuntu-22.04, yes) (push) Has been cancelled
Build and test GAM / build (build, 6, Build Arm StaticX Legacy, ubuntu-22.04-arm, yes) (push) Has been cancelled
Build and test GAM / build (build, 7, Build Intel MacOS, macos-13) (push) Has been cancelled
Build and test GAM / build (build, 8, Build Arm MacOS 14, macos-14) (push) Has been cancelled
Build and test GAM / build (build, 9, Build Arm MacOS 15, macos-15) (push) Has been cancelled
Build and test GAM / build (test, 12, Test Python 3.10, ubuntu-24.04, 3.10) (push) Has been cancelled
Build and test GAM / build (test, 13, Test Python 3.11, ubuntu-24.04, 3.11) (push) Has been cancelled
Build and test GAM / build (test, 14, Test Python 3.12, ubuntu-24.04, 3.12) (push) Has been cancelled
Build and test GAM / build (test, 15, Test Python 3.14-dev, ubuntu-24.04, 3.14-dev) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
Check for Google Root CA Updates / check-apis (push) Has been cancelled
Push wiki / pushwiki (push) Has been cancelled
Build and test GAM / merge (push) Has been cancelled
Build and test GAM / publish (push) Has been cancelled
2025-04-25 15:10:59 -07:00
Ross Scroggs
a7b31550f3 Updated gam print group-members and gam print cigroup-members
Some checks failed
Build and test GAM / build (build, 1, Build Intel Ubuntu Jammy, ubuntu-22.04) (push) Has been cancelled
Build and test GAM / build (build, 10, Build Intel Windows, windows-2022) (push) Has been cancelled
Build and test GAM / build (build, 11, Build Arm Windows, windows-11-arm) (push) Has been cancelled
Build and test GAM / build (build, 2, Build Intel Ubuntu Noble, ubuntu-24.04) (push) Has been cancelled
Build and test GAM / build (build, 3, Build Arm Ubuntu Noble, ubuntu-24.04-arm) (push) Has been cancelled
Build and test GAM / build (build, 4, Build Arm Ubuntu Jammy, ubuntu-22.04-arm) (push) Has been cancelled
Build and test GAM / build (build, 5, Build Intel StaticX Legacy, ubuntu-22.04, yes) (push) Has been cancelled
Build and test GAM / build (build, 6, Build Arm StaticX Legacy, ubuntu-22.04-arm, yes) (push) Has been cancelled
Build and test GAM / build (build, 7, Build Intel MacOS, macos-13) (push) Has been cancelled
Build and test GAM / build (build, 8, Build Arm MacOS 14, macos-14) (push) Has been cancelled
Build and test GAM / build (build, 9, Build Arm MacOS 15, macos-15) (push) Has been cancelled
Build and test GAM / build (test, 12, Test Python 3.10, ubuntu-24.04, 3.10) (push) Has been cancelled
Build and test GAM / build (test, 13, Test Python 3.11, ubuntu-24.04, 3.11) (push) Has been cancelled
Build and test GAM / build (test, 14, Test Python 3.12, ubuntu-24.04, 3.12) (push) Has been cancelled
Build and test GAM / build (test, 15, Test Python 3.14-dev, ubuntu-24.04, 3.14-dev) (push) Has been cancelled
Build and test GAM / merge (push) Has been cancelled
Build and test GAM / publish (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
Check for Google Root CA Updates / check-apis (push) Has been cancelled
Push wiki / pushwiki (push) Has been cancelled
2025-04-25 12:29:11 -07:00
Jay Lee
ed19f877a5 Improved checkconn
Some checks failed
Build and test GAM / build (build, 1, Build Intel Ubuntu Jammy, ubuntu-22.04) (push) Has been cancelled
Build and test GAM / build (build, 10, Build Intel Windows, windows-2022) (push) Has been cancelled
Build and test GAM / build (build, 11, Build Arm Windows, windows-11-arm) (push) Has been cancelled
Build and test GAM / build (build, 2, Build Intel Ubuntu Noble, ubuntu-24.04) (push) Has been cancelled
Build and test GAM / build (build, 3, Build Arm Ubuntu Noble, ubuntu-24.04-arm) (push) Has been cancelled
Build and test GAM / build (build, 4, Build Arm Ubuntu Jammy, ubuntu-22.04-arm) (push) Has been cancelled
Build and test GAM / build (build, 5, Build Intel StaticX Legacy, ubuntu-22.04, yes) (push) Has been cancelled
Build and test GAM / build (build, 6, Build Arm StaticX Legacy, ubuntu-22.04-arm, yes) (push) Has been cancelled
Build and test GAM / build (build, 7, Build Intel MacOS, macos-13) (push) Has been cancelled
Build and test GAM / build (build, 8, Build Arm MacOS 14, macos-14) (push) Has been cancelled
Build and test GAM / build (build, 9, Build Arm MacOS 15, macos-15) (push) Has been cancelled
Build and test GAM / build (test, 12, Test Python 3.10, ubuntu-24.04, 3.10) (push) Has been cancelled
Build and test GAM / build (test, 13, Test Python 3.11, ubuntu-24.04, 3.11) (push) Has been cancelled
Build and test GAM / build (test, 14, Test Python 3.12, ubuntu-24.04, 3.12) (push) Has been cancelled
Build and test GAM / build (test, 15, Test Python 3.14-dev, ubuntu-24.04, 3.14-dev) (push) Has been cancelled
Build and test GAM / merge (push) Has been cancelled
Build and test GAM / publish (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
Check for Google Root CA Updates / check-apis (push) Has been cancelled
checkconn now works from a base set of hosts and then builds it's full
list based on our discovery APIs and the host in their discovery document.
2025-04-24 18:55:45 +00:00
Jay Lee
0ab08c968e use a string for env var 2025-04-24 15:27:21 +00:00
Jay Lee
02a7a1a106 Merge branch 'main' of https://github.com/GAM-team/GAM 2025-04-24 15:18:04 +00:00
Jay Lee
170a2e593b disable legacy openssl for cryptography 2025-04-24 15:17:59 +00:00
13 changed files with 115 additions and 149 deletions

View File

@@ -7,6 +7,7 @@ authors = [
{ name="Jay Lee", email="jay0lee@gmail.com" },
{ name="Ross Scroggs", email="Ross.Scroggs@gmail.com" },
]
# # The following files should be edited to match: setup.cfg, requirements.txt
dependencies = [
"chardet>=5.2.0",
"cryptography>=44.0.2",
@@ -17,7 +18,7 @@ dependencies = [
"google-auth-oauthlib>=1.2.2",
"google-auth>=2.39.0",
"httplib2>=0.22.0",
"lxml",
"lxml>=5.4.0",
"passlib>=1.7.4",
"pathvalidate>=3.2.3",
"pyscard==2.2.1",

View File

@@ -1523,17 +1523,6 @@ gam print alias|aliases [todrive <ToDriveAttribute>*]
gam whatis <EmailItem> [noinfo] [noinivitablecheck]
# Analytics UA
gam <UserTypeEntity> print analyticuaproperties [todrive <ToDriveAttribute>*]
accountid [accounts/]<String>
[maxresults <Integer>]
[formatjson [quotechar <Character>]]
gam <UserTypeEntity> show analyticuaproperties
accountid [accounts/]<String>
[maxresults <Integer>]
[formatjson]
# Analytics Admin
gam <UserTypeEntity> print analyticaccounts [todrive <ToDriveAttribute>*]

View File

@@ -1,3 +1,18 @@
7.06.12
Deleted commands to display Analytic UA properties; the API has been deprecated.
```
gam <UserTypeEntity> print|show analyticuaproperties
```
7.06.11
Improved `gam checkconn`.
Updated `gam print group-members` and `gam print cigroup-members` to recognize members
that are groups representing chat spaces. For now, these groups are not expanded when
`recursive` is specified.
7.06.10
Added the following license SKU.

View File

@@ -25,7 +25,7 @@ https://github.com/GAM-team/GAM/wiki
"""
__author__ = 'GAM Team <google-apps-manager@googlegroups.com>'
__version__ = '7.06.10'
__version__ = '7.06.12'
__license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
#pylint: disable=wrong-import-position
@@ -95,6 +95,8 @@ import wsgiref.simple_server
import wsgiref.util
import zipfile
# disable legacy stuff we don't use and isn't secure
os.environ['CRYPTOGRAPHY_OPENSSL_NO_LEGACY'] = "1"
from cryptography import x509
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import hashes, serialization
@@ -9358,32 +9360,9 @@ def getOSPlatform():
# gam checkconnection
def doCheckConnection():
hosts = ['api.github.com',
'raw.githubusercontent.com',
'accounts.google.com',
'workspace.google.com',
'oauth2.googleapis.com',
'www.googleapis.com']
fix_hosts = {'calendar-json.googleapis.com': 'www.googleapis.com',
'storage-api.googleapis.com': 'storage.googleapis.com'}
api_hosts = ['apps-apis.google.com',
'sites.google.com',
'versionhistory.googleapis.com',
'www.google.com']
for host in API.PROJECT_APIS:
host = fix_hosts.get(host, host)
if host not in api_hosts and host not in hosts:
api_hosts.append(host)
hosts.extend(sorted(api_hosts))
host_count = len(hosts)
httpObj = getHttpObj(timeout=30)
httpObj.follow_redirects = False
headers = {'user-agent': GAM_USER_AGENT}
okay = createGreenText('OK')
not_okay = createRedText('ERROR')
try_count = 0
success_count = 0
for host in hosts:
def check_host(host):
nonlocal try_count, okay, not_okay, success_count
try_count += 1
dns_err = None
ip = 'unknown'
@@ -9393,12 +9372,12 @@ def doCheckConnection():
dns_err = f'{not_okay}\n DNS failure: {str(e)}\n'
except Exception as e:
dns_err = f'{not_okay}\n Unknown DNS failure: {str(e)}\n'
check_line = f'Checking {host} ({ip}) ({try_count}/{host_count})...'
check_line = f'Checking {host} ({ip}) ({try_count})...'
writeStdout(f'{check_line:<100}')
flushStdout()
if dns_err:
writeStdout(dns_err)
continue
return
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.'
try:
if host.startswith('http'):
@@ -9427,7 +9406,54 @@ def doCheckConnection():
writeStdout(f'{not_okay}\n Timed out trying to connect to host\n')
except Exception as e:
writeStdout(f'{not_okay}\n {str(e)}\n')
if success_count == host_count:
try_count = 0
httpObj = getHttpObj(timeout=30)
httpObj.follow_redirects = False
headers = {'user-agent': GAM_USER_AGENT}
okay = createGreenText('OK')
not_okay = createRedText('ERROR')
success_count = 0
initial_hosts = ['api.github.com',
'raw.githubusercontent.com',
'accounts.google.com',
'oauth2.googleapis.com',
'www.googleapis.com']
for host in initial_hosts:
check_host(host)
api_hosts = ['apps-apis.google.com',
'www.google.com']
for host in api_hosts:
check_host(host)
# For v2 discovery APIs, GAM gets discovery file from <api>.googleapis.com so
# add those domains.
disc_hosts = []
for api, config in API._INFO.items():
if config.get('v2discovery') and not config.get('localdiscovery'):
if mapped_api := config.get('mappedAPI'):
api = mapped_api
host = f'{api}.googleapis.com'
if host not in disc_hosts:
disc_hosts.append(host)
for host in disc_hosts:
check_host(host)
checked_hosts = initial_hosts + api_hosts + disc_hosts
# now we need to "build" each API and check it's base URL host
# if we haven't already. This may not be any hosts at all but
# to ensure we are checking all hosts GAM may use we should
# keep this.
for api in API._INFO:
if api in [API.CONTACTS, API.EMAIL_AUDIT]:
continue
svc = getService(api, httpObj)
base_url = svc._rootDesc.get('baseUrl')
parsed_base_url = urlparse(base_url)
base_host = parsed_base_url.netloc
if base_host not in checked_hosts:
writeStdout(f'Checking {base_host} for {api}\n')
check_host(base_host)
checked_hosts.append(base_host)
if success_count == try_count:
writeStdout(createGreenText('All hosts passed!\n'))
else:
systemErrorExit(3, createYellowText('Some hosts failed to connect! Please follow the recommendations for those hosts to correct any issues and try again.'))
@@ -15778,27 +15804,13 @@ ANALYTIC_ENTITY_MAP = {
'pageSize': 50,
'maxPageSize': 200,
},
Ent.ANALYTIC_UA_PROPERTY:
{'titles': ['User', 'accountId', 'name', 'id', 'created', 'updated'],
'JSONtitles': ['User', 'accountId', 'name', 'id', 'JSON'],
'timeObjects': ['created', 'updated'],
'items': 'items',
'pageSize': 50,
'maxPageSize': 200,
},
}
def printShowAnalyticItems(users, entityType):
analyticEntityMap = ANALYTIC_ENTITY_MAP[entityType]
csvPF = CSVPrintFile(analyticEntityMap['titles'], 'sortall') if Act.csvFormat() else None
FJQC = FormatJSONQuoteChar(csvPF)
if entityType != Ent.ANALYTIC_UA_PROPERTY:
kwargs = {'pageSize': analyticEntityMap['pageSize']}
api = API.ANALYTICS_ADMIN
else:
# kwargs = {'webPropertyId': '~all'}
kwargs = {}
api = API.ANALYTICS
kwargs = {'pageSize': analyticEntityMap['pageSize']}
if entityType in {Ent.ANALYTIC_ACCOUNT, Ent.ANALYTIC_PROPERTY}:
kwargs['showDeleted'] = False
while Cmd.ArgumentsRemaining():
@@ -15811,16 +15823,12 @@ def printShowAnalyticItems(users, entityType):
kwargs['showDeleted'] = getBoolean()
elif entityType == Ent.ANALYTIC_PROPERTY and myarg == 'filter':
kwargs['filter'] = getString(Cmd.OB_STRING)
elif entityType == Ent.ANALYTIC_UA_PROPERTY and myarg == 'accountid':
kwargs['accountId'] = getString(Cmd.OB_STRING).replace('accounts/', '')
elif entityType == Ent.ANALYTIC_DATASTREAM and myarg == 'parent':
kwargs['parent'] = getString(Cmd.OB_STRING)
else:
FJQC.GetFormatJSONQuoteChar(myarg, True)
if entityType == Ent.ANALYTIC_PROPERTY and 'filter' not in kwargs:
missingArgumentExit('filter')
if entityType == Ent.ANALYTIC_UA_PROPERTY and 'accountId' not in kwargs:
missingArgumentExit('accountid')
if entityType == Ent.ANALYTIC_DATASTREAM and 'parent' not in kwargs:
missingArgumentExit('parent')
if csvPF and FJQC.formatJSON:
@@ -15828,7 +15836,7 @@ def printShowAnalyticItems(users, entityType):
i, count, users = getEntityArgument(users)
for user in users:
i += 1
user, analytics = buildGAPIServiceObject(api, user, i, count)
user, analytics = buildGAPIServiceObject(API.ANALYTICS_ADMIN, user, i, count)
if not analytics:
continue
if entityType == Ent.ANALYTIC_ACCOUNT:
@@ -15837,11 +15845,8 @@ def printShowAnalyticItems(users, entityType):
service = analytics.accountSummaries()
elif entityType == Ent.ANALYTIC_DATASTREAM:
service = analytics.properties().dataStreams()
elif entityType == Ent.ANALYTIC_PROPERTY:
else: # entityType == Ent.ANALYTIC_PROPERTY:
service = analytics.properties()
else: #Ent.ANALYTIC_UA_PROPERTY:
service = analytics.management().webproperties()
# service = analytics.management().profiles()
if csvPF:
printGettingAllEntityItemsForWhom(entityType, user, i, count)
pageMessage = getPageMessageForWhom()
@@ -15882,10 +15887,7 @@ def printShowAnalyticItems(users, entityType):
if not FJQC.formatJSON:
csvPF.WriteRowTitles(row)
elif csvPF.CheckRowTitles(row):
if entityType != Ent.ANALYTIC_UA_PROPERTY:
row = {'User': user, 'name': item['name'], 'displayName': item['displayName']}
else:
row = {'User': user, 'accountId': item['accountId'], 'id': item['id'], 'name': item['name']}
row = {'User': user, 'name': item['name'], 'displayName': item['displayName']}
for field in analyticEntityMap['JSONtitles'][2:-1]:
row[field] = item[field]
row['JSON'] = json.dumps(cleanJSON(item, timeObjects=analyticEntityMap['timeObjects']),
@@ -15923,17 +15925,6 @@ def printShowAnalyticAccountSummaries(users):
def printShowAnalyticProperties(users):
printShowAnalyticItems(users, Ent.ANALYTIC_PROPERTY)
# gam <UserTypeEntity> print analyticuaproperties [todrive <ToDriveAttribute>*]
# accountid [accounts/]<String>
# [maxresults <Integer>]
# [formatjson [quotechar <Character>]]
# gam <UserTypeEntity> show analyticuaproperties
# accountid [accounts/]<String>
# [maxresults <Integer>]
# [formatjson]
def printShowAnalyticUAProperties(users):
printShowAnalyticItems(users, Ent.ANALYTIC_UA_PROPERTY)
# gam <UserTypeEntity> print analyticdatastreams [todrive <ToDriveAttribute>*]
# parent <String>
# [maxresults <Integer>]
@@ -34179,7 +34170,8 @@ def getGroupMembers(cd, groupEmail, memberRoles, membersList, membersSet, i, cou
elif memberOptions[MEMBEROPTION_NODUPLICATES]:
groupMemberList = []
for member in groupMembers:
if member['type'] != Ent.TYPE_GROUP:
namespace = member['email'].find('@') == -1
if member['type'] != Ent.TYPE_GROUP or namespace:
if ((member['type'] in typesSet and
checkMemberMatch(member, memberOptions) and
_checkMemberRoleIsSuspendedIsArchived(member, validRoles, memberOptions[MEMBEROPTION_ISSUSPENDED], memberOptions[MEMBEROPTION_ISARCHIVED]) and
@@ -34208,7 +34200,8 @@ def getGroupMembers(cd, groupEmail, memberRoles, membersList, membersSet, i, cou
memberOptions, memberDisplayOptions, level+1, typesSet)
else:
for member in groupMembers:
if member['type'] != Ent.TYPE_GROUP:
namespace = member['email'].find('@') == -1
if member['type'] != Ent.TYPE_GROUP or namespace:
if ((member['type'] in typesSet) and
checkMemberMatch(member, memberOptions) and
_checkMemberRoleIsSuspendedIsArchived(member, validRoles,
@@ -36307,7 +36300,8 @@ def getCIGroupMembers(ci, groupName, memberRoles, membersList, membersSet, i, co
for member in groupMembers:
getCIGroupMemberRoleFixType(member)
memberName = member.get('preferredMemberKey', {}).get('id', '')
if member['type'] != Ent.TYPE_GROUP:
namespace = member.get('preferredMemberKey', {}).get('namespace', '')
if member['type'] != Ent.TYPE_GROUP or namespace:
if (member['type'] in typesSet and
checkCIMemberMatch(member, memberOptions) and
_checkMemberRole(member, validRoles) and
@@ -36335,7 +36329,8 @@ def getCIGroupMembers(ci, groupName, memberRoles, membersList, membersSet, i, co
for member in groupMembers:
getCIGroupMemberRoleFixType(member)
memberName = member.get('preferredMemberKey', {}).get('id', '')
if member['type'] != Ent.TYPE_GROUP:
namespace = member.get('preferredMemberKey', {}).get('namespace', '')
if member['type'] != Ent.TYPE_GROUP or namespace:
if (member['type'] in typesSet and
checkCIMemberMatch(member, memberOptions) and
_checkMemberRole(member, validRoles) and
@@ -76686,7 +76681,6 @@ USER_COMMANDS_WITH_OBJECTS = {
Cmd.ARG_ANALYTICACCOUNTSUMMARY: printShowAnalyticAccountSummaries,
Cmd.ARG_ANALYTICDATASTREAM: printShowAnalyticDatastreams,
Cmd.ARG_ANALYTICPROPERTY: printShowAnalyticProperties,
Cmd.ARG_ANALYTICUAPROPERTY: printShowAnalyticUAProperties,
Cmd.ARG_ASP: printShowASPs,
Cmd.ARG_BACKUPCODE: printShowBackupCodes,
Cmd.ARG_CALENDAR: printShowCalendars,
@@ -76793,7 +76787,6 @@ USER_COMMANDS_WITH_OBJECTS = {
Cmd.ARG_ANALYTICACCOUNTSUMMARY: printShowAnalyticAccountSummaries,
Cmd.ARG_ANALYTICDATASTREAM: printShowAnalyticDatastreams,
Cmd.ARG_ANALYTICPROPERTY: printShowAnalyticProperties,
Cmd.ARG_ANALYTICUAPROPERTY: printShowAnalyticUAProperties,
Cmd.ARG_ASP: printShowASPs,
Cmd.ARG_BACKUPCODE: printShowBackupCodes,
Cmd.ARG_CALENDAR: printShowCalendars,
@@ -77006,7 +76999,6 @@ USER_COMMANDS_OBJ_ALIASES = {
Cmd.ARG_ANALYTICACCOUNTSUMMARIES: Cmd.ARG_ANALYTICACCOUNTSUMMARY,
Cmd.ARG_ANALYTICDATASTREAMS: Cmd.ARG_ANALYTICDATASTREAM,
Cmd.ARG_ANALYTICPROPERTIES: Cmd.ARG_ANALYTICPROPERTY,
Cmd.ARG_ANALYTICUAPROPERTIES: Cmd.ARG_ANALYTICUAPROPERTY,
Cmd.ARG_ASPS: Cmd.ARG_ASP,
Cmd.ARG_BACKUPCODES: Cmd.ARG_BACKUPCODE,
Cmd.ARG_CALENDARS: Cmd.ARG_CALENDAR,

View File

@@ -22,7 +22,6 @@
# APIs
ACCESSCONTEXTMANAGER = 'accesscontextmanager'
ALERTCENTER = 'alertcenter'
ANALYTICS = 'analytics'
ANALYTICS_ADMIN = 'analyticsadmin'
CALENDAR = 'calendar'
CBCM = 'cbcm'
@@ -162,7 +161,6 @@ PROJECT_APIS = [
'accesscontextmanager.googleapis.com',
'admin.googleapis.com',
'alertcenter.googleapis.com',
'analyticsdata.googleapis.com',
'analyticsadmin.googleapis.com',
# 'audit.googleapis.com',
'calendar-json.googleapis.com',
@@ -201,7 +199,6 @@ PROJECT_APIS = [
_INFO = {
ACCESSCONTEXTMANAGER: {'name': 'Access Context Manager API', 'version': 'v1', 'v2discovery': True},
ALERTCENTER: {'name': 'AlertCenter API', 'version': 'v1beta1', 'v2discovery': True},
ANALYTICS: {'name': 'Analytics API', 'version': 'v3', 'v2discovery': False},
ANALYTICS_ADMIN: {'name': 'Analytics Admin API', 'version': 'v1beta', 'v2discovery': True},
CALENDAR: {'name': 'Calendar API', 'version': 'v3', 'v2discovery': True, 'mappedAPI': 'calendar-json'},
CBCM: {'name': 'Chrome Browser Cloud Management API', 'version': 'v1.1beta1', 'v2discovery': True, 'localjson': True},
@@ -244,7 +241,7 @@ _INFO = {
EMAIL_AUDIT: {'name': 'Email Audit API', 'version': 'v1', 'v2discovery': False},
FORMS: {'name': 'Forms API', 'version': 'v1', 'v2discovery': True},
GMAIL: {'name': 'Gmail API', 'version': 'v1', 'v2discovery': True},
GROUPSMIGRATION: {'name': 'Groups Migration API', 'version': 'v1', 'v2discovery': False},
GROUPSMIGRATION: {'name': 'Groups Migration API', 'version': 'v1', 'v2discovery': True},
GROUPSSETTINGS: {'name': 'Groups Settings API', 'version': 'v1', 'v2discovery': True},
IAM: {'name': 'Identity and Access Management API', 'version': 'v1', 'v2discovery': True},
IAM_CREDENTIALS: {'name': 'Identity and Access Management Credentials API', 'version': 'v1', 'v2discovery': True},
@@ -532,10 +529,6 @@ _SVCACCT_SCOPES = [
'api': ALERTCENTER,
'subscopes': [],
'scope': 'https://www.googleapis.com/auth/apps.alerts'},
{'name': 'Analytics API - read only',
'api': ANALYTICS,
'subscopes': [],
'scope': 'https://www.googleapis.com/auth/analytics.readonly'},
{'name': 'Analytics Admin API - read only',
'api': ANALYTICS_ADMIN,
'subscopes': [],

View File

@@ -423,8 +423,6 @@ class GamCLArgs():
ARG_ANALYTICDATASTREAMS = 'analyticdatastreams'
ARG_ANALYTICPROPERTY = 'analyticproperty'
ARG_ANALYTICPROPERTIES = 'analyticproperties'
ARG_ANALYTICUAPROPERTY = 'analyticuaproperty'
ARG_ANALYTICUAPROPERTIES = 'analyticuaproperties'
ARG_API = 'api'
ARG_APIS = 'apis'
ARG_APIPROJECT = 'apiproject'

View File

@@ -61,7 +61,6 @@ class GamEntity():
ANALYTIC_ACCOUNT_SUMMARY = 'anas'
ANALYTIC_DATASTREAM = 'anad'
ANALYTIC_PROPERTY = 'anap'
ANALYTIC_UA_PROPERTY = 'anau'
API = 'api '
APP_ACCESS_SETTINGS = 'apps'
APP_ID = 'appi'
@@ -412,7 +411,6 @@ class GamEntity():
ANALYTIC_ACCOUNT_SUMMARY: ['Analytic Account Summaries', 'Analytic Account Summary'],
ANALYTIC_DATASTREAM: ['Analytic Datastreams', 'Analytic Datastream'],
ANALYTIC_PROPERTY: ['Analytic GA4 Properties', 'Analytic GA4 Property'],
ANALYTIC_UA_PROPERTY: ['Analytic UA Properties', 'Analytic UA Property'],
API: ['APIs', 'API'],
APP_ACCESS_SETTINGS: ['Application Access Settings', 'Application Access Settings'],
APP_ID: ['Application IDs', 'Application ID'],

View File

@@ -7,7 +7,7 @@ google-auth-httplib2>=0.2.0
google-auth-oauthlib>=1.2.2
google-auth>=2.39.0
httplib2>=0.22.0
lxml
lxml>=5.4.0
passlib>=1.7.4
pathvalidate>=3.2.3
pyscard==2.2.1

View File

@@ -17,11 +17,13 @@ classifiers =
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12
Programming Language :: Python :: 3.13
License :: OSI Approved :: Apache License
[options]
packages = find:
python_requires = >= 3.8
python_requires = >= 3.9
# The following files should be edited to match: pyproject.toml, requirements.txt
install_requires =
chardet >= 5.2.0
cryptography >= 44.0.2
@@ -32,7 +34,7 @@ install_requires =
google-auth-oauthlib >= 1.2.2
google-auth >= 2.39.0
httplib2 >= 0.22.0
lxml
lxml >= 5.4.0
passlib >= 1.7.4
pathvalidate >= 3.2.3
pyscard == 2.2.1

View File

@@ -10,6 +10,21 @@ 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
### 7.06.12
Deleted commands to display Analytic UA properties; the API has been deprecated.
```
gam <UserTypeEntity> print|show analyticuaproperties
```
### 7.06.11
Improved `gam checkconn`.
Updated `gam print group-members` and `gam print cigroup-members` to recognize members
that are groups representing chat spaces. For now, these groups are not expanded when
`recursive` is specified.
### 7.06.10
Added the following license SKU.

View File

@@ -251,7 +251,7 @@ writes the credentials into the file oauth2.txt.
admin@server:/Users/admin$ rm -f /Users/admin/GAMConfig/oauth2.txt
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
GAM 7.06.10 - https://github.com/GAM-team/GAM - pyinstaller
GAM 7.06.12 - https://github.com/GAM-team/GAM - pyinstaller
GAM Team <google-apps-manager@googlegroups.com>
Python 3.13.3 64-bit final
MacOS Sequoia 15.4.1 x86_64
@@ -989,7 +989,7 @@ writes the credentials into the file oauth2.txt.
C:\>del C:\GAMConfig\oauth2.txt
C:\>gam version
WARNING: Config File: C:\GAMConfig\gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: C:\GAMConfig\oauth2.txt, Not Found
GAM 7.06.10 - https://github.com/GAM-team/GAM - pythonsource
GAM 7.06.12 - https://github.com/GAM-team/GAM - pythonsource
GAM Team <google-apps-manager@googlegroups.com>
Python 3.13.3 64-bit final
Windows-10-10.0.17134 AMD64

View File

@@ -6,14 +6,13 @@
- [Display Analytic Account Summaries](#display-analytic-account-summaries)
- [Display Analytic Properties](#display-analytic-properties)
- [Display Analytic Datastreams](#display-analytic-datastreams)
- [Display Analytic UA Properties](#display-analytic-ua-properties)
- [Examples](#examples)
## API documentation
* [Analytics Admin API](https://developers.google.com/analytics/devguides/config/admin/v1/rest)
## Notes
To use these commands you must add 'Analytics API' and 'Analytics Admin API' to your project and update your service account authorization.
To use these commands you must add 'Analytics Admin API' to your project and update your service account authorization.
```
gam update project
gam user user@domain.com update serviceaccount
@@ -142,37 +141,6 @@ When using the `formatjson` option, double quotes are used extensively in the da
The `quotechar <Character>` option allows you to choose an alternate quote character, single quote for instance, that makes for readable/processable output.
`quotechar` defaults to `gam.cfg/csv_output_quote_char`. When uploading CSV files to Google, double quote `"` should be used.
## Display Analytic UA Properties
```
gam <UserTypeEntity> show analyticuaproperties
accountid [accounts/]<String>
[maxresults <Integer>]
[formatjson]
```
The required `accountid <String>` can be in the format: 'accounts/123' or '123'.
By default, GAM asks the API for 50 properties per page of results,
* `maxresults` - Maximum number of results per page; range is 1-200; the default is 50.
By default, Gam displays the information as an indented list of keys and values.
* `formatjson` - Display the fields in JSON format.
```
gam <UserTypeEntity> print analyticuaproperties [todrive <ToDriveAttribute>*]
accountid [accounts/]<String>
[maxresults <Integer>]
[formatjson [quotechar <Character>]]
```
The required `accountid <String>` can be in the format: 'accounts/123' or '123'.
By default, GAM asks the API for 50 properties per page of results,
* `maxresults` - Maximum number of results per page; range is 1-200; the default is 50.
By default, when writing CSV files, Gam uses a quote character of double quote `"`. The quote character is used to enclose columns that contain
the quote character itself, the column delimiter (comma by default) and new-line characters. Any quote characters within the column are doubled.
When using the `formatjson` option, double quotes are used extensively in the data resulting in hard to read/process output.
The `quotechar <Character>` option allows you to choose an alternate quote character, single quote for instance, that makes for readable/processable output.
`quotechar` defaults to `gam.cfg/csv_output_quote_char`. When uploading CSV files to Google, double quote `"` should be used.
## Examples
Get all analytic accounts
@@ -189,8 +157,3 @@ Get all analytic account properties (GA4)
```
gam redirect stdout - multiprocess redirect stderr stdout redirect csv ./GA4AnalyticAccountProperties.csv multiprocess csv AnalyticAccounts.csv gam user "~User" print analyticproperties filter "parent:~~name~~"
```
Get all analytic account properties (UA)
```
gam redirect stdout - multiprocess redirect stderr stdout redirect csv ./UAAnalyticAccountProperties.csv multiprocess csv AnalyticAccounts.csv gam user "~User" print analyticuaproperties accountid "~~name~~"
```

View File

@@ -4,7 +4,7 @@ k
Print the current version of Gam with details
```
gam version
GAM 7.06.10 - https://github.com/GAM-team/GAM - pyinstaller
GAM 7.06.12 - https://github.com/GAM-team/GAM - pyinstaller
GAM Team <google-apps-manager@googlegroups.com>
Python 3.13.3 64-bit final
MacOS Sequoia 15.4.1 x86_64
@@ -16,7 +16,7 @@ Time: 2023-06-02T21:10:00-07:00
Print the current version of Gam with details and time offset information
```
gam version timeoffset
GAM 7.06.10 - https://github.com/GAM-team/GAM - pyinstaller
GAM 7.06.12 - https://github.com/GAM-team/GAM - pyinstaller
GAM Team <google-apps-manager@googlegroups.com>
Python 3.13.3 64-bit final
MacOS Sequoia 15.4.1 x86_64
@@ -28,7 +28,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
GAM 7.06.10 - https://github.com/GAM-team/GAM - pyinstaller
GAM 7.06.12 - https://github.com/GAM-team/GAM - pyinstaller
GAM Team <google-apps-manager@googlegroups.com>
Python 3.13.3 64-bit final
MacOS Sequoia 15.4.1 x86_64
@@ -65,7 +65,7 @@ MacOS High Sierra 10.13.6 x86_64
Path: /Users/Admin/bin/gam7
Version Check:
Current: 5.35.08
Latest: 7.06.10
Latest: 7.06.12
echo $?
1
```
@@ -73,7 +73,7 @@ echo $?
Print the current version number without details
```
gam version simple
7.06.10
7.06.12
```
In Linux/MacOS you can do:
```
@@ -83,7 +83,7 @@ echo $VER
Print the current version of Gam and address of this Wiki
```
gam help
GAM 7.06.10 - https://github.com/GAM-team/GAM
GAM 7.06.12 - https://github.com/GAM-team/GAM
GAM Team <google-apps-manager@googlegroups.com>
Python 3.13.3 64-bit final
MacOS Sequoia 15.4.1 x86_64