Skip to content

Commit c662d2f

Browse files
authored
Merge pull request #191 from britive/v2.1.0-rc.7
v2.1.0-rc.7
2 parents 2d1acfa + 659d551 commit c662d2f

File tree

4 files changed

+44
-20
lines changed

4 files changed

+44
-20
lines changed

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,28 @@
33
> As of v1.4.0, release candidates will be published in an effort to get new features out faster while still allowing
44
> time for full QA testing before moving the release candidate to a full release.
55
6+
## v2.1.0-rc.7 [2025-03-10]
7+
8+
__What's New:__
9+
10+
* None
11+
12+
__Enhancements:__
13+
14+
* None
15+
16+
__Bug Fixes:__
17+
18+
* Fixed inverted `catalogAppDisplayName|catalogAppName` in `_set_available_profiles` and sped up generation.
19+
20+
__Dependencies:__
21+
22+
* None
23+
24+
__Other:__
25+
26+
* None
27+
628
## v2.1.0-rc.6 [2025-03-06]
729

830
__What's New:__

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
beautifulsoup4
22
boto3
3-
britive~=4.0
3+
britive>=4.1.2,<5.0
44
certifi
55
charset-normalizer
66
click>=8.1.7

src/pybritive/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '2.1.0-rc.6'
1+
__version__ = '2.1.0-rc.7'

src/pybritive/britive_cli.py

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -470,32 +470,34 @@ def _set_available_profiles(self, from_cache_command=False, profile_type: Option
470470
access_data['accesses']
471471
) and len({a['papId'] for a in access_data['accesses']}) < access_limit:
472472
increase += max(25, round(access_data['count'] * 0.25))
473+
apps = {a['appContainerId']: a for a in access_data.get('apps', [])}
474+
envs = {e['environmentId']: e for e in access_data.get('environments', [])}
475+
profiles = {p['papId']: p for p in access_data.get('profiles', [])}
476+
accesses = [
477+
tuple([a['appContainerId'], a['environmentId'], a['papId']])
478+
for a in access_data.get('accesses', [])
479+
]
473480
access_output = []
474-
for access in access_data['accesses']:
475-
appContainerId = access['appContainerId']
476-
environmentId = access['environmentId']
477-
papId = access['papId']
478-
app = next((a for a in access_data.get('apps', []) if a['appContainerId'] == appContainerId), {})
479-
environment = next(
480-
(e for e in access_data.get('environments', []) if e['environmentId'] == environmentId), {}
481-
)
482-
profile = next((p for p in access_data.get('profiles', []) if p['papId'] == papId), {})
481+
for app_id, env_id, profile_id in accesses:
482+
app = apps[app_id]
483+
env = envs[env_id]
484+
profile = profiles[profile_id]
483485
row = {
484-
'app_name': app['catalogAppName'],
485-
'app_id': appContainerId,
486-
'app_type': app['catalogAppDisplayName'],
486+
'app_name': app['catalogAppDisplayName'],
487+
'app_id': app_id,
488+
'app_type': app['catalogAppName'],
487489
'app_description': app['appDescription'],
488-
'env_name': environment['environmentName'],
489-
'env_id': environmentId,
490-
'env_short_name': environment['alternateEnvironmentName'],
491-
'env_description': environment['environmentDescription'],
490+
'env_name': env['environmentName'],
491+
'env_id': env_id,
492+
'env_short_name': env['alternateEnvironmentName'],
493+
'env_description': env['environmentDescription'],
492494
'profile_name': profile['papName'],
493-
'profile_id': papId,
495+
'profile_id': profile_id,
494496
'profile_allows_console': app.get('consoleAccess', False),
495497
'profile_allows_programmatic': app.get('programmaticAccess', False),
496498
'profile_description': profile['papDescription'],
497499
'2_part_profile_format_allowed': app['supportsMultipleProfilesCheckoutConsole'],
498-
'env_properties': environment.get('profileEnvironmentProperties', {}),
500+
'env_properties': env.get('profileEnvironmentProperties', {}),
499501
}
500502
if row not in access_output:
501503
access_output.append(row)

0 commit comments

Comments
 (0)