Compare commits

..

26 Commits

Author SHA1 Message Date
Jay Lee
74fc224a84 Update build.yml 2023-06-09 21:35:14 -04:00
Jay Lee
0ea88630e2 undo collect_all for cryptography, did not solve win32 2023-06-08 16:52:23 -04:00
Jay Lee
f1f351a8c0 Update gam.spec 2023-06-08 15:58:02 -04:00
Jay Lee
5f85bec1ec Update gam.spec 2023-06-08 15:49:11 -04:00
Jay Lee
c498067e75 Update gam.spec 2023-06-08 15:46:56 -04:00
Jay Lee
25c4bba3fa Update gam.spec 2023-06-08 14:28:49 -04:00
Jay Lee
034e8faaf4 collect everything for cryptography 2023-06-08 14:26:01 -04:00
Jay Lee
9db0bdedb1 [skip ci] undo collect-all, remove gcp 2023-06-08 14:20:06 -04:00
Jay Lee
48117a6894 Update build.yml 2023-06-08 14:14:42 -04:00
Jay Lee
3cd890a1f5 [skip ci] PyInstaller cherry pick no longer after 5.12.0 release 2023-06-08 08:17:14 -04:00
Jay Lee
dddbb0ed8f Cherry pick pyinstaller fix for Python 3.11.4 2023-06-08 07:42:30 -04:00
Jay Lee
5d4f672411 [skip ci] 3.12 beta 2023-06-07 18:15:25 -04:00
Jay Lee
9c3a0964b6 test pin to python 3.11.3 2023-06-07 17:51:21 -04:00
Jay Lee
5f0774a84f [skip ci] undo ipaddress hidden import 2023-06-07 17:49:49 -04:00
Jay Lee
e560b80611 Update gam.spec 2023-06-07 16:57:32 -04:00
Jay Lee
4da6fad049 rebuild for Python 3.11.4 2023-06-07 15:55:10 -04:00
Ross Scroggs
8f76d94b86 Correct namespace capitalization (#1631) 2023-06-07 07:31:22 -04:00
Jay Lee
a28bce71df Rebuild for OpenSSL 3.1.1 2023-05-30 09:34:36 -04:00
Jay Lee
eed55490ef re-add ACM API 2023-05-19 09:38:32 -04:00
Jay Lee
b1c7685afe remove accesscontextmanager API for time being... 2023-05-19 07:40:49 -04:00
Jay Lee
4d79e9de4f 6.58, workaround for #1625 2023-04-26 12:42:13 +00:00
Jay Lee
1ae54db7de fix pageSize 2023-04-19 14:42:00 +00:00
Jay Lee
6d63df24a3 revert 1hr workaround. Fixes #1534 2023-04-19 14:39:59 +00:00
Jay Lee
85dd32e0ce Update build.yml 2023-04-17 08:17:43 -04:00
Jay Lee
28e418ff23 Update build.yml 2023-04-16 09:05:31 -04:00
Jay Lee
4eb89b187f Update build.yml 2023-04-14 19:43:41 -04:00
6 changed files with 43 additions and 121 deletions

View File

@@ -34,7 +34,7 @@ jobs:
goal: build
arch: x86_64
openssl_archs: linux-x86_64
- os: [self-hosted, linux, arm64, gcp]
- os: [self-hosted, linux, arm64]
jid: 2
goal: build
arch: aarch64
@@ -45,7 +45,7 @@ jobs:
arch: x86_64
openssl_archs: linux-x86_64
staticx: yes
- os: [self-hosted, linux, arm64, gcp]
- os: [self-hosted, linux, arm64]
jid: 4
goal: build
arch: aarch64
@@ -61,11 +61,11 @@ jobs:
goal: build
arch: Win64
openssl_archs: VC-WIN64A
- os: windows-2022
jid: 7
goal: build
arch: Win32
openssl_archs: VC-WIN32
- os: ubuntu-22.04
goal: test
python: "3.8"
@@ -83,7 +83,7 @@ jobs:
arch: x86_64
- os: ubuntu-22.04
goal: test
python: "3.12.0-alpha - 3.12"
python: "3.12"
jid: 12
arch: x86_64
@@ -109,7 +109,7 @@ jobs:
path: |
bin.tar.xz
src/cpython
key: gam-${{ matrix.jid }}-20230405
key: gam-${{ matrix.jid }}-20230608
- name: Untar Cache archive
if: matrix.goal == 'build' && steps.cache-python-ssl.outputs.cache-hit == 'true'
@@ -122,6 +122,7 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
allow-prereleases: true
- name: Set cURL retry flag
run: |
@@ -467,8 +468,6 @@ jobs:
git clone https://github.com/pyinstaller/pyinstaller.git
cd pyinstaller
export latest_release=$(git tag --list | grep -v dev | grep -v rc | sort -Vr | head -n1)
# temp pin to 5.9
export latest_release="v5.9.0"
git checkout "${latest_release}"
# remove pre-compiled bootloaders so we fail if bootloader compile fails
rm -rvf PyInstaller/bootloader/*-*/*
@@ -567,7 +566,7 @@ jobs:
if [[ "${staticx}" == "yes" ]]; then
libver="legacy"
else
libver="glibc-$(ldd --version | awk '/ldd/{print $NF}')"
libver="glibc$(ldd --version | awk '/ldd/{print $NF}')"
fi
GAM_ARCHIVE="gam-${GAMVERSION}-linux-$(arch)-$libver}.tar.xz"
fi

View File

@@ -7,22 +7,23 @@ from PyInstaller.utils.hooks import copy_metadata
from gam.var import GAM_VER_LIBS
extra_files = []
datas = []
for pkg in GAM_VER_LIBS:
extra_files += copy_metadata(pkg, recursive=True)
extra_files += [('cbcm-v1.1beta1.json', '.')]
extra_files += [('contactdelegation-v1.json', '.')]
extra_files += [('admin-directory_v1.1beta1.json', '.')]
extra_files += [('roots.pem', '.')]
hidden_imports = [
datas += copy_metadata(pkg, recursive=True)
datas += [('cbcm-v1.1beta1.json', '.')]
datas += [('contactdelegation-v1.json', '.')]
datas += [('admin-directory_v1.1beta1.json', '.')]
datas += [('roots.pem', '.')]
hiddenimports = [
'gam.auth.yubikey',
]
a = Analysis(
['gam/__main__.py'],
pathex=[],
binaries=[],
datas=extra_files,
hiddenimports=hidden_imports,
datas=datas,
hiddenimports=hiddenimports,
hookspath=[],
hooksconfig={},
runtime_hooks=[],

View File

@@ -70,7 +70,7 @@ def printshow_policies():
body['policyTargetKey']['additionalTargetKeys'] = {'app_id': app_id}
if not namespaces:
namespaces = ['chrome.users.apps',
'chrome.devices.managedGuest.apps',
'chrome.devices.managedguest.apps',
'chrome.devices.kiosk.apps']
elif not namespaces:
namespaces = [
@@ -78,7 +78,7 @@ def printshow_policies():
'chrome.users.apps',
'chrome.devices',
'chrome.devices.kiosk',
'chrome.devices.managedGuest',
'chrome.devices.managedguest',
]
throw_reasons = [gapi_errors.ErrorReason.FOUR_O_O,]
orgunitPath = gapi_directory_orgunits.orgunit_from_orgunitid(orgunit[9:], None)

View File

@@ -253,13 +253,6 @@ def update_state():
def print_():
# This function is rather messy thanks to
# https://github.com/GAM-team/GAM/issues/1534
# I'd prefer to keep it all in this function for now but if:
# - we find other list() operations that also hit this bug OR
# - it looks like this issue is going to exist on Google's side
# for a long time.
# I'll enterain some cleanup here to "functionalize" (yuck) all of this.
ci = gapi_cloudidentity.build_dwd()
customer = _get_device_customerid()
parent = 'devices/-'
@@ -267,8 +260,6 @@ def print_():
get_device_users = True
view = None
orderByList = []
# default sort order needed by our 1 hour bug workaround
orderBy = 'create_time'
titles = []
csvRows = []
todrive = False
@@ -328,97 +319,26 @@ def print_():
}
if orderByList:
orderBy = ','.join(orderByList)
custom_device_filter = bool(device_filter)
# we store the devices in a dict keyed by name which is a unique ID.
# that way when we get duplicate devices we just overwrite the name
# with the latest copy we saw.
devices = {}
else:
orderBy = None
devices = []
page_message = gapi.got_total_items_msg(view_name_map[view], '...\n')
pageToken = None
newest_device_date = ''
total_items = 0
while True:
try:
a_page = gapi.call(ci.devices(),
'list',
customer=customer,
pageSize=100,
pageToken=pageToken,
filter=device_filter,
view=view,
orderBy=orderBy,
throw_reasons=[gapi_errors.ErrorReason.FOUR_O_O])
except googleapiclient.errors.HttpError:
sys.stderr.write('WARNING: GAM hit Google internal bug 237397223. Please file a Google Support ticket stating that you are encountering this bug.\n')
if orderBy != 'create_time' or custom_device_filter:
controlflow.system_error_exit(5, 'GAM workaround for this issue only works if filter and orderby arguments are not used.\n')
sys.stderr.write(f' attempting to work around the bug by filtering for devices created on or after the newest we\'ve seen ({newest_device_date})...')
device_filter = f'register:{newest_device_date}..'
pageToken = None
continue
for dev in a_page.get('devices', []):
total_items += 1
devices[dev['name']] = dev
dev_date = dev.get('createTime', '')
# remove the Z
dev_date = dev_date[:-1]
# remove microseconds
dev_date = dev_date.split('.')[0]
if dev_date > newest_device_date:
newest_device_date = dev_date
pageToken = a_page.get('nextPageToken')
if not pageToken:
break
sys.stderr.write(page_message.replace('%%total_items%%', str(total_items)))
devices += gapi.get_all_pages(ci.devices(), 'list', 'devices',
customer=customer, page_message=page_message,
pageSize=100, filter=device_filter, view=view, orderBy=orderBy)
if get_device_users:
page_message = gapi.got_total_items_msg('Device Users', '...\n')
pageToken = None
newest_deviceuser_date = ''
total_items = 0
device_users = {}
if not custom_device_filter:
device_filter = None
while True:
try:
a_page = gapi.call(ci.devices().deviceUsers(),
'list',
customer=customer,
parent=parent,
pageSize=20,
orderBy=orderBy,
filter=device_filter,
pageToken=pageToken,
throw_reasons=[gapi_errors.ErrorReason.FOUR_O_O])
except googleapiclient.errors.HttpError:
sys.stderr.write('WARNING: GAM hit Google internal bug 237397223. Please file a Google Support ticket stating that you are encountering this bug.\n')
if orderBy != 'create_time' or custom_device_filter:
controlflow.system_error_exit(5, 'GAM workaround for this issue only works if filter and orderby arguments are not used.\n')
sys.stderr.write(f' attempting to work around the bug by filtering for device users created on or after the newest we\'ve seen ({newest_deviceuser_date})...')
device_filter = f'register:{newest_deviceuser_date}..'
pageToken = None
continue
for device_user in a_page.get('deviceUsers', []):
total_items += 1
dev_date = device_user.get('createTime', '')
# remove the Z
dev_date = dev_date[:-1]
# remove microseconds
dev_date = dev_date.split('.')[0]
if dev_date > newest_deviceuser_date:
newest_deviceuser_date = dev_date
deviceuser_name = device_user['name']
device_users[deviceuser_name] = device_user
pageToken = a_page.get('nextPageToken')
if not pageToken:
break
sys.stderr.write(page_message.replace('%%total_items%%', str(total_items)))
for deviceuser_name, device_user in device_users.items():
device_id = deviceuser_name.split('/')[1]
device_name = f'devices/{device_id}'
if 'users' not in devices[device_name]:
devices[device_name]['users'] = []
devices[device_name]['users'].append(device_user)
for device in devices.values():
device_users = gapi.get_all_pages(ci.devices().deviceUsers(), 'list',
'deviceUsers', customer=customer, parent=parent,
page_message=page_message, pageSize=20, filter=device_filter)
for device_user in device_users:
for device in devices:
if device_user.get('name').startswith(device.get('name')):
if 'users' not in device:
device['users'] = []
device['users'].append(device_user)
break
for device in devices:
device = utils.flatten_json(device)
for a_key in device:
if a_key not in titles:

View File

@@ -204,6 +204,7 @@ def print_(returnFields=None,
],
page_message=page_message,
customerId=customer_id,
maxResults=100,
productId=product,
skuId=sku,
fields=fields)
@@ -234,6 +235,7 @@ def print_(returnFields=None,
],
page_message=page_message,
customerId=customer_id,
maxResults=100,
productId=productId,
fields=fields)
if countsOnly:

View File

@@ -8,7 +8,7 @@ import platform
import re
GAM_AUTHOR = 'Jay Lee <jay0lee@gmail.com>'
GAM_VERSION = '6.57'
GAM_VERSION = '6.58'
GAM_LICENSE = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
GAM_URL = 'https://jaylee.us/gam'