Skip to content

Commit d360761

Browse files
author
Jongmin Kim
authored
Merge pull request #138 from whdalsrnt/master
�Change Token Policy
2 parents 868bfb9 + 3e16ee2 commit d360761

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/spaceone/core/handler/authentication_handler.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ def verify(self, params: dict) -> None:
2929
if token_info.get("typ") == "SYSTEM_TOKEN":
3030
self._update_system_meta(token_info)
3131
else:
32+
version = token_info.get("ver")
33+
if version not in ["2.0"]:
34+
raise ERROR_AUTHENTICATE_FAILURE(message="invalid token version.")
35+
3236
owner_type = token_info.get("own")
3337
if owner_type == "APP":
3438
client_id = token_info.get("jti")

src/spaceone/core/scheduler/worker.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,20 +38,21 @@ def execute(self):
3838
caller = self._locator.get_manager(self.name)
3939

4040
except Exception as e:
41-
_LOGGER.debug(f"[SingleTask] fail at locator {e}")
41+
_LOGGER.debug(f"[SingleTask.execute] locator error: {e}")
4242
raise ERROR_TASK_LOCATOR(locator=self.locator, name=self.name)
4343

4444
try:
4545
_LOGGER.debug(
46-
f"[SingleTask] request: {self.name}.{self.method} {self.params}"
46+
f"[SingleTask.execute] (REQUEST) => {self.name}.{self.method}"
4747
)
4848
method = getattr(caller, self.method)
4949
resp = method(**self.params)
50-
_LOGGER.debug(f"[SingleTask] response: {resp}")
50+
_LOGGER.debug(f"[SingleTask.execute] (RESPONSE) => SUCCESS")
5151
return resp
5252
except Exception as e:
5353
_LOGGER.error(
54-
f"[SingleTask] fail to execute method: {self.method}, reason = {e}",
54+
f"[SingleTask.execute] Fail to execute method ({self.method}): {e}",
55+
exc_info=True,
5556
)
5657
raise ERROR_TASK_METHOD(
5758
name=self.name, method=self.method, params=self.params

0 commit comments

Comments
 (0)