hcs-core 0.1.286__py3-none-any.whl → 0.1.287__py3-none-any.whl
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.
- hcs_core/__init__.py +1 -1
- hcs_core/ctxp/profile.py +0 -1
- hcs_core/ctxp/task_schd.py +0 -2
- hcs_core/sglib/auth.py +6 -1
- hcs_core/sglib/login_support.py +0 -4
- {hcs_core-0.1.286.dist-info → hcs_core-0.1.287.dist-info}/METADATA +2 -1
- {hcs_core-0.1.286.dist-info → hcs_core-0.1.287.dist-info}/RECORD +8 -8
- {hcs_core-0.1.286.dist-info → hcs_core-0.1.287.dist-info}/WHEEL +0 -0
hcs_core/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.1.
|
|
1
|
+
__version__ = "0.1.287"
|
hcs_core/ctxp/profile.py
CHANGED
hcs_core/ctxp/task_schd.py
CHANGED
|
@@ -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()
|
hcs_core/sglib/auth.py
CHANGED
|
@@ -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
|
-
|
|
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
|
|
hcs_core/sglib/login_support.py
CHANGED
|
@@ -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)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: hcs-core
|
|
3
|
-
Version: 0.1.
|
|
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'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
hcs_core/__init__.py,sha256=
|
|
1
|
+
hcs_core/__init__.py,sha256=QcbCKd-QO9eRF5w2FWOK-QGs0v1RFZihFd7Cm-DcOiY,24
|
|
2
2
|
hcs_core/ctxp/__init__.py,sha256=bHVHhJP10Luz1a3Kk3zFx14dAO4SY6Q20Lrv8rNWWGc,1075
|
|
3
3
|
hcs_core/ctxp/_init.py,sha256=yq46VOty4zs_WcLt1SrtePxbW8S4RIz4YUCP3xIBvCA,2797
|
|
4
4
|
hcs_core/ctxp/cli_options.py,sha256=g5JnzOtyWiGLCLcGp5x54MPFLW_NOfhfevXUlX5L8tM,2532
|
|
@@ -14,11 +14,11 @@ hcs_core/ctxp/fn_util.py,sha256=bEYmj5WgUkRE5S4oQjT_zutuViXWYU9q5MR-MlTA_bY,1573
|
|
|
14
14
|
hcs_core/ctxp/fstore.py,sha256=qgd4aDLrRWqSsB-7StBv1TAqd0wxIB-scvt6FZSTtyQ,8958
|
|
15
15
|
hcs_core/ctxp/jsondot.py,sha256=U2_ToR8j3-hex75X3OSqTgADiw5cqjRDVO38-IbvapM,11369
|
|
16
16
|
hcs_core/ctxp/logger.py,sha256=6Sh1WXUrjrQNU7K6zUlBzE34fIS6o6oMU3eqSknUOEo,6321
|
|
17
|
-
hcs_core/ctxp/profile.py,sha256=
|
|
17
|
+
hcs_core/ctxp/profile.py,sha256=DQUQXThHNZa49tDcyGfh-w658CJBE1YIKmNHWXSDaiw,7673
|
|
18
18
|
hcs_core/ctxp/profile_store.py,sha256=v4RvKSaKSJhAt5rEGbC6v-NfaI3N67YffPm-qlrQWdg,1566
|
|
19
19
|
hcs_core/ctxp/recent.py,sha256=Lbv1q6Ld-7FKFaA_FNyqI_WaFDp9zQAOFjFVzox5GoE,1767
|
|
20
20
|
hcs_core/ctxp/state.py,sha256=gjcMRVONKBq7WiFQo-xca1726ngZe90mnPrF3vbXDrU,1634
|
|
21
|
-
hcs_core/ctxp/task_schd.py,sha256=
|
|
21
|
+
hcs_core/ctxp/task_schd.py,sha256=mvZMeKDSSo2p7VidSoZY1XZj433TQn_YF9SGJEzl9lg,4586
|
|
22
22
|
hcs_core/ctxp/template_util.py,sha256=XslvIuRBlTVsUW0Y9M_D8gUPc1jWq6X2p4At2VAe1KU,731
|
|
23
23
|
hcs_core/ctxp/timeutil.py,sha256=RyRrIRdFHbIghdB8wbC8VdABvc7hki2v51b1x2JvHgo,445
|
|
24
24
|
hcs_core/ctxp/util.py,sha256=67oR--oVZHzo2wgDbEGg_1mvbl32ReW5edEHjosOjA8,10308
|
|
@@ -41,14 +41,14 @@ hcs_core/plan/provider/dev/_prepare.py,sha256=PvVnheEQwpj8sWYz2lDONQVTs4pHPYuo2c
|
|
|
41
41
|
hcs_core/plan/provider/dev/dummy.py,sha256=zKEr9J4WHhlN5gFdmrFyEfCF0xlQlCJg0CC1dG9VaLA,1958
|
|
42
42
|
hcs_core/plan/provider/dev/fibonacci.py,sha256=8WhDr5c9harNAlVPZomQJEqbWe0hUqbppO6ZkwEUcJ0,1104
|
|
43
43
|
hcs_core/sglib/__init__.py,sha256=oT0etW7vsEbHlXiGL5x23ZXyyFqeLi81RxQQ5lfKSV0,654
|
|
44
|
-
hcs_core/sglib/auth.py,sha256=
|
|
44
|
+
hcs_core/sglib/auth.py,sha256=otsiBEvKae3B0-bPt5Ggir7ceTRLWG1x7ZaSblHisdA,6443
|
|
45
45
|
hcs_core/sglib/cli_options.py,sha256=NvdiHpX_o6IYPEM8cQYLb_R7T4aiXVvYLqn6Vk4Q2-Y,1761
|
|
46
46
|
hcs_core/sglib/client_util.py,sha256=ZCXmNfmUL4_iry4yU2bPWL0dLLNIGu3zp541cFt6Or0,10876
|
|
47
47
|
hcs_core/sglib/csp.py,sha256=anZqbQLIZw831PgW9Z4pweqfAeBH7rXPIAkwkyPkfGY,8054
|
|
48
48
|
hcs_core/sglib/ez_client.py,sha256=6R_gnRRxxmJYg6oJTnUB7ZLvUTRlEEYuhRyLLOvMxWI,7592
|
|
49
49
|
hcs_core/sglib/hcs_client.py,sha256=pxRZQ79ABhOyihAI8oOeTxw2dXkce5-NyRkJAoo0OL0,888
|
|
50
50
|
hcs_core/sglib/init.py,sha256=w_0ZU70Q1TGbSZsqSi7ewKQqpExFlepOT7mIqH0wnho,310
|
|
51
|
-
hcs_core/sglib/login_support.py,sha256=
|
|
51
|
+
hcs_core/sglib/login_support.py,sha256=5vU3MOGM00yUcjsoSJeTY0p5PVYOO76YVEggTB6i7U4,7484
|
|
52
52
|
hcs_core/sglib/payload_util.py,sha256=Hnj7rjzrQ1j5gpbrwZX34biN8MIZjy6dOJZ63ulmzdw,685
|
|
53
53
|
hcs_core/sglib/requtil.py,sha256=O37DrD4VVBmmRkkHJLbDtPfFq8l6fLZwYZggt2FTEFc,920
|
|
54
54
|
hcs_core/sglib/utils.py,sha256=FLgB8M5EiS3WhCzX5xUA9aFzB5jKQI8pqxtrmE4SsjQ,3164
|
|
@@ -63,6 +63,6 @@ hcs_core/util/query_util.py,sha256=5bh3bUVIQuY9qerndfuyfyzkTExYJ8zD0_e3PSN7y-4,3
|
|
|
63
63
|
hcs_core/util/scheduler.py,sha256=bPpCmGUL1UctJMfLPAg-h4Hl2YZr96FiI78-G_Usn08,2958
|
|
64
64
|
hcs_core/util/ssl_util.py,sha256=MvU102fGwWWh9hhSmLnn1qQIWuD6TjZnN0iH0MXUtW0,1239
|
|
65
65
|
hcs_core/util/versions.py,sha256=wwbcYFpxBohI-QjcrmxGsNghdnx4EWHBipMUL7vnpwM,1728
|
|
66
|
-
hcs_core-0.1.
|
|
67
|
-
hcs_core-0.1.
|
|
68
|
-
hcs_core-0.1.
|
|
66
|
+
hcs_core-0.1.287.dist-info/METADATA,sha256=0XqaqWNnewWHGoV9N-vTbCZH1vMhUKJ0pMw5vw3Vk70,1875
|
|
67
|
+
hcs_core-0.1.287.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
68
|
+
hcs_core-0.1.287.dist-info/RECORD,,
|
|
File without changes
|