pybritive 2.3.1__tar.gz → 2.3.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.3.1/src/pybritive.egg-info → pybritive-2.3.2}/PKG-INFO +1 -1
- pybritive-2.3.2/src/pybritive/__init__.py +1 -0
- pybritive-2.3.2/src/pybritive/completers/__init__.py +22 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/completers/api.py +7 -4
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/completers/api_command.py +7 -4
- {pybritive-2.3.1 → pybritive-2.3.2/src/pybritive.egg-info}/PKG-INFO +1 -1
- pybritive-2.3.1/src/pybritive/__init__.py +0 -1
- pybritive-2.3.1/src/pybritive/completers/__init__.py +0 -2
- {pybritive-2.3.1 → pybritive-2.3.2}/LICENSE +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/README.md +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/pyproject.toml +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/setup.cfg +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/britive_cli.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/choices/__init__.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/choices/backend.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/choices/browser.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/choices/mode.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/choices/output_format.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/choices/profile_type.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/choices/ssh_key_source.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/choices/ssh_push_public_key.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/cli_interface.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/commands/__init__.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/commands/api.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/commands/aws.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/commands/cache.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/commands/checkin.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/commands/checkout.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/commands/clear.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/commands/configure.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/commands/login.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/commands/logout.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/commands/ls.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/commands/request.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/commands/secret.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/commands/ssh.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/commands/user.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/completers/bash_gte_42.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/completers/powershell_completion.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/completers/profile.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/helpers/__init__.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/helpers/api_method_argument_decorator.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/helpers/aws_credential_process.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/helpers/build_britive.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/helpers/cache.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/helpers/cloud_credential_printer.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/helpers/config.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/helpers/credentials.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/helpers/encryption.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/helpers/k8s_exec.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/helpers/k8s_exec_credential_builder.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/helpers/kube_config_builder.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/helpers/profile_argument_decorator.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/helpers/split.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/options/__init__.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/options/alias.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/options/aws_console_duration.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/options/aws_credentials_file.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/options/aws_profile.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/options/blocktime.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/options/britive_options.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/options/browser.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/options/checked_out.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/options/configure_alias.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/options/configure_backend.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/options/configure_prompt.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/options/configure_tenant.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/options/console.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/options/extend.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/options/federation_provider.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/options/file.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/options/force_renew.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/options/gcloud_key_file.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/options/justification.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/options/maxpolltime.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/options/mode.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/options/otp.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/options/output_format.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/options/passphrase.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/options/profile_type.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/options/query.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/options/search_text.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/options/silent.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/options/ssh_hostname.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/options/ssh_key_source.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/options/ssh_port.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/options/ssh_push_public_key.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/options/ssh_username.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/options/tenant.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/options/ticket_id.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/options/ticket_type.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/options/token.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/options/verbose.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive/options/version.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive.egg-info/SOURCES.txt +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive.egg-info/dependency_links.txt +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive.egg-info/entry_points.txt +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive.egg-info/requires.txt +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/src/pybritive.egg-info/top_level.txt +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/tests/test_0100_version.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/tests/test_0200_configure.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/tests/test_0300_login.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/tests/test_0400_ls.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/tests/test_0500_api.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/tests/test_0600_secret.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/tests/test_0700_cache.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/tests/test_0800_checkout.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/tests/test_0900_checkin.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/tests/test_1000_clear.py +0 -0
- {pybritive-2.3.1 → pybritive-2.3.2}/tests/test_1100_logout.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = '2.3.2'
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# register the completion scripts since they are not required to be registered anywhere else
|
|
2
|
+
import os
|
|
3
|
+
from typing import Optional
|
|
4
|
+
|
|
5
|
+
from . import bash_gte_42, powershell_completion # noqa: F401
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def get_tenant_for_api_completion() -> Optional[str]:
|
|
9
|
+
"""Resolve the tenant for API completion from environment or config."""
|
|
10
|
+
tenant = os.getenv('BRITIVE_TENANT')
|
|
11
|
+
if not tenant:
|
|
12
|
+
from pybritive.helpers.config import ConfigManager # noqa: PLC0415
|
|
13
|
+
|
|
14
|
+
config = ConfigManager(None)
|
|
15
|
+
config.load()
|
|
16
|
+
if config.default_tenant and config.default_tenant in config.tenants:
|
|
17
|
+
tenant = config.tenants[config.default_tenant].get('name')
|
|
18
|
+
if not tenant:
|
|
19
|
+
return None
|
|
20
|
+
if not tenant.endswith('.britive-app.com'):
|
|
21
|
+
tenant = f'{tenant.strip()}.britive-app.com'
|
|
22
|
+
return tenant
|
|
@@ -4,13 +4,16 @@ import inspect
|
|
|
4
4
|
from britive.britive import Britive
|
|
5
5
|
from click.shell_completion import CompletionItem
|
|
6
6
|
|
|
7
|
+
from pybritive.completers import get_tenant_for_api_completion
|
|
8
|
+
|
|
7
9
|
|
|
8
10
|
def api_completer(ctx, param, incomplete):
|
|
9
11
|
# create an instance of the Britive class, so we can inspect it
|
|
10
|
-
#
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
# using the user's configured tenant to avoid DNS resolution issues
|
|
13
|
+
tenant = get_tenant_for_api_completion()
|
|
14
|
+
if not tenant:
|
|
15
|
+
return []
|
|
16
|
+
b = Britive(token='ignore', tenant=tenant, query_features=False)
|
|
14
17
|
|
|
15
18
|
# parse the incomplete command, so we can determine where in the "hierarchy" we are
|
|
16
19
|
# and what commands/subcommands the user should be presented with
|
|
@@ -4,14 +4,17 @@ from importlib.metadata import version
|
|
|
4
4
|
|
|
5
5
|
from britive.britive import Britive
|
|
6
6
|
|
|
7
|
+
from pybritive.completers import get_tenant_for_api_completion
|
|
8
|
+
|
|
7
9
|
|
|
8
10
|
def get_dynamic_method_parameters(method):
|
|
9
11
|
try:
|
|
10
12
|
# create an instance of the Britive class, so we can inspect it
|
|
11
|
-
#
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
# using the user's configured tenant to avoid DNS resolution issues
|
|
14
|
+
tenant = get_tenant_for_api_completion()
|
|
15
|
+
if not tenant:
|
|
16
|
+
return []
|
|
17
|
+
b = Britive(token='ignore', tenant=tenant, query_features=False)
|
|
15
18
|
|
|
16
19
|
# parse the method, so we can determine where in the "hierarchy" we are
|
|
17
20
|
# and what commands/subcommands the user should be presented with
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = '2.3.1'
|
|
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
|
|
File without changes
|