pybritive 2.2.0__tar.gz → 2.2.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pybritive-2.2.0/src/pybritive.egg-info → pybritive-2.2.2}/PKG-INFO +1 -1
- pybritive-2.2.2/src/pybritive/__init__.py +1 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/britive_cli.py +64 -57
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/helpers/cloud_credential_printer.py +7 -6
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/helpers/kube_config_builder.py +8 -4
- {pybritive-2.2.0 → pybritive-2.2.2/src/pybritive.egg-info}/PKG-INFO +1 -1
- pybritive-2.2.0/src/pybritive/__init__.py +0 -1
- {pybritive-2.2.0 → pybritive-2.2.2}/LICENSE +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/README.md +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/pyproject.toml +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/setup.cfg +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/choices/__init__.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/choices/backend.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/choices/browser.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/choices/mode.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/choices/output_format.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/choices/profile_type.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/choices/ssh_key_source.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/choices/ssh_push_public_key.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/cli_interface.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/commands/__init__.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/commands/api.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/commands/aws.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/commands/cache.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/commands/checkin.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/commands/checkout.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/commands/clear.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/commands/configure.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/commands/login.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/commands/logout.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/commands/ls.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/commands/request.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/commands/secret.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/commands/ssh.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/commands/user.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/completers/__init__.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/completers/api.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/completers/api_command.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/completers/bash_gte_42.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/completers/powershell_completion.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/completers/profile.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/helpers/__init__.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/helpers/api_method_argument_decorator.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/helpers/aws_credential_process.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/helpers/build_britive.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/helpers/cache.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/helpers/config.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/helpers/credentials.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/helpers/encryption.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/helpers/k8s_exec.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/helpers/k8s_exec_credential_builder.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/helpers/profile_argument_decorator.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/helpers/split.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/options/__init__.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/options/alias.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/options/aws_console_duration.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/options/aws_credentials_file.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/options/aws_profile.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/options/blocktime.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/options/britive_options.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/options/browser.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/options/checked_out.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/options/configure_alias.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/options/configure_backend.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/options/configure_prompt.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/options/configure_tenant.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/options/console.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/options/extend.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/options/federation_provider.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/options/file.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/options/force_renew.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/options/gcloud_key_file.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/options/justification.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/options/maxpolltime.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/options/mode.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/options/otp.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/options/output_format.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/options/passphrase.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/options/profile_type.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/options/query.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/options/silent.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/options/ssh_hostname.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/options/ssh_key_source.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/options/ssh_port.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/options/ssh_push_public_key.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/options/ssh_username.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/options/tenant.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/options/ticket_id.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/options/ticket_type.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/options/token.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/options/verbose.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive/options/version.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive.egg-info/SOURCES.txt +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive.egg-info/dependency_links.txt +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive.egg-info/entry_points.txt +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive.egg-info/requires.txt +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/src/pybritive.egg-info/top_level.txt +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/tests/test_0100_version.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/tests/test_0200_configure.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/tests/test_0300_login.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/tests/test_0400_ls.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/tests/test_0500_api.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/tests/test_0600_secret.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/tests/test_0700_cache.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/tests/test_0800_checkout.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/tests/test_0900_checkin.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/tests/test_1000_clear.py +0 -0
- {pybritive-2.2.0 → pybritive-2.2.2}/tests/test_1100_logout.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = '2.2.2'
|
|
@@ -350,7 +350,12 @@ class BritiveCli:
|
|
|
350
350
|
name = item['resourceName']
|
|
351
351
|
if name not in found_resource_names:
|
|
352
352
|
resources.append(
|
|
353
|
-
{
|
|
353
|
+
{
|
|
354
|
+
'resourceId': item['resourceId'],
|
|
355
|
+
'resourceName': name,
|
|
356
|
+
'resourceLabels': item['resourceLabels'],
|
|
357
|
+
'responseTemplates': item['responseTemplates'],
|
|
358
|
+
}
|
|
354
359
|
)
|
|
355
360
|
found_resource_names.append(name)
|
|
356
361
|
self.print(resources, ignore_silent=True)
|
|
@@ -460,26 +465,20 @@ class BritiveCli:
|
|
|
460
465
|
data.append(row)
|
|
461
466
|
self.print(data, ignore_silent=True)
|
|
462
467
|
|
|
463
|
-
# temporary fix till the new API is updated to return `
|
|
464
|
-
def
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
for env in profile.get('environments', [])
|
|
478
|
-
if env['environmentId'] == env_id
|
|
479
|
-
),
|
|
480
|
-
{},
|
|
481
|
-
)
|
|
482
|
-
return {}
|
|
468
|
+
# temporary fix till the new API is updated to return `sessionAttributes`
|
|
469
|
+
def _get_missing_session_attributes(self, app_id: str, profile_id: str) -> dict:
|
|
470
|
+
if not self.listed_profiles:
|
|
471
|
+
self.listed_profiles = self.b.my_access.list_profiles()
|
|
472
|
+
return next(
|
|
473
|
+
(
|
|
474
|
+
profile['sessionAttributes']
|
|
475
|
+
for app in self.listed_profiles
|
|
476
|
+
if app['appContainerId'] == app_id
|
|
477
|
+
for profile in app.get('profiles', [])
|
|
478
|
+
if profile['profileId'] == profile_id
|
|
479
|
+
),
|
|
480
|
+
[],
|
|
481
|
+
)
|
|
483
482
|
|
|
484
483
|
def _set_available_profiles(self, from_cache_command=False, profile_type: Optional[str] = None):
|
|
485
484
|
if not self.available_profiles:
|
|
@@ -504,23 +503,23 @@ class BritiveCli:
|
|
|
504
503
|
env = envs[env_id]
|
|
505
504
|
profile = profiles[profile_id]
|
|
506
505
|
row = {
|
|
507
|
-
'
|
|
506
|
+
'2_part_profile_format_allowed': app['requiresHierarchicalModel'],
|
|
507
|
+
'app_description': app['appDescription'],
|
|
508
508
|
'app_id': app_id,
|
|
509
|
+
'app_name': app['catalogAppDisplayName'],
|
|
509
510
|
'app_type': app['catalogAppName'],
|
|
510
|
-
'
|
|
511
|
-
'env_name': env['environmentName'],
|
|
511
|
+
'env_description': env['environmentDescription'],
|
|
512
512
|
'env_id': env_id,
|
|
513
|
+
'env_name': env['environmentName'],
|
|
514
|
+
'env_properties': env['profileEnvironmentProperties'],
|
|
513
515
|
'env_short_name': env['alternateEnvironmentName'],
|
|
514
|
-
'env_description': env['environmentDescription'],
|
|
515
|
-
'profile_name': profile['papName'],
|
|
516
|
-
'profile_id': profile_id,
|
|
517
516
|
'profile_allows_console': app.get('consoleAccess', False),
|
|
518
517
|
'profile_allows_programmatic': app.get('programmaticAccess', False),
|
|
519
518
|
'profile_description': profile['papDescription'],
|
|
520
|
-
'
|
|
521
|
-
'
|
|
522
|
-
|
|
523
|
-
|
|
519
|
+
'profile_id': profile_id,
|
|
520
|
+
'profile_name': profile['papName'],
|
|
521
|
+
'session_attributes': profile.get(
|
|
522
|
+
'sessionAttributes', self._get_missing_session_attributes(app_id, profile_id)
|
|
524
523
|
),
|
|
525
524
|
}
|
|
526
525
|
if row not in access_output:
|
|
@@ -534,21 +533,21 @@ class BritiveCli:
|
|
|
534
533
|
profiles = profiles['data']
|
|
535
534
|
for item in profiles:
|
|
536
535
|
row = {
|
|
537
|
-
'
|
|
536
|
+
'2_part_profile_format_allowed': False,
|
|
537
|
+
'app_description': None,
|
|
538
538
|
'app_id': None,
|
|
539
|
+
'app_name': None,
|
|
539
540
|
'app_type': 'Resources',
|
|
540
|
-
'
|
|
541
|
-
'env_name': item['resourceName'],
|
|
541
|
+
'env_description': None,
|
|
542
542
|
'env_id': item['resourceId'],
|
|
543
|
+
'env_name': item['resourceName'],
|
|
544
|
+
'env_properties': item.get('resourceLabels', {}),
|
|
543
545
|
'env_short_name': item['resourceName'],
|
|
544
|
-
'env_description': None,
|
|
545
|
-
'profile_name': item['profileName'],
|
|
546
|
-
'profile_id': item['profileId'],
|
|
547
546
|
'profile_allows_console': False,
|
|
548
547
|
'profile_allows_programmatic': True,
|
|
549
548
|
'profile_description': None,
|
|
550
|
-
'
|
|
551
|
-
'
|
|
549
|
+
'profile_id': item['profileId'],
|
|
550
|
+
'profile_name': item['profileName'],
|
|
552
551
|
}
|
|
553
552
|
data.append(row)
|
|
554
553
|
self.available_profiles = data
|
|
@@ -579,6 +578,7 @@ class BritiveCli:
|
|
|
579
578
|
'profile': p['profile_name'],
|
|
580
579
|
'url': url,
|
|
581
580
|
'cert': cert,
|
|
581
|
+
'session_attributes': p['session_attributes'],
|
|
582
582
|
}
|
|
583
583
|
)
|
|
584
584
|
|
|
@@ -762,19 +762,22 @@ class BritiveCli:
|
|
|
762
762
|
# attempt to automatically checkout console access instead
|
|
763
763
|
# this is a cli only feature - not available in the sdk
|
|
764
764
|
self.print('no programmatic access available - checking out console access instead')
|
|
765
|
-
return
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
765
|
+
return {
|
|
766
|
+
**self._checkout(
|
|
767
|
+
app_name,
|
|
768
|
+
blocktime,
|
|
769
|
+
env_name,
|
|
770
|
+
justification,
|
|
771
|
+
maxpolltime,
|
|
772
|
+
otp,
|
|
773
|
+
profile_name,
|
|
774
|
+
False,
|
|
775
|
+
ticket_id,
|
|
776
|
+
ticket_type,
|
|
777
|
+
mode,
|
|
778
|
+
),
|
|
779
|
+
'console-fallback': True,
|
|
780
|
+
}
|
|
778
781
|
raise e
|
|
779
782
|
|
|
780
783
|
@staticmethod
|
|
@@ -861,11 +864,12 @@ class BritiveCli:
|
|
|
861
864
|
self._extend_checkout(profile, console)
|
|
862
865
|
return None
|
|
863
866
|
|
|
864
|
-
|
|
867
|
+
self.verbose_checkout = verbose
|
|
865
868
|
app_type = None
|
|
866
869
|
cached_credentials_found = False
|
|
870
|
+
console_fallback = False
|
|
871
|
+
credentials = None
|
|
867
872
|
k8s_processor = None
|
|
868
|
-
self.verbose_checkout = verbose
|
|
869
873
|
|
|
870
874
|
# handle kube-exec since the profile is actually going to be passed in via another method
|
|
871
875
|
# and perform some basic validation so we don't waste time performing a checkout when we
|
|
@@ -924,6 +928,7 @@ class BritiveCli:
|
|
|
924
928
|
response = self._checkout(**params)
|
|
925
929
|
app_type = self._get_app_type(response['appContainerId'])
|
|
926
930
|
credentials = response['credentials']
|
|
931
|
+
console_fallback = response.get('console-fallback')
|
|
927
932
|
|
|
928
933
|
# this handles the --force-renew flag
|
|
929
934
|
# lets check to see if we should checkin this profile first and check it out again
|
|
@@ -937,12 +942,13 @@ class BritiveCli:
|
|
|
937
942
|
response = self._checkout(**params)
|
|
938
943
|
cached_credentials_found = False # need to write new creds to cache
|
|
939
944
|
credentials = response['credentials']
|
|
945
|
+
console_fallback = response.get('console-fallback')
|
|
940
946
|
|
|
941
947
|
if mode in self.cachable_modes and not cached_credentials_found:
|
|
942
948
|
Cache(passphrase=passphrase).save_credentials(
|
|
943
949
|
profile_name=alias or profile, credentials=credentials, mode=mode
|
|
944
950
|
)
|
|
945
|
-
return app_type, credentials, k8s_processor
|
|
951
|
+
return app_type, console_fallback, credentials, k8s_processor
|
|
946
952
|
|
|
947
953
|
def checkout(
|
|
948
954
|
self,
|
|
@@ -967,6 +973,7 @@ class BritiveCli:
|
|
|
967
973
|
if self._profile_is_for_resource(profile=profile, profile_type=profile_type):
|
|
968
974
|
app_type = 'Resources'
|
|
969
975
|
k8s_processor = None
|
|
976
|
+
console_fallback = False
|
|
970
977
|
credentials = self._resource_checkout(
|
|
971
978
|
blocktime=blocktime,
|
|
972
979
|
justification=justification,
|
|
@@ -976,7 +983,7 @@ class BritiveCli:
|
|
|
976
983
|
ticket_type=ticket_type,
|
|
977
984
|
)
|
|
978
985
|
else:
|
|
979
|
-
app_type, credentials, k8s_processor = self._access_checkout(
|
|
986
|
+
app_type, console_fallback, credentials, k8s_processor = self._access_checkout(
|
|
980
987
|
alias=alias,
|
|
981
988
|
blocktime=blocktime,
|
|
982
989
|
console=console,
|
|
@@ -998,7 +1005,7 @@ class BritiveCli:
|
|
|
998
1005
|
|
|
999
1006
|
self.__get_cloud_credential_printer(
|
|
1000
1007
|
app_type,
|
|
1001
|
-
console,
|
|
1008
|
+
console or console_fallback,
|
|
1002
1009
|
mode,
|
|
1003
1010
|
alias or profile,
|
|
1004
1011
|
self.silent,
|
|
@@ -253,11 +253,12 @@ class GcpCloudCredentialPrinter(CloudCredentialPrinter):
|
|
|
253
253
|
def print_json(self):
|
|
254
254
|
self.cli.print(json.dumps(self.credentials, indent=2), ignore_silent=True)
|
|
255
255
|
self.cli.print('', ignore_silent=True)
|
|
256
|
-
self.
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
256
|
+
if not self.console:
|
|
257
|
+
self.cli.print(
|
|
258
|
+
f'Run command: gcloud auth activate-service-account {self.credentials.get("client_email")} '
|
|
259
|
+
'--key-file <path-where-above-json-is-stored>',
|
|
260
|
+
ignore_silent=True,
|
|
261
|
+
)
|
|
261
262
|
|
|
262
263
|
def print_gcloudauth(self):
|
|
263
264
|
# get path to gcloud key file
|
|
@@ -271,7 +272,7 @@ class GcpCloudCredentialPrinter(CloudCredentialPrinter):
|
|
|
271
272
|
path.write_text(json.dumps(self.credentials, indent=2), encoding='utf-8')
|
|
272
273
|
|
|
273
274
|
self.cli.print(
|
|
274
|
-
f
|
|
275
|
+
f'gcloud auth activate-service-account {self.credentials["client_email"]} --key-file {path!s}',
|
|
275
276
|
ignore_silent=True,
|
|
276
277
|
)
|
|
277
278
|
|
|
@@ -69,7 +69,7 @@ def parse_profiles(profiles, aliases):
|
|
|
69
69
|
cluster_names = {}
|
|
70
70
|
assigned_aliases = []
|
|
71
71
|
for profile in profiles:
|
|
72
|
-
env_profile = f
|
|
72
|
+
env_profile = f'{sanitize(profile["env"])}-{sanitize(profile["profile"].lower())}'
|
|
73
73
|
if env_profile not in cluster_names:
|
|
74
74
|
app = BritiveCli.escape_profile_element(profile['app'])
|
|
75
75
|
env = BritiveCli.escape_profile_element(profile['env'])
|
|
@@ -84,8 +84,9 @@ def parse_profiles(profiles, aliases):
|
|
|
84
84
|
'url': profile['url'],
|
|
85
85
|
'cert': profile['cert'],
|
|
86
86
|
'escaped_profile': escaped_profile_str,
|
|
87
|
-
'profile': f
|
|
87
|
+
'profile': f'{profile["app"]}/{profile["env"]}/{profile["profile"]}'.lower(),
|
|
88
88
|
'alias': alias,
|
|
89
|
+
'session_attributes': profile['session_attributes'],
|
|
89
90
|
}
|
|
90
91
|
cluster_names[env_profile]['apps'].append(sanitize(profile['app']))
|
|
91
92
|
return [cluster_names, assigned_aliases]
|
|
@@ -129,7 +130,6 @@ def build_tenant_config(tenant, cluster_names, username, cli: BritiveCli):
|
|
|
129
130
|
)
|
|
130
131
|
contexts = []
|
|
131
132
|
clusters = []
|
|
132
|
-
|
|
133
133
|
for env_profile, details in cluster_names.items():
|
|
134
134
|
if len(details['apps']) == 1:
|
|
135
135
|
names = [env_profile]
|
|
@@ -162,7 +162,11 @@ def build_tenant_config(tenant, cluster_names, username, cli: BritiveCli):
|
|
|
162
162
|
contexts.append(
|
|
163
163
|
{
|
|
164
164
|
'name': details.get('alias') or f'{tenant}-{name}',
|
|
165
|
-
'context': {
|
|
165
|
+
'context': {
|
|
166
|
+
'cluster': f'{tenant}-{name}',
|
|
167
|
+
'user': username,
|
|
168
|
+
**{attr['mappingName']: attr['attributeValue'] for attr in details['session_attributes']},
|
|
169
|
+
},
|
|
166
170
|
}
|
|
167
171
|
)
|
|
168
172
|
return [clusters, contexts, users]
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = '2.2.0'
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|