hcs-core 0.1.286__tar.gz → 0.1.287__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.
Files changed (70) hide show
  1. {hcs_core-0.1.286 → hcs_core-0.1.287}/PKG-INFO +2 -1
  2. hcs_core-0.1.287/hcs_core/__init__.py +1 -0
  3. {hcs_core-0.1.286 → hcs_core-0.1.287}/hcs_core/ctxp/profile.py +0 -1
  4. {hcs_core-0.1.286 → hcs_core-0.1.287}/hcs_core/ctxp/task_schd.py +0 -2
  5. {hcs_core-0.1.286 → hcs_core-0.1.287}/hcs_core/sglib/auth.py +6 -1
  6. {hcs_core-0.1.286 → hcs_core-0.1.287}/hcs_core/sglib/login_support.py +0 -4
  7. {hcs_core-0.1.286 → hcs_core-0.1.287}/pyproject.toml +1 -0
  8. hcs_core-0.1.286/hcs_core/__init__.py +0 -1
  9. {hcs_core-0.1.286 → hcs_core-0.1.287}/.gitignore +0 -0
  10. {hcs_core-0.1.286 → hcs_core-0.1.287}/README.md +0 -0
  11. {hcs_core-0.1.286 → hcs_core-0.1.287}/hcs_core/ctxp/__init__.py +0 -0
  12. {hcs_core-0.1.286 → hcs_core-0.1.287}/hcs_core/ctxp/_init.py +0 -0
  13. {hcs_core-0.1.286 → hcs_core-0.1.287}/hcs_core/ctxp/built_in_cmds/__init__.py +0 -0
  14. {hcs_core-0.1.286 → hcs_core-0.1.287}/hcs_core/ctxp/built_in_cmds/_ut.py +0 -0
  15. {hcs_core-0.1.286 → hcs_core-0.1.287}/hcs_core/ctxp/built_in_cmds/context.py +0 -0
  16. {hcs_core-0.1.286 → hcs_core-0.1.287}/hcs_core/ctxp/built_in_cmds/profile.py +0 -0
  17. {hcs_core-0.1.286 → hcs_core-0.1.287}/hcs_core/ctxp/cli_options.py +0 -0
  18. {hcs_core-0.1.286 → hcs_core-0.1.287}/hcs_core/ctxp/cli_processor.py +0 -0
  19. {hcs_core-0.1.286 → hcs_core-0.1.287}/hcs_core/ctxp/cmd_util.py +0 -0
  20. {hcs_core-0.1.286 → hcs_core-0.1.287}/hcs_core/ctxp/config.py +0 -0
  21. {hcs_core-0.1.286 → hcs_core-0.1.287}/hcs_core/ctxp/context.py +0 -0
  22. {hcs_core-0.1.286 → hcs_core-0.1.287}/hcs_core/ctxp/data_util.py +0 -0
  23. {hcs_core-0.1.286 → hcs_core-0.1.287}/hcs_core/ctxp/dispatcher.py +0 -0
  24. {hcs_core-0.1.286 → hcs_core-0.1.287}/hcs_core/ctxp/duration.py +0 -0
  25. {hcs_core-0.1.286 → hcs_core-0.1.287}/hcs_core/ctxp/extension.py +0 -0
  26. {hcs_core-0.1.286 → hcs_core-0.1.287}/hcs_core/ctxp/fn_util.py +0 -0
  27. {hcs_core-0.1.286 → hcs_core-0.1.287}/hcs_core/ctxp/fstore.py +0 -0
  28. {hcs_core-0.1.286 → hcs_core-0.1.287}/hcs_core/ctxp/jsondot.py +0 -0
  29. {hcs_core-0.1.286 → hcs_core-0.1.287}/hcs_core/ctxp/logger.py +0 -0
  30. {hcs_core-0.1.286 → hcs_core-0.1.287}/hcs_core/ctxp/profile_store.py +0 -0
  31. {hcs_core-0.1.286 → hcs_core-0.1.287}/hcs_core/ctxp/recent.py +0 -0
  32. {hcs_core-0.1.286 → hcs_core-0.1.287}/hcs_core/ctxp/state.py +0 -0
  33. {hcs_core-0.1.286 → hcs_core-0.1.287}/hcs_core/ctxp/template_util.py +0 -0
  34. {hcs_core-0.1.286 → hcs_core-0.1.287}/hcs_core/ctxp/timeutil.py +0 -0
  35. {hcs_core-0.1.286 → hcs_core-0.1.287}/hcs_core/ctxp/util.py +0 -0
  36. {hcs_core-0.1.286 → hcs_core-0.1.287}/hcs_core/ctxp/var_template.py +0 -0
  37. {hcs_core-0.1.286 → hcs_core-0.1.287}/hcs_core/plan/__init__.py +0 -0
  38. {hcs_core-0.1.286 → hcs_core-0.1.287}/hcs_core/plan/actions.py +0 -0
  39. {hcs_core-0.1.286 → hcs_core-0.1.287}/hcs_core/plan/base_provider.py +0 -0
  40. {hcs_core-0.1.286 → hcs_core-0.1.287}/hcs_core/plan/context.py +0 -0
  41. {hcs_core-0.1.286 → hcs_core-0.1.287}/hcs_core/plan/core.py +0 -0
  42. {hcs_core-0.1.286 → hcs_core-0.1.287}/hcs_core/plan/dag.py +0 -0
  43. {hcs_core-0.1.286 → hcs_core-0.1.287}/hcs_core/plan/helper.py +0 -0
  44. {hcs_core-0.1.286 → hcs_core-0.1.287}/hcs_core/plan/kop.py +0 -0
  45. {hcs_core-0.1.286 → hcs_core-0.1.287}/hcs_core/plan/provider/__init__.py +0 -0
  46. {hcs_core-0.1.286 → hcs_core-0.1.287}/hcs_core/plan/provider/dev/__init__.py +0 -0
  47. {hcs_core-0.1.286 → hcs_core-0.1.287}/hcs_core/plan/provider/dev/_prepare.py +0 -0
  48. {hcs_core-0.1.286 → hcs_core-0.1.287}/hcs_core/plan/provider/dev/dummy.py +0 -0
  49. {hcs_core-0.1.286 → hcs_core-0.1.287}/hcs_core/plan/provider/dev/fibonacci.py +0 -0
  50. {hcs_core-0.1.286 → hcs_core-0.1.287}/hcs_core/sglib/__init__.py +0 -0
  51. {hcs_core-0.1.286 → hcs_core-0.1.287}/hcs_core/sglib/cli_options.py +0 -0
  52. {hcs_core-0.1.286 → hcs_core-0.1.287}/hcs_core/sglib/client_util.py +0 -0
  53. {hcs_core-0.1.286 → hcs_core-0.1.287}/hcs_core/sglib/csp.py +0 -0
  54. {hcs_core-0.1.286 → hcs_core-0.1.287}/hcs_core/sglib/ez_client.py +0 -0
  55. {hcs_core-0.1.286 → hcs_core-0.1.287}/hcs_core/sglib/hcs_client.py +0 -0
  56. {hcs_core-0.1.286 → hcs_core-0.1.287}/hcs_core/sglib/init.py +0 -0
  57. {hcs_core-0.1.286 → hcs_core-0.1.287}/hcs_core/sglib/payload_util.py +0 -0
  58. {hcs_core-0.1.286 → hcs_core-0.1.287}/hcs_core/sglib/requtil.py +0 -0
  59. {hcs_core-0.1.286 → hcs_core-0.1.287}/hcs_core/sglib/utils.py +0 -0
  60. {hcs_core-0.1.286 → hcs_core-0.1.287}/hcs_core/util/__init__.py +0 -0
  61. {hcs_core-0.1.286 → hcs_core-0.1.287}/hcs_core/util/check_license.py +0 -0
  62. {hcs_core-0.1.286 → hcs_core-0.1.287}/hcs_core/util/duration.py +0 -0
  63. {hcs_core-0.1.286 → hcs_core-0.1.287}/hcs_core/util/exit.py +0 -0
  64. {hcs_core-0.1.286 → hcs_core-0.1.287}/hcs_core/util/hcs_constants.py +0 -0
  65. {hcs_core-0.1.286 → hcs_core-0.1.287}/hcs_core/util/job_view.py +0 -0
  66. {hcs_core-0.1.286 → hcs_core-0.1.287}/hcs_core/util/pki_util.py +0 -0
  67. {hcs_core-0.1.286 → hcs_core-0.1.287}/hcs_core/util/query_util.py +0 -0
  68. {hcs_core-0.1.286 → hcs_core-0.1.287}/hcs_core/util/scheduler.py +0 -0
  69. {hcs_core-0.1.286 → hcs_core-0.1.287}/hcs_core/util/ssl_util.py +0 -0
  70. {hcs_core-0.1.286 → hcs_core-0.1.287}/hcs_core/util/versions.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hcs-core
3
- Version: 0.1.286
3
+ Version: 0.1.287
4
4
  Summary: Horizon Cloud Service CLI module.
5
5
  Project-URL: Homepage, https://github.com/euc-eng/hcs-cli
6
6
  Project-URL: Bug Tracker, https://github.com/euc-eng/hcs-cli/issues
@@ -40,6 +40,7 @@ Provides-Extra: dev
40
40
  Requires-Dist: bandit; extra == 'dev'
41
41
  Requires-Dist: black; extra == 'dev'
42
42
  Requires-Dist: build; extra == 'dev'
43
+ Requires-Dist: flake8; extra == 'dev'
43
44
  Requires-Dist: mypy; extra == 'dev'
44
45
  Requires-Dist: pylint; extra == 'dev'
45
46
  Requires-Dist: pytest; extra == 'dev'
@@ -0,0 +1 @@
1
+ __version__ = "0.1.287"
@@ -98,7 +98,6 @@ def current(reload: bool = False, exit_on_failure: bool = True, exclude_secret:
98
98
 
99
99
  def save():
100
100
  """Save the current profile"""
101
- global _data
102
101
  if _data is None:
103
102
  return
104
103
  write(name(), _data)
@@ -111,7 +111,6 @@ def statistics(reset_cycle: bool = False):
111
111
 
112
112
  def _daemon_worker():
113
113
  log.info("task scheduler daemon thread start")
114
- global _g_flag_stop_daemon
115
114
  while not _g_flag_stop_daemon.is_set():
116
115
  if _g_flag_running:
117
116
  schedule.run_pending()
@@ -149,7 +148,6 @@ def resume():
149
148
 
150
149
 
151
150
  def stop_daemon():
152
- global _g_flag_stop_daemon
153
151
  global _g_worker_thread
154
152
  if _g_worker_thread:
155
153
  _g_flag_stop_daemon.set()
@@ -125,12 +125,17 @@ def _get_new_oauth_token(old_oauth_token, effective_profile):
125
125
  def refresh_oauth_token(old_oauth_token: dict, csp_url: str):
126
126
  with OAuth2Client(token=old_oauth_token) as client:
127
127
  log.debug("Refresh auth token...")
128
- new_token = client.refresh_token(csp_url + "/csp/gateway/am/api/auth/token")
128
+ token_url = csp_url + "/csp/gateway/am/api/auth/token"
129
+ from .login_support import identify_client_id
130
+
131
+ csp_specific_req_not_oauth_standard = (identify_client_id(csp_url), "")
132
+ new_token = client.refresh_token(token_url, auth=csp_specific_req_not_oauth_standard)
129
133
  log.debug(f"New auth token: {new_token}")
130
134
  if not new_token:
131
135
  raise Exception("CSP auth refresh failed.")
132
136
  if "cspErrorCode" in new_token:
133
137
  raise Exception(f"CSP auth failed: {new_token.get('message')}")
138
+
134
139
  return new_token
135
140
 
136
141
 
@@ -19,17 +19,13 @@ limitations under the License.
19
19
  import logging
20
20
  import secrets
21
21
  import threading
22
- import time
23
22
  import webbrowser
24
23
  from http.server import BaseHTTPRequestHandler, HTTPServer
25
- from typing import Callable
26
24
  from urllib.parse import parse_qs, urlparse
27
25
 
28
26
  from authlib.integrations.httpx_client import OAuth2Client
29
27
  from authlib.oauth2.rfc7636 import create_s256_code_challenge
30
28
 
31
- from hcs_core.util.scheduler import ThreadPoolScheduler
32
-
33
29
  log = logging.getLogger(__name__)
34
30
 
35
31
  _server_address = ("127.0.0.1", 10762)
@@ -58,6 +58,7 @@ dev = [
58
58
  "pylint",
59
59
  "pytest",
60
60
  "ruff",
61
+ "flake8",
61
62
  ]
62
63
 
63
64
  [project.urls]
@@ -1 +0,0 @@
1
- __version__ = "0.1.286"
File without changes
File without changes