From 6eb9b55123cbc5f7c1aef164775f4999a1a966ca Mon Sep 17 00:00:00 2001 From: ImMin5 Date: Fri, 5 Jan 2024 13:53:24 +0900 Subject: [PATCH] fix: add workspace_id to secret manager when Domain admin register datasource --- src/spaceone/cost_analysis/conf/global_conf.py | 11 +++++++++++ src/spaceone/cost_analysis/manager/secret_manager.py | 2 ++ .../cost_analysis/service/data_source_service.py | 1 + 3 files changed, 14 insertions(+) diff --git a/src/spaceone/cost_analysis/conf/global_conf.py b/src/spaceone/cost_analysis/conf/global_conf.py index 20a73857..c8b152d2 100644 --- a/src/spaceone/cost_analysis/conf/global_conf.py +++ b/src/spaceone/cost_analysis/conf/global_conf.py @@ -31,6 +31,17 @@ # "event": [] } +# Log Settings +LOG = { + "filters": { + "masking": { + "rules": { + "DataSource.register": ["secret_data"], + } + } + } +} + CONNECTORS = { "SpaceConnector": { "backend": "spaceone.core.connector.space_connector:SpaceConnector", diff --git a/src/spaceone/cost_analysis/manager/secret_manager.py b/src/spaceone/cost_analysis/manager/secret_manager.py index ee796058..24338045 100644 --- a/src/spaceone/cost_analysis/manager/secret_manager.py +++ b/src/spaceone/cost_analysis/manager/secret_manager.py @@ -21,6 +21,7 @@ def create_secret( secret_data: dict, resource_group: str, schema_id: str, + workspace_id: str, ): def _rollback(secret_id: str): _LOGGER.info(f"[create_secret._rollback] Delete secret : {secret_id}") @@ -31,6 +32,7 @@ def _rollback(secret_id: str): "resource_group": resource_group, "data": secret_data, "schema_id": schema_id, + "workspace_id": workspace_id, } response = self.secret_connector.dispatch("Secret.create", params) diff --git a/src/spaceone/cost_analysis/service/data_source_service.py b/src/spaceone/cost_analysis/service/data_source_service.py index 7ec911ba..846eaffd 100644 --- a/src/spaceone/cost_analysis/service/data_source_service.py +++ b/src/spaceone/cost_analysis/service/data_source_service.py @@ -112,6 +112,7 @@ def register(self, params): secret_data, resource_group, plugin_info.get("schema_id"), + params["workspace_id"], ) params["plugin_info"]["secret_id"] = secret_id