Skip to content

fix project bug of WORKSPACE_MEMBER #159

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

Merged
merged 2 commits into from
Dec 26, 2024
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
5 changes: 3 additions & 2 deletions src/spaceone/core/handler/authentication_handler.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import json
import logging
import copy
from typing import Tuple, List

from spaceone.core import cache, config
Expand Down Expand Up @@ -39,8 +40,8 @@ def verify(self, params: dict) -> None:
client_id = token_info.get("jti")
domain_id = token_info.get("did")
permissions, projects = self._check_app(client_id, domain_id)
token_info["permissions"] = permissions
token_info["projects"] = projects
token_info["permissions"] = copy.deepcopy(permissions)
token_info["projects"] = copy.deepcopy(projects)

self._update_meta(token_info)

Expand Down
6 changes: 4 additions & 2 deletions src/spaceone/core/handler/mutation_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ def request(self, params):
user_projects: list = self.transaction.get_meta("authorization.projects")
user_id: str = self.transaction.get_meta("authorization.user_id")
set_user_id: str = self.transaction.get_meta("authorization.set_user_id")
injected_params: dict = self.transaction.get_meta("authorization.injected_params")
injected_params: dict = self.transaction.get_meta(
"authorization.injected_params"
)

if user_role_type == "SYSTEM_TOKEN":
if domain_id:
Expand All @@ -29,7 +31,7 @@ def request(self, params):
elif user_role_type == "WORKSPACE_MEMBER":
params["domain_id"] = domain_id
params["workspace_id"] = workspace_id
params["user_projects"] = user_projects
params["user_projects"] = user_projects or []
elif user_role_type == "USER":
params["domain_id"] = domain_id

Expand Down
Loading