Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: project current version auth fix. #1848

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions dongtai_web/views/project_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ class ProjectSearch(UserEndPoint):
)
def get(self, request):
name = request.query_params.get("name", "")
users = self.get_auth_users(request.user)
projects = IastProject.objects.filter(user__in=users, name__icontains=name).order_by("-latest_time")
projects = request.user.get_projects().filter(name__icontains=name).order_by("-latest_time")
data = [model_to_dict(project, fields=["id", "name"]) for project in projects]
return R.success(data=data)
5 changes: 2 additions & 3 deletions dongtai_web/views/project_version_current.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,9 @@ def post(self, request):
if not version_id or not project_id:
return R.failure(status=202, msg=_("Parameter error"))

users = self.get_auth_users(request.user)
users_id = [user.id for user in users]
projects = request.user.get_projects()
version = IastProjectVersion.objects.filter(
project_id=project_id, id=version_id, user_id__in=users_id
project_id=project_id, id=version_id, project__in=projects
).first()
if version:
version.current_version = 1
Expand Down
1 change: 1 addition & 0 deletions dongtai_web/views/vul_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ class VulSummary(UserEndPoint):
"Use the following conditions to view the statistics of the number of vulnerabilities in the project."
),
response_schema=_ResponseSerializer,
deprecated=True,
)
def get(self, request):
"""
Expand Down
1 change: 1 addition & 0 deletions dongtai_web/views/vul_summary_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ class VulSummaryProject(UserEndPoint):
"Use the following conditions to view the statistics of the number of vulnerabilities in the project."
),
response_schema=_ResponseSerializer,
deprecated=True,
)
def get(self, request):
"""
Expand Down
1 change: 1 addition & 0 deletions dongtai_web/views/vul_summary_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ class VulSummaryType(UserEndPoint):
"Use the following conditions to view the statistics of the number of vulnerabilities in the project."
),
response_schema=_ResponseSerializer,
deprecated=True,
)
def get(self, request):
"""
Expand Down
1 change: 1 addition & 0 deletions dongtai_web/views/vuls.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ class VulsEndPoint(UserEndPoint):
summary=_("Vulnerability List (with project)"),
response_schema=_ResponseSerializer,
description=_("Get the list of vulnerabilities corresponding to the project"),
deprecated=True,
)
def get(self, request):
"""
Expand Down
Loading