From 3ab6d80c961ffb06b384007443d07c5da1b0df50 Mon Sep 17 00:00:00 2001 From: theborch Date: Fri, 7 Mar 2025 13:40:30 -0600 Subject: [PATCH 1/2] fix:inverted catalogAppDisplayName|catalogAppName --- requirements.txt | 2 +- src/pybritive/britive_cli.py | 38 +++++++++++++++++++----------------- 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/requirements.txt b/requirements.txt index aa50120..f96f964 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ beautifulsoup4 boto3 -britive~=4.0 +britive>=4.1.2,<5.0 certifi charset-normalizer click>=8.1.7 diff --git a/src/pybritive/britive_cli.py b/src/pybritive/britive_cli.py index 26b8f88..e2d7611 100644 --- a/src/pybritive/britive_cli.py +++ b/src/pybritive/britive_cli.py @@ -470,32 +470,34 @@ def _set_available_profiles(self, from_cache_command=False, profile_type: Option access_data['accesses'] ) and len({a['papId'] for a in access_data['accesses']}) < access_limit: increase += max(25, round(access_data['count'] * 0.25)) + apps = {a['appContainerId']: a for a in access_data.get('apps', [])} + envs = {e['environmentId']: e for e in access_data.get('environments', [])} + profiles = {p['papId']: p for p in access_data.get('profiles', [])} + accesses = [ + tuple([a['appContainerId'], a['environmentId'], a['papId']]) + for a in access_data.get('accesses', []) + ] access_output = [] - for access in access_data['accesses']: - appContainerId = access['appContainerId'] - environmentId = access['environmentId'] - papId = access['papId'] - app = next((a for a in access_data.get('apps', []) if a['appContainerId'] == appContainerId), {}) - environment = next( - (e for e in access_data.get('environments', []) if e['environmentId'] == environmentId), {} - ) - profile = next((p for p in access_data.get('profiles', []) if p['papId'] == papId), {}) + for app_id, env_id, profile_id in accesses: + app = apps[app_id] + env = envs[env_id] + profile = profiles[profile_id] row = { - 'app_name': app['catalogAppName'], - 'app_id': appContainerId, - 'app_type': app['catalogAppDisplayName'], + 'app_name': app['catalogAppDisplayName'], + 'app_id': app_id, + 'app_type': app['catalogAppName'], 'app_description': app['appDescription'], - 'env_name': environment['environmentName'], - 'env_id': environmentId, - 'env_short_name': environment['alternateEnvironmentName'], - 'env_description': environment['environmentDescription'], + 'env_name': env['environmentName'], + 'env_id': env_id, + 'env_short_name': env['alternateEnvironmentName'], + 'env_description': env['environmentDescription'], 'profile_name': profile['papName'], - 'profile_id': papId, + 'profile_id': profile_id, 'profile_allows_console': app.get('consoleAccess', False), 'profile_allows_programmatic': app.get('programmaticAccess', False), 'profile_description': profile['papDescription'], '2_part_profile_format_allowed': app['supportsMultipleProfilesCheckoutConsole'], - 'env_properties': environment.get('profileEnvironmentProperties', {}), + 'env_properties': env.get('profileEnvironmentProperties', {}), } if row not in access_output: access_output.append(row) From 659d551e0a16c28b1a50fdf6ad6f3d3a1f9ce35e Mon Sep 17 00:00:00 2001 From: theborch Date: Mon, 10 Mar 2025 10:33:06 -0500 Subject: [PATCH 2/2] v2.1.0-rc.7 --- CHANGELOG.md | 22 ++++++++++++++++++++++ src/pybritive/__init__.py | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cf0147d..40fb60d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,28 @@ > As of v1.4.0, release candidates will be published in an effort to get new features out faster while still allowing > time for full QA testing before moving the release candidate to a full release. +## v2.1.0-rc.7 [2025-03-10] + +__What's New:__ + +* None + +__Enhancements:__ + +* None + +__Bug Fixes:__ + +* Fixed inverted `catalogAppDisplayName|catalogAppName` in `_set_available_profiles` and sped up generation. + +__Dependencies:__ + +* None + +__Other:__ + +* None + ## v2.1.0-rc.6 [2025-03-06] __What's New:__ diff --git a/src/pybritive/__init__.py b/src/pybritive/__init__.py index 5803823..1eb5a33 100644 --- a/src/pybritive/__init__.py +++ b/src/pybritive/__init__.py @@ -1 +1 @@ -__version__ = '2.1.0-rc.6' +__version__ = '2.1.0-rc.7'