Skip to content

Commit

Permalink
Merge pull request #131 from ImMin5/master
Browse files Browse the repository at this point in the history
Add workspace_id to secret manager when Domain admin register datasource
  • Loading branch information
ImMin5 authored Jan 5, 2024
2 parents 57224bd + e667b1f commit cf62c0f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
11 changes: 11 additions & 0 deletions src/spaceone/cost_analysis/conf/global_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,17 @@
# "event": []
}

# Log Settings
LOG = {
"filters": {
"masking": {
"rules": {
"DataSource.register": ["secret_data"],
}
}
}
}

CONNECTORS = {
"SpaceConnector": {
"backend": "spaceone.core.connector.space_connector:SpaceConnector",
Expand Down
10 changes: 6 additions & 4 deletions src/spaceone/cost_analysis/manager/secret_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ def __init__(self, *args, **kwargs):
)

def create_secret(
self,
secret_data: dict,
resource_group: str,
schema_id: str,
self,
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}")
Expand All @@ -33,6 +34,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)
Expand Down
1 change: 1 addition & 0 deletions src/spaceone/cost_analysis/service/data_source_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cf62c0f

Please sign in to comment.