kaqing 1.98.86__tar.gz → 1.98.87__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.
Potentially problematic release.
This version of kaqing might be problematic. Click here for more details.
- {kaqing-1.98.86 → kaqing-1.98.87}/PKG-INFO +1 -1
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/app_session.py +1 -1
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/postgres/postgres_session.py +61 -54
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/embedded_params.py +1 -1
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/sso/authenticator.py +1 -1
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/sso/authn_ad.py +4 -1
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/sso/authn_okta.py +5 -1
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/sso/idp.py +3 -3
- kaqing-1.98.87/adam/version.py +5 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/kaqing.egg-info/PKG-INFO +1 -1
- {kaqing-1.98.86 → kaqing-1.98.87}/setup.py +1 -1
- kaqing-1.98.86/adam/version.py +0 -5
- {kaqing-1.98.86 → kaqing-1.98.87}/README +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/__init__.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/apps.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/batch.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/checks/__init__.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/checks/check.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/checks/check_context.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/checks/check_result.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/checks/check_utils.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/checks/compactionstats.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/checks/cpu.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/checks/disk.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/checks/gossip.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/checks/issue.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/checks/memory.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/checks/status.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/cli.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/cli_group.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/columns/__init__.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/columns/column.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/columns/columns.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/columns/compactions.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/columns/cpu.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/columns/dir_data.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/columns/dir_snapshots.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/columns/gossip.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/columns/host_id.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/columns/memory.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/columns/node_address.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/columns/node_load.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/columns/node_owns.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/columns/node_status.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/columns/node_tokens.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/columns/node_utils.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/columns/pod_name.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/columns/volume_cassandra.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/columns/volume_root.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/__init__.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/app.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/app_ping.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/bash.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/cd.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/check.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/cli_commands.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/command.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/command_helpers.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/commands_utils.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/cp.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/cql_utils.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/cqlsh.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/devices.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/exit.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/frontend/__init__.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/frontend/code_start.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/frontend/code_stop.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/frontend/code_utils.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/frontend/setup.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/frontend/setup_frontend.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/frontend/teardown.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/frontend/teardown_frontend.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/help.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/issues.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/login.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/logs.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/ls.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/medusa/__init__.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/medusa/medusa.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/medusa/medusa_backup.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/medusa/medusa_restore.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/medusa/medusa_show_backupjobs.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/medusa/medusa_show_restorejobs.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/nodetool.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/nodetool_commands.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/param_get.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/param_set.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/postgres/__init__.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/postgres/postgres.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/postgres/postgres_ls.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/postgres/postgres_preview.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/preview_table.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/pwd.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/reaper/__init__.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/reaper/reaper.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/reaper/reaper_forward.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/reaper/reaper_forward_stop.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/reaper/reaper_restart.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/reaper/reaper_run_abort.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/reaper/reaper_runs.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/reaper/reaper_runs_abort.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/reaper/reaper_schedule_activate.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/reaper/reaper_schedule_start.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/reaper/reaper_schedule_stop.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/reaper/reaper_schedules.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/reaper/reaper_session.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/reaper/reaper_status.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/repair/__init__.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/repair/repair.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/repair/repair_log.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/repair/repair_run.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/repair/repair_scan.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/repair/repair_stop.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/report.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/restart.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/rollout.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/show/__init__.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/show/show.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/show/show_adam.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/show/show_app_actions.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/show/show_app_id.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/show/show_app_queues.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/show/show_cassandra_status.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/show/show_cassandra_version.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/show/show_commands.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/show/show_login.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/show/show_params.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/show/show_processes.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/show/show_repairs.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/show/show_storage.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/user_entry.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/commands/watch.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/config.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/embedded_apps.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/k8s_utils/__init__.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/k8s_utils/cassandra_clusters.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/k8s_utils/cassandra_nodes.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/k8s_utils/custom_resources.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/k8s_utils/ingresses.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/k8s_utils/jobs.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/k8s_utils/kube_context.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/k8s_utils/pods.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/k8s_utils/secrets.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/k8s_utils/services.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/k8s_utils/statefulsets.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/k8s_utils/volumes.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/log.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/pod_exec_result.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/repl.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/repl_commands.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/repl_session.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/repl_state.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/sso/__init__.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/sso/cred_cache.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/sso/id_token.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/sso/idp_login.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/sso/idp_session.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/sso/sso_config.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/adam/utils.py +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/kaqing.egg-info/SOURCES.txt +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/kaqing.egg-info/dependency_links.txt +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/kaqing.egg-info/entry_points.txt +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/kaqing.egg-info/top_level.txt +0 -0
- {kaqing-1.98.86 → kaqing-1.98.87}/setup.cfg +0 -0
|
@@ -88,7 +88,7 @@ class AppSession:
|
|
|
88
88
|
if not forced and self.app_login:
|
|
89
89
|
return self.app_login
|
|
90
90
|
|
|
91
|
-
idp_login: IdpLogin = Idp.login(self.host, idp_uri=idp_uri, forced=forced, use_token_from_env=use_token_from_env, use_cached_creds=use_cached_creds)
|
|
91
|
+
idp_login: IdpLogin = Idp.login(self.host, idp_uri=idp_uri, forced=forced, use_token_from_env=use_token_from_env, use_cached_creds=use_cached_creds, verify=False)
|
|
92
92
|
if not idp_login:
|
|
93
93
|
log2(f"Invalid username/password.")
|
|
94
94
|
|
|
@@ -93,23 +93,23 @@ class PostgresSession:
|
|
|
93
93
|
# template1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | | libc | =c/postgres +
|
|
94
94
|
# | | | | | | | postgres=CTc/postgres
|
|
95
95
|
# (48 rows)
|
|
96
|
-
r
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
96
|
+
if r := self.run_sql('\l', show_out=False):
|
|
97
|
+
s = 0
|
|
98
|
+
for line in r.stdout.split('\n'):
|
|
99
|
+
line: str = line.strip(' \r')
|
|
100
|
+
if s == 0:
|
|
101
|
+
if 'List of databases' in line:
|
|
102
|
+
s = 1
|
|
103
|
+
elif s == 1:
|
|
104
|
+
if 'Name' in line and 'Owner' in line and 'Encoding' in line:
|
|
105
|
+
s = 2
|
|
106
|
+
elif s == 2:
|
|
107
|
+
if line.startswith('---------'):
|
|
108
|
+
s = 3
|
|
109
|
+
elif s == 3:
|
|
110
|
+
groups = re.match(r'^\s*(\S*)\s*\|\s*(\S*)\s*\|.*', line)
|
|
111
|
+
if groups and groups[1] != '|':
|
|
112
|
+
dbs.append({'name': groups[1], 'owner': groups[2]})
|
|
113
113
|
|
|
114
114
|
return dbs
|
|
115
115
|
|
|
@@ -120,23 +120,23 @@ class PostgresSession:
|
|
|
120
120
|
# ----------+------------------------------------------------------------+-------+---------------
|
|
121
121
|
# postgres | c3_2_admin_aclpriv | table | postgres
|
|
122
122
|
# postgres | c3_2_admin_aclpriv_a | table | postgres
|
|
123
|
-
r
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
123
|
+
if r := self.run_sql('\dt', show_out=False):
|
|
124
|
+
s = 0
|
|
125
|
+
for line in r.stdout.split('\n'):
|
|
126
|
+
line: str = line.strip(' \r')
|
|
127
|
+
if s == 0:
|
|
128
|
+
if 'List of relations' in line:
|
|
129
|
+
s = 1
|
|
130
|
+
elif s == 1:
|
|
131
|
+
if 'Schema' in line and 'Name' in line and 'Type' in line:
|
|
132
|
+
s = 2
|
|
133
|
+
elif s == 2:
|
|
134
|
+
if line.startswith('---------'):
|
|
135
|
+
s = 3
|
|
136
|
+
elif s == 3:
|
|
137
|
+
groups = re.match(r'^\s*(\S*)\s*\|\s*(\S*)\s*\|.*', line)
|
|
138
|
+
if groups and groups[1] != '|':
|
|
139
|
+
dbs.append({'schema': groups[1], 'name': groups[2]})
|
|
140
140
|
|
|
141
141
|
return dbs
|
|
142
142
|
|
|
@@ -156,28 +156,35 @@ class PostgresSession:
|
|
|
156
156
|
return r
|
|
157
157
|
else:
|
|
158
158
|
ns = self.namespace
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
159
|
+
pod_name = Config().get('pg.agent.name', 'ops')
|
|
160
|
+
|
|
161
|
+
if Config().get('pg.agent.just-in-time', False):
|
|
162
|
+
image = Config().get('pg.agent.image', 'seanahnsf/kaqing')
|
|
163
|
+
timeout = Config().get('pg.agent.timeout', 3600)
|
|
164
|
+
try:
|
|
165
|
+
Pods.create(ns, pod_name, image, ['sleep', f'{timeout}'], env={'NAMESPACE': ns}, sa_name='c3')
|
|
166
|
+
except Exception as e:
|
|
167
|
+
if e.status == 409:
|
|
168
|
+
if Pods.completed(ns, pod_name):
|
|
169
|
+
try:
|
|
170
|
+
Pods.delete(pod_name, ns)
|
|
171
|
+
Pods.create(ns, pod_name, image, ['sleep', f'{timeout}'], env={'NAMESPACE': ns}, sa_name='c3')
|
|
172
|
+
except Exception as e2:
|
|
173
|
+
log2("Exception when calling BatchV1Api->create_pod: %s\n" % e2)
|
|
174
|
+
|
|
175
|
+
return
|
|
176
|
+
else:
|
|
177
|
+
log2("Exception when calling BatchV1Api->create_pod: %s\n" % e)
|
|
178
|
+
|
|
179
|
+
return
|
|
180
|
+
|
|
181
|
+
Pods.wait_for_running(ns, pod_name)
|
|
162
182
|
|
|
163
183
|
try:
|
|
164
|
-
Pods.
|
|
165
|
-
except
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
try:
|
|
169
|
-
Pods.delete(pod_name, ns)
|
|
170
|
-
Pods.create(ns, pod_name, image, ['sleep', f'{timeout}'], env={'NAMESPACE': ns}, sa_name='c3')
|
|
171
|
-
except Exception as e2:
|
|
172
|
-
log2("Exception when calling BatchV1Api->create_pod: %s\n" % e2)
|
|
173
|
-
|
|
174
|
-
return
|
|
175
|
-
else:
|
|
176
|
-
log2("Exception when calling BatchV1Api->create_pod: %s\n" % e)
|
|
177
|
-
|
|
178
|
-
return
|
|
179
|
-
|
|
180
|
-
Pods.wait_for_running(ns, pod_name)
|
|
184
|
+
Pods.get(ns, pod_name)
|
|
185
|
+
except:
|
|
186
|
+
log2(f"Could not locate {pod_name} pod.")
|
|
187
|
+
return None
|
|
181
188
|
|
|
182
189
|
cmd = f'PGPASSWORD="{self.password()}" psql -h {self.endpoint()} -p {self.port()} -U {self.username()} {db} --pset pager=off -c "{sql}"'
|
|
183
190
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
def config():
|
|
2
|
-
return {'app': {'console-endpoint': 'https://{host}/{env}/{app}/static/console/index.html', 'cr': {'cluster-regex': '(.*?-.*?)-.*', 'group': 'ops.c3.ai', 'v': 'v2', 'plural': 'c3cassandras'}, 'label': 'c3__app_id-0', 'login': {'admin-group': '{host}/C3.ClusterAdmin', 'ingress': '{app_id}-k8singr-appleader-001', 'timeout': 5, 'session-check-url': 'https://{host}/{env}/{app}/api/8/C3/userSessionToken', 'cache-creds': True, 'cache-username': True, 'url': 'https://{host}/{env}/{app}', 'another': "You're logged in to {has}. However, for this app, you need to log in to {need}.", 'token-server-url': 'http://localhost:{port}', 'password-max-length': 128}, 'strip': '0'}, 'bash': {'workers': 32}, 'cassandra': {'service-name': 'all-pods-service'}, 'cql': {'workers': 32, 'samples': 3, 'secret': {'cluster-regex': '(.*?-.*?)-.*', 'name': '{cluster}-superuser', 'password-item': 'password'}}, 'checks': {'compactions-threshold': 250, 'cpu-busy-threshold': 98.0, 'cpu-threshold': 0.0, 'cassandra-data-path': '/c3/cassandra', 'root-disk-threshold': 50, 'cassandra-disk-threshold': 50, 'snapshot-size-cmd': "ls /c3/cassandra/data/data/*/*/snapshots | grep snapshots | sed 's/:$//g' | xargs -I {} du -sk {} | awk '{print $1}' | awk '{s+=$1} END {print s}'", 'snapshot-size-threshold': '40G', 'table-sizes-cmd': "ls -Al /c3/cassandra/data/data/ | awk '{print $9}' | sed 's/\\^r//g' | xargs -I {} du -sk /c3/cassandra/data/data/{}"}, 'get-host-id': {'workers': 32}, 'idps': {'ad': {'email-pattern': '.*@c3.ai', 'uri': 'https://login.microsoftonline.com/53ad779a-93e7-485c-ba20-ac8290d7252b/oauth2/v2.0/authorize?response_type=id_token&response_mode=form_post&client_id=00ff94a8-6b0a-4715-98e0-95490012d818&scope=openid+email+profile&redirect_uri=https%3A%2F%2Fplat.c3ci.cloud%2Fc3%2Fc3%2Foidc%2Flogin&nonce={nonce}&state=EMPTY', 'jwks-uri': 'https://login.microsoftonline.com/common/discovery/keys', 'contact': 'Please contact ted.tran@c3.ai.', 'whitelist-file': '/kaqing/members'}, 'okta': {'default': True, 'email-pattern': '.*@c3iot.com', 'uri': 'https://c3energy.okta.com/oauth2/v1/authorize?response_type=id_token&response_mode=form_post&client_id={client_id}&scope=openid+email+profile+groups&redirect_uri=https%3A%2F%2F{host}%2Fc3%2Fc3%2Foidc%2Flogin&nonce={nonce}&state=EMPTY', 'jwks-uri': 'https://c3energy.okta.com/oauth2/v1/keys'}}, 'issues': {'workers': 32}, 'logs': {'path': '/c3/cassandra/logs/system.log'}, 'medusa': {'restore-auto-complete': False}, 'nodetool': {'workers': 32, 'samples': 3, 'commands_in_line': 40}, 'pg': {'name-pattern': '^{namespace}.*-k8spg-.*', 'excludes': '.helm., -admin-secret', 'agent': {'
|
|
2
|
+
return {'app': {'console-endpoint': 'https://{host}/{env}/{app}/static/console/index.html', 'cr': {'cluster-regex': '(.*?-.*?)-.*', 'group': 'ops.c3.ai', 'v': 'v2', 'plural': 'c3cassandras'}, 'label': 'c3__app_id-0', 'login': {'admin-group': '{host}/C3.ClusterAdmin', 'ingress': '{app_id}-k8singr-appleader-001', 'timeout': 5, 'session-check-url': 'https://{host}/{env}/{app}/api/8/C3/userSessionToken', 'cache-creds': True, 'cache-username': True, 'url': 'https://{host}/{env}/{app}', 'another': "You're logged in to {has}. However, for this app, you need to log in to {need}.", 'token-server-url': 'http://localhost:{port}', 'password-max-length': 128}, 'strip': '0'}, 'bash': {'workers': 32}, 'cassandra': {'service-name': 'all-pods-service'}, 'cql': {'workers': 32, 'samples': 3, 'secret': {'cluster-regex': '(.*?-.*?)-.*', 'name': '{cluster}-superuser', 'password-item': 'password'}}, 'checks': {'compactions-threshold': 250, 'cpu-busy-threshold': 98.0, 'cpu-threshold': 0.0, 'cassandra-data-path': '/c3/cassandra', 'root-disk-threshold': 50, 'cassandra-disk-threshold': 50, 'snapshot-size-cmd': "ls /c3/cassandra/data/data/*/*/snapshots | grep snapshots | sed 's/:$//g' | xargs -I {} du -sk {} | awk '{print $1}' | awk '{s+=$1} END {print s}'", 'snapshot-size-threshold': '40G', 'table-sizes-cmd': "ls -Al /c3/cassandra/data/data/ | awk '{print $9}' | sed 's/\\^r//g' | xargs -I {} du -sk /c3/cassandra/data/data/{}"}, 'get-host-id': {'workers': 32}, 'idps': {'ad': {'email-pattern': '.*@c3.ai', 'uri': 'https://login.microsoftonline.com/53ad779a-93e7-485c-ba20-ac8290d7252b/oauth2/v2.0/authorize?response_type=id_token&response_mode=form_post&client_id=00ff94a8-6b0a-4715-98e0-95490012d818&scope=openid+email+profile&redirect_uri=https%3A%2F%2Fplat.c3ci.cloud%2Fc3%2Fc3%2Foidc%2Flogin&nonce={nonce}&state=EMPTY', 'jwks-uri': 'https://login.microsoftonline.com/common/discovery/keys', 'contact': 'Please contact ted.tran@c3.ai.', 'whitelist-file': '/kaqing/members'}, 'okta': {'default': True, 'email-pattern': '.*@c3iot.com', 'uri': 'https://c3energy.okta.com/oauth2/v1/authorize?response_type=id_token&response_mode=form_post&client_id={client_id}&scope=openid+email+profile+groups&redirect_uri=https%3A%2F%2F{host}%2Fc3%2Fc3%2Foidc%2Flogin&nonce={nonce}&state=EMPTY', 'jwks-uri': 'https://c3energy.okta.com/oauth2/v1/keys'}}, 'issues': {'workers': 32}, 'logs': {'path': '/c3/cassandra/logs/system.log'}, 'medusa': {'restore-auto-complete': False}, 'nodetool': {'workers': 32, 'samples': 3, 'commands_in_line': 40}, 'pg': {'name-pattern': '^{namespace}.*-k8spg-.*', 'excludes': '.helm., -admin-secret', 'agent': {'name': 'ops', 'just-in-time': False, 'timeout': 86400, 'image': 'seanahnsf/kaqing'}, 'default-db': 'postgres', 'default-schema': 'postgres', 'secret': {'endpoint-key': 'postgres-db-endpoint', 'port-key': 'postgres-db-port', 'username-key': 'postgres-admin-username', 'password-key': 'postgres-admin-password'}}, 'preview': {'rows': 10}, 'processes': {'columns': 'pod,cpu,mem', 'header': 'POD_NAME,CPU,MEM/LIMIT'}, 'reaper': {'service-name': 'reaper-service', 'port-forward': {'timeout': 86400, 'local-port': 9001}, 'abort-runs-batch': 10, 'show-runs-batch': 100, 'pod': {'cluster-regex': '(.*?-.*?-.*?-.*?)-.*', 'label-selector': 'k8ssandra.io/reaper={cluster}-reaper'}, 'secret': {'cluster-regex': '(.*?-.*?)-.*', 'name': '{cluster}-reaper-ui', 'password-item': 'password'}}, 'repair': {'log-path': '/home/cassrepair/logs/', 'image': 'ci-registry.c3iot.io/cloudops/cassrepair:2.0.13', 'secret': 'ciregistryc3iotio', 'env': {'interval': 24, 'timeout': 60, 'pr': False, 'runs': 1}}, 'repl': {'start-drive': 'a', 'auto-enter-app': 'c3/c3', 'auto-enter-only-cluster': True}, 'status': {'columns': 'status,address,load,tokens,owns,host_id,gossip,compactions', 'header': '--,Address,Load,Tokens,Owns,Host ID,GOSSIP,COMPACTIONS'}, 'storage': {'columns': 'pod,volume_root,volume_cassandra,snapshots,data,compactions', 'header': 'POD_NAME,VOLUME /,VOLUME CASS,SNAPSHOTS,DATA,COMPACTIONS'}, 'watch': {'auto': 'rollout', 'timeout': 3600, 'interval': 10}, 'debug': {'timings': False, 'exit-on-error': False, 'show-parallelism': False, 'show-out': False}}
|
|
@@ -9,7 +9,7 @@ class Authenticator:
|
|
|
9
9
|
return None
|
|
10
10
|
|
|
11
11
|
@abstractmethod
|
|
12
|
-
def authenticate(self, idp_uri: str, app_host: str, username: str, password: str) -> IdpLogin:
|
|
12
|
+
def authenticate(self, idp_uri: str, app_host: str, username: str, password: str, verify: bool = True) -> IdpLogin:
|
|
13
13
|
pass
|
|
14
14
|
|
|
15
15
|
def extract(self, form: str, pattern: re.Pattern):
|
|
@@ -24,7 +24,7 @@ class AdAuthenticator(Authenticator):
|
|
|
24
24
|
|
|
25
25
|
return cls.instance
|
|
26
26
|
|
|
27
|
-
def authenticate(self, idp_uri: str, app_host: str, username: str, password: str) -> IdpLogin:
|
|
27
|
+
def authenticate(self, idp_uri: str, app_host: str, username: str, password: str, verify: bool) -> IdpLogin:
|
|
28
28
|
parsed_url = urlparse(idp_uri)
|
|
29
29
|
query_string = parsed_url.query
|
|
30
30
|
params = parse_qs(query_string)
|
|
@@ -84,6 +84,9 @@ class AdAuthenticator(Authenticator):
|
|
|
84
84
|
if not id_token:
|
|
85
85
|
raise AdException('Invalid username/password.')
|
|
86
86
|
|
|
87
|
+
if not verify:
|
|
88
|
+
return IdpLogin(redirect_url, id_token, state_token, username, idp_uri=idp_uri, id_token_obj=None, session=session)
|
|
89
|
+
|
|
87
90
|
parsed = self.parse_id_token(id_token)
|
|
88
91
|
roles = parsed.groups
|
|
89
92
|
roles.append(username)
|
|
@@ -23,7 +23,7 @@ class OktaAuthenticator(Authenticator):
|
|
|
23
23
|
|
|
24
24
|
return cls.instance
|
|
25
25
|
|
|
26
|
-
def authenticate(self, idp_uri: str, app_host: str, username: str, password: str) -> IdpLogin:
|
|
26
|
+
def authenticate(self, idp_uri: str, app_host: str, username: str, password: str, verify: bool) -> IdpLogin:
|
|
27
27
|
parsed_url = urlparse(idp_uri)
|
|
28
28
|
query_string = parsed_url.query
|
|
29
29
|
params = parse_qs(query_string)
|
|
@@ -71,6 +71,10 @@ class OktaAuthenticator(Authenticator):
|
|
|
71
71
|
|
|
72
72
|
raise OktaException('Invalid username/password.')
|
|
73
73
|
|
|
74
|
+
if not verify:
|
|
75
|
+
# just relay id_token, it will be verified by SP
|
|
76
|
+
return IdpLogin(redirect_url, id_token, state_token, username, idp_uri=idp_uri, id_token_obj=None, session=session)
|
|
77
|
+
|
|
74
78
|
if group := Config().get('app.login.admin-group', '{host}/C3.ClusterAdmin').replace('{host}', app_host):
|
|
75
79
|
parsed = OktaAuthenticator.parse_id_token(okta_host, id_token)
|
|
76
80
|
if group not in parsed.groups:
|
|
@@ -28,7 +28,7 @@ class Idp:
|
|
|
28
28
|
|
|
29
29
|
return cls.instance
|
|
30
30
|
|
|
31
|
-
def login(app_host: str, username: str = None, idp_uri: str = None, forced = False, use_token_from_env = True, use_cached_creds = True) -> IdpLogin:
|
|
31
|
+
def login(app_host: str, username: str = None, idp_uri: str = None, forced = False, use_token_from_env = True, use_cached_creds = True, verify = True) -> IdpLogin:
|
|
32
32
|
session: IdpSession = IdpSession.create(username, app_host, app_host, idp_uri=idp_uri)
|
|
33
33
|
|
|
34
34
|
if use_token_from_env:
|
|
@@ -95,13 +95,13 @@ class Idp:
|
|
|
95
95
|
|
|
96
96
|
if username and password:
|
|
97
97
|
# if uploading kubeconfig file fails many times, you will be locked out
|
|
98
|
-
# kubeconfig file content has first char as tab
|
|
98
|
+
# kubeconfig file content has first char as tab or length of bigger than 128
|
|
99
99
|
if password[0] == '\t' or len(password) > Config().get('app.login.password-max-length', 128):
|
|
100
100
|
if r := Idp.try_kubeconfig(username, password):
|
|
101
101
|
log(f"You're signed in as {username}")
|
|
102
102
|
return r
|
|
103
103
|
else:
|
|
104
|
-
if r := session.authenticator.authenticate(session.idp_uri, app_host, username, password):
|
|
104
|
+
if r := session.authenticator.authenticate(session.idp_uri, app_host, username, password, verify=verify):
|
|
105
105
|
log(f"You're signed in as {username}")
|
|
106
106
|
return r
|
|
107
107
|
finally:
|
kaqing-1.98.86/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
|