fix: deduplicate provider id

This commit is contained in:
Yeuoly 2024-12-10 02:21:46 +08:00
parent 93786f516c
commit 527c1cf608
No known key found for this signature in database
GPG Key ID: A66E7E320FB19F61

View File

@ -18,9 +18,6 @@ class PluginAgentManager(BasePluginManager):
def transformer(json_response: dict[str, Any]) -> dict: def transformer(json_response: dict[str, Any]) -> dict:
for provider in json_response.get("data", []): for provider in json_response.get("data", []):
declaration = provider.get("declaration", {}) or {} declaration = provider.get("declaration", {}) or {}
declaration["identity"]["name"] = (
f"{provider.get('plugin_id')}/{declaration.get('identity', {}).get('name')}"
)
provider_name = declaration.get("identity", {}).get("name") provider_name = declaration.get("identity", {}).get("name")
for strategy in declaration.get("strategies", []): for strategy in declaration.get("strategies", []):
strategy["identity"]["provider"] = provider_name strategy["identity"]["provider"] = provider_name