kaqing 1.98.138__tar.gz → 1.98.139__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.
- {kaqing-1.98.138 → kaqing-1.98.139}/PKG-INFO +1 -1
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/batch.py +1 -12
- kaqing-1.98.139/adam/version.py +5 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/kaqing.egg-info/PKG-INFO +1 -1
- {kaqing-1.98.138 → kaqing-1.98.139}/kaqing.egg-info/SOURCES.txt +0 -1
- {kaqing-1.98.138 → kaqing-1.98.139}/setup.py +1 -1
- kaqing-1.98.138/adam/commands/user_entry.py +0 -133
- kaqing-1.98.138/adam/version.py +0 -5
- {kaqing-1.98.138 → kaqing-1.98.139}/README +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/__init__.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/app_session.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/apps.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/checks/__init__.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/checks/check.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/checks/check_context.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/checks/check_result.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/checks/check_utils.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/checks/compactionstats.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/checks/cpu.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/checks/disk.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/checks/gossip.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/checks/issue.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/checks/memory.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/checks/status.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/cli.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/cli_group.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/columns/__init__.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/columns/column.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/columns/columns.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/columns/compactions.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/columns/cpu.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/columns/dir_data.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/columns/dir_snapshots.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/columns/gossip.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/columns/host_id.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/columns/memory.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/columns/node_address.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/columns/node_load.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/columns/node_owns.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/columns/node_status.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/columns/node_tokens.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/columns/node_utils.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/columns/pod_name.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/columns/volume_cassandra.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/columns/volume_root.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/__init__.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/app.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/app_ping.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/bash.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/cd.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/check.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/cli_commands.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/command.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/command_helpers.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/commands_utils.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/cp.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/cql_utils.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/cqlsh.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/deploy/__init__.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/deploy/code_start.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/deploy/code_stop.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/deploy/code_utils.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/deploy/deploy.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/deploy/deploy_frontend.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/deploy/deploy_pod.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/deploy/deploy_utils.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/deploy/undeploy.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/deploy/undeploy_frontend.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/deploy/undeploy_pod.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/devices.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/exit.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/help.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/issues.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/login.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/logs.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/ls.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/medusa/__init__.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/medusa/medusa.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/medusa/medusa_backup.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/medusa/medusa_restore.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/medusa/medusa_show_backupjobs.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/medusa/medusa_show_restorejobs.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/nodetool.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/nodetool_commands.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/param_get.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/param_set.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/postgres/__init__.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/postgres/postgres.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/postgres/postgres_ls.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/postgres/postgres_preview.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/postgres/postgres_session.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/preview_table.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/pwd.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/reaper/__init__.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/reaper/reaper.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/reaper/reaper_forward.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/reaper/reaper_forward_stop.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/reaper/reaper_restart.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/reaper/reaper_run_abort.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/reaper/reaper_runs.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/reaper/reaper_runs_abort.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/reaper/reaper_schedule_activate.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/reaper/reaper_schedule_start.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/reaper/reaper_schedule_stop.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/reaper/reaper_schedules.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/reaper/reaper_session.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/reaper/reaper_status.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/repair/__init__.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/repair/repair.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/repair/repair_log.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/repair/repair_run.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/repair/repair_scan.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/repair/repair_stop.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/report.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/restart.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/rollout.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/shell.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/show/__init__.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/show/show.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/show/show_adam.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/show/show_app_actions.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/show/show_app_id.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/show/show_app_queues.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/show/show_cassandra_status.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/show/show_cassandra_version.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/show/show_commands.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/show/show_login.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/show/show_params.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/show/show_processes.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/show/show_repairs.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/show/show_storage.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/commands/watch.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/config.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/embedded_apps.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/embedded_params.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/k8s_utils/__init__.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/k8s_utils/cassandra_clusters.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/k8s_utils/cassandra_nodes.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/k8s_utils/custom_resources.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/k8s_utils/ingresses.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/k8s_utils/jobs.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/k8s_utils/kube_context.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/k8s_utils/pods.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/k8s_utils/secrets.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/k8s_utils/service_accounts.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/k8s_utils/services.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/k8s_utils/statefulsets.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/k8s_utils/volumes.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/log.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/pod_exec_result.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/repl.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/repl_commands.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/repl_session.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/repl_state.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/sso/__init__.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/sso/authenticator.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/sso/authn_ad.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/sso/authn_okta.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/sso/cred_cache.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/sso/id_token.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/sso/idp.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/sso/idp_login.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/sso/idp_session.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/sso/sso_config.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/adam/utils.py +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/kaqing.egg-info/dependency_links.txt +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/kaqing.egg-info/entry_points.txt +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/kaqing.egg-info/top_level.txt +0 -0
- {kaqing-1.98.138 → kaqing-1.98.139}/setup.cfg +0 -0
@@ -22,7 +22,6 @@ from adam.commands.report import Report
|
|
22
22
|
from adam.commands.restart import Restart
|
23
23
|
from adam.commands.rollout import RollOut
|
24
24
|
from adam.commands.show.show import Show, ShowCommandHelper
|
25
|
-
from adam.commands.user_entry import UserEntry
|
26
25
|
from adam.commands.watch import Watch
|
27
26
|
from adam.k8s_utils.kube_context import KubeContext
|
28
27
|
from adam.repl import enter_repl
|
@@ -261,16 +260,6 @@ def undeploy(kubeconfig: str, config: str, param: list[str], namespace: str, ext
|
|
261
260
|
run_command(Undeploy(), kubeconfig, config, param, None, namespace, None, extra_args)
|
262
261
|
|
263
262
|
|
264
|
-
@cli.command(context_settings=dict(ignore_unknown_options=True, allow_extra_args=True), cls=PodCommandHelper, help='Get cassandra log.')
|
265
|
-
@click.option('--kubeconfig', '-k', required=False, metavar='path', help='path to kubeconfig file')
|
266
|
-
@click.option('--config', default='params.yaml', metavar='path', help='path to kaqing parameters file')
|
267
|
-
@click.option('--param', '-v', multiple=True, metavar='<key>=<value>', help='parameter override')
|
268
|
-
@click.option('--namespace', '-n', required=False, metavar='namespace', help='Kubernetes namespace')
|
269
|
-
@click.argument('extra_args', nargs=-1, metavar='<pod>', type=click.UNPROCESSED)
|
270
|
-
def entry(kubeconfig: str, config: str, param: list[str], namespace: str, extra_args):
|
271
|
-
run_command(UserEntry(), kubeconfig, config, param, None, namespace, None, extra_args)
|
272
|
-
|
273
|
-
|
274
263
|
@cli.command(context_settings=dict(ignore_unknown_options=True, allow_extra_args=True), cls=ClusterOrPodCommandHelper, help='Watch pods in cluster.')
|
275
264
|
@click.option('--kubeconfig', '-k', required=False, metavar='path', help='path to kubeconfig file')
|
276
265
|
@click.option('--config', default='params.yaml', metavar='path', help='path to kaqing parameters file')
|
@@ -283,7 +272,7 @@ def watch(kubeconfig: str, config: str, param: list[str], cluster: str, namespac
|
|
283
272
|
|
284
273
|
|
285
274
|
def run_command(cmd: Command, kubeconfig: str, config: str, params: list[str], cluster:str, namespace: str, pod: str, extra_args):
|
286
|
-
is_user_entry =
|
275
|
+
is_user_entry = False
|
287
276
|
|
288
277
|
KubeContext.init_config(kubeconfig, is_user_entry=is_user_entry)
|
289
278
|
if not KubeContext.init_params(config, params, is_user_entry=is_user_entry):
|
@@ -1,133 +0,0 @@
|
|
1
|
-
from functools import partial
|
2
|
-
from http.server import BaseHTTPRequestHandler, HTTPServer
|
3
|
-
import os
|
4
|
-
import re
|
5
|
-
import subprocess
|
6
|
-
import signal
|
7
|
-
import threading
|
8
|
-
import traceback
|
9
|
-
|
10
|
-
from adam.commands.deploy.code_utils import get_available_port
|
11
|
-
from adam.config import Config
|
12
|
-
from adam.sso.idp import Idp
|
13
|
-
from adam.app_session import AppSession, IdpLogin
|
14
|
-
from adam.apps import Apps
|
15
|
-
from adam.commands.command import Command
|
16
|
-
from adam.repl_state import ReplState
|
17
|
-
from adam.utils import log2
|
18
|
-
|
19
|
-
class TokenHandler(BaseHTTPRequestHandler):
|
20
|
-
def __init__(self, port: int, user: str, idp_token: str, *args, **kwargs):
|
21
|
-
self.port = port
|
22
|
-
self.user = user
|
23
|
-
self.idp_token = idp_token
|
24
|
-
super().__init__(*args, **kwargs)
|
25
|
-
|
26
|
-
def log_request(self, code='-', size='-'):
|
27
|
-
pass
|
28
|
-
|
29
|
-
def do_GET(self):
|
30
|
-
Config().debug(f'Token request from cient: {self.client_address}\r')
|
31
|
-
ports = self.get_user_ports()
|
32
|
-
Config().debug(f'ports: {ports}\r')
|
33
|
-
if os.getenv('CHECK_CLIENT_PORT', 'true').lower() != 'true' or self.client_address[1] in ports:
|
34
|
-
self.send_response(200)
|
35
|
-
self.send_header('Content-type', 'text/plain')
|
36
|
-
self.end_headers()
|
37
|
-
self.wfile.write(self.idp_token.encode('utf8'))
|
38
|
-
else:
|
39
|
-
self.send_response(403)
|
40
|
-
self.send_header('Content-type', 'text/plain')
|
41
|
-
self.end_headers()
|
42
|
-
self.wfile.write(f'Port: {self.port} has not been opened by you.\n'.encode('utf8'))
|
43
|
-
|
44
|
-
def get_user_ports(self):
|
45
|
-
# this needs SYS_PTRACE capability with the container
|
46
|
-
ports = []
|
47
|
-
|
48
|
-
# curl 627299 sahn 5u IPv4 542049941 0t0 TCP localhost:39524->localhost:8001 (ESTABLISHED)
|
49
|
-
command = ['bash', '-c', f"lsof -i -P 2> /dev/null | grep {self.user} | grep localhost" + " | awk '{print $9}'"]
|
50
|
-
result = subprocess.run(command, capture_output=True, text=True, check=True)
|
51
|
-
for line in result.stdout.split('\n'):
|
52
|
-
groups = re.match(r'localhost:(.*?)->localhost:(.*)$', line)
|
53
|
-
if groups:
|
54
|
-
ports.append(int(groups[1]))
|
55
|
-
|
56
|
-
return ports
|
57
|
-
|
58
|
-
class UserEntry(Command):
|
59
|
-
COMMAND = 'entry'
|
60
|
-
|
61
|
-
# the singleton pattern
|
62
|
-
def __new__(cls, *args, **kwargs):
|
63
|
-
if not hasattr(cls, 'instance'): cls.instance = super(UserEntry, cls).__new__(cls)
|
64
|
-
|
65
|
-
return cls.instance
|
66
|
-
|
67
|
-
def __init__(self, successor: Command=None):
|
68
|
-
super().__init__(successor)
|
69
|
-
|
70
|
-
def command(self):
|
71
|
-
return UserEntry.COMMAND
|
72
|
-
|
73
|
-
def run_token_server(port: int, user: str, idp_token: str):
|
74
|
-
server_address = ('localhost', port)
|
75
|
-
handler = partial(TokenHandler, port, user, idp_token)
|
76
|
-
httpd = HTTPServer(server_address, handler)
|
77
|
-
Config().debug(f"Serving on port {port}")
|
78
|
-
httpd.serve_forever()
|
79
|
-
|
80
|
-
def run(self, cmd: str, state: ReplState):
|
81
|
-
def custom_handler(signum, frame):
|
82
|
-
AppSession.ctrl_c_entered = True
|
83
|
-
|
84
|
-
signal.signal(signal.SIGINT, custom_handler)
|
85
|
-
|
86
|
-
if not(args := self.args(cmd)):
|
87
|
-
return super().run(cmd, state)
|
88
|
-
|
89
|
-
state, args = self.apply_state(args, state)
|
90
|
-
args, debug = Command.extract_options(args, 'd')
|
91
|
-
if debug:
|
92
|
-
Config().set('debug.show-out', True)
|
93
|
-
|
94
|
-
username: str = None
|
95
|
-
if len(args) > 0:
|
96
|
-
username = args[0]
|
97
|
-
|
98
|
-
login: IdpLogin = None
|
99
|
-
while not login:
|
100
|
-
try:
|
101
|
-
if not(host := Apps.app_host('c3', 'c3', state.namespace)):
|
102
|
-
log2('Cannot locate ingress for app.')
|
103
|
-
username = None
|
104
|
-
continue
|
105
|
-
|
106
|
-
if not (login := Idp.login(host, username=username, use_token_from_env=False, use_cached_creds=False)):
|
107
|
-
log2('Invalid username/password. Please try again.')
|
108
|
-
username = None
|
109
|
-
except Exception as e:
|
110
|
-
log2(e)
|
111
|
-
|
112
|
-
Config().debug(traceback.format_exc())
|
113
|
-
|
114
|
-
server_port = get_available_port()
|
115
|
-
server_thread = threading.Thread(target=UserEntry.run_token_server, args=(server_port, login.shell_user(), login.ser()), daemon=True)
|
116
|
-
server_thread.start()
|
117
|
-
|
118
|
-
sh = f'{os.getcwd()}/login.sh'
|
119
|
-
if not os.path.exists(sh):
|
120
|
-
sh = f'{os.getcwd()}/docker/login.sh'
|
121
|
-
|
122
|
-
if os.getenv('PASS_DOWN_IDP_TOKEN', "false").lower() == "true":
|
123
|
-
os.system(f'{sh} {login.shell_user()} {server_port} {login.ser()}')
|
124
|
-
else:
|
125
|
-
os.system(f'{sh} {login.shell_user()} {server_port}')
|
126
|
-
|
127
|
-
return state
|
128
|
-
|
129
|
-
def completion(self, _: ReplState):
|
130
|
-
return {}
|
131
|
-
|
132
|
-
def help(self, _: ReplState):
|
133
|
-
return f'{UserEntry.COMMAND}\t ttyd user entry'
|
kaqing-1.98.138/adam/version.py
DELETED
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
|
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
|