From 51be015c84619925873ff377a72827b7c9770632 Mon Sep 17 00:00:00 2001
From: rabbitali <shusheng.wen@outlook.com>
Date: Mon, 18 Sep 2023 12:18:52 +0800
Subject: [PATCH 1/1] update callback request headers
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 zeus/vulnerability_manage/view.py | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/zeus/vulnerability_manage/view.py b/zeus/vulnerability_manage/view.py
index 1bfed63..b5360e2 100644
--- a/zeus/vulnerability_manage/view.py
+++ b/zeus/vulnerability_manage/view.py
@@ -119,7 +119,7 @@ def generate_tasks(tasks: list, host_infos: dict, **kwargs: dict) -> list:
 
 class BaseExcuteTask:
     def __init__(self) -> None:
-        self._header = {'content-type': 'application/json', 'access_token': request.headers.get('access_token')}
+        self._header = {"exempt_authentication": configuration.individuation.get("EXEMPT_AUTHENTICATION")}
 
 
 class ExecuteRepoSetTask(BaseResponse, BaseExcuteTask):
@@ -234,7 +234,7 @@ class ExecuteRepoSetTask(BaseResponse, BaseExcuteTask):
             return self.response(code=status_code)
 
         self._callback_url = params.get('callback')
-        self._header = {'content-type': 'application/json', 'access_token': request.headers.get('access_token')}
+        self._header["local_account"] = params.get("username")
         self._task_id = params.get("task_id")
         self._task_name = params.get("task_name")
         self._task_type = params.get("task_type")
@@ -337,13 +337,7 @@ class ExecuteCveScanTask(BaseResponse, BaseExcuteTask):
             return self.response(code=status_code)
         # parse args
         self._callback_url = params.get('callback')
-        if params.get("timed"):
-            self._header.update(
-                {
-                    "exempt_authentication": configuration.individuation.get("EXEMPT_AUTHENTICATION"),
-                    "local_account": params.get("username"),
-                }
-            )
+        self._header["local_account"] = params.get("username")
         self._task_id = params.get("task_id")
         self._check_items = params.get('check_items')
         # Execute task
@@ -465,6 +459,7 @@ class ExecuteCveFixTask(BaseResponse, BaseExcuteTask):
         self._task_id = params.get("task_id")
         self._task_name = params.get("task_name")
         self._task_type = params.get("task_type")
+        self._header["local_account"] = params.get("username")
         self._accepted = params.get('accepted')
         self._takeover = params.get('takeover')
         self._check_items = params.get('check_items')
@@ -582,6 +577,7 @@ class ExecuteCveRollbackTask(BaseResponse, BaseExcuteTask):
         # Generate tasks
         self._callback_url = params.get('callback')
         self._task_id = params.get("task_id")
+        self._header["local_account"] = params.get("username")
         self._task_name = params.get("task_name")
         self._task_type = params.get("task_type")
 
-- 
2.33.1.windows.1

