Initial wiring for Chrome Profiles. Starts #1718
Some checks are pending
Build and test GAM / build (Win64, build, 9, VC-WIN64A, windows-2022) (push) Waiting to run
Build and test GAM / build (aarch64, build, 3, linux-aarch64, [self-hosted linux arm64]) (push) Waiting to run
Build and test GAM / build (aarch64, build, 5, linux-aarch64, [self-hosted linux arm64], yes) (push) Waiting to run
Build and test GAM / build (aarch64, build, 7, darwin64-arm64, macos-14) (push) Waiting to run
Build and test GAM / build (aarch64, build, 8, darwin64-arm64, macos-15) (push) Waiting to run
Build and test GAM / build (x86_64, build, 1, linux-x86_64, ubuntu-22.04) (push) Waiting to run
Build and test GAM / build (x86_64, build, 2, linux-x86_64, ubuntu-24.04) (push) Waiting to run
Build and test GAM / build (x86_64, build, 4, linux-x86_64, ubuntu-22.04, yes) (push) Waiting to run
Build and test GAM / build (x86_64, build, 6, darwin64-x86_64, macos-13) (push) Waiting to run
Build and test GAM / build (x86_64, test, 10, ubuntu-24.04, 3.9) (push) Waiting to run
Build and test GAM / build (x86_64, test, 11, ubuntu-24.04, 3.10) (push) Waiting to run
Build and test GAM / build (x86_64, test, 12, ubuntu-24.04, 3.11) (push) Waiting to run
Build and test GAM / build (x86_64, test, 13, ubuntu-24.04, 3.12) (push) Waiting to run
Build and test GAM / merge (push) Blocked by required conditions
Build and test GAM / publish (push) Blocked by required conditions
CodeQL / Analyze (python) (push) Waiting to run
Check for Google Root CA Updates / check-apis (push) Waiting to run

This commit is contained in:
Jay Lee
2024-11-21 16:58:08 +00:00
parent 1870b25b0b
commit 7400bfab70
3 changed files with 33 additions and 0 deletions

View File

@@ -25144,6 +25144,34 @@ BROWSER_ORDERBY_CHOICE_MAP = {
# 'safebrowsingclickthrough': 'safe_browsing_clickthrough',
}
CHROMEPROFILE_TIME_OBJECTS = {'lastActivityTime',
'lastPolicyFetchTime',
'firstEnrollmentTime'}
# gam show chromeprofiles
# gam print chromeprofiles
def doPrintShowChromeProfiles():
def _printProfile(profile):
row = flattenJSON(profile, timeObjects=CHROMEPROFILE_TIME_OBJECTS)
if not FJQC.formatJSON:
csvPF.WriteRowTitles(row)
elif csvPF.CheckRowTitles(row):
csvPF.WriteRowNoFilter({'deviceId': browser['deviceId'],
'JSON': json.dumps(cleanJSON(browser, timeObjects=CHROMEPROFILE_TIME_OBJECTS),
ensure_ascii=False, sort_keys=True)})
cm = buildGAPIObject(API.CHROMEMANAGEMENT)
customerId = _getCustomerId()
parent = f'customers/{customerId}'
results = yieldGAPIpages(cm.customers().profiles(),
'list',
'chromeBrowserProfiles',
parent=parent,
pageSize=200)
for profiles in results:
for profile in profiles:
print(profile)
# gam show browsers
# ([ou|org|orgunit|browserou <OrgUnitPath>] [(query <QueryBrowser)|(queries <QueryBrowserList>))|(select <BrowserEntity>))
# [querytime<String> <Time>]
@@ -75228,6 +75256,7 @@ MAIN_COMMANDS_WITH_OBJECTS = {
Cmd.ARG_CHROMEHISTORY: doPrintShowChromeHistory,
Cmd.ARG_CHROMENEEDSATTN: doPrintShowChromeNeedsAttn,
Cmd.ARG_CHROMEPOLICY: doPrintShowChromePolicies,
Cmd.ARG_CHROMEPROFILES: doPrintShowChromeProfiles,
Cmd.ARG_CHROMESCHEMA: doPrintShowChromeSchemas,
Cmd.ARG_CHROMESNVALIDITY: doPrintChromeSnValidity,
Cmd.ARG_CHROMEVERSIONS: doPrintShowChromeVersions,

View File

@@ -297,6 +297,9 @@ _CLIENT_SCOPES = [
'api': CHROMEMANAGEMENT_APPDETAILS,
'subscopes': [],
'scope': 'https://www.googleapis.com/auth/chrome.management.appdetails.readonly'},
{'name': 'Chrome Management API - Profiles',
'subscopes': READONLY,
'scope': 'https://www.googleapis.com/auth/chrome.management.profiles'},
{'name': 'Chrome Management API - Telemetry read only',
'api': CHROMEMANAGEMENT_TELEMETRY,
'subscopes': [],

View File

@@ -483,6 +483,7 @@ class GamCLArgs():
ARG_CHROMEPOLICYIMAGE = 'chromepolicyimage'
ARG_CHROMEPOLICY = 'chromepolicy'
ARG_CHROMEPOLICIES = 'chromepolicies'
ARG_CHROMEPROFILES = 'chromeprofiles'
ARG_CHROMESCHEMA = 'chromeschema'
ARG_CHROMESCHEMAS = 'chromeschemas'
ARG_CHROMESNVALIDITY = 'chromesnvalidity'