diff --git a/integrations/argocd/.port/spec.yaml b/integrations/argocd/.port/spec.yaml index 9f6d24df1f..eb6509d35a 100644 --- a/integrations/argocd/.port/spec.yaml +++ b/integrations/argocd/.port/spec.yaml @@ -28,3 +28,8 @@ configurations: required: false description: Whether to ignore server errors when fetching data from ArgoCD. If set to true, the exporter will continue to fetch data and ingest entities in Port without failing the resync event even if the ArgoCD server returns an error. If set to false, the exporter will stop fetching data and fail the resync event when the ArgoCD server returns an error. Default is false. default: false + - name: allowInsecure + type: boolean + required: false + description: Whether to allow insecure connections to the ArgoCD server. If set to true, the exporter will allow insecure connections to the ArgoCD server. If set to false, the exporter will only allow secure connections to the ArgoCD server. Default is false. + default: false diff --git a/integrations/argocd/CHANGELOG.md b/integrations/argocd/CHANGELOG.md index a700499177..b6aaeeccb4 100644 --- a/integrations/argocd/CHANGELOG.md +++ b/integrations/argocd/CHANGELOG.md @@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 +## 0.1.95 (2024-10-18) + + +### Improvements + +- Added support for optional insecure connections to Argocd with SSL verification disabled when allow_insecure is set to True (0.1.95) + + ## 0.1.94 (2024-10-14) diff --git a/integrations/argocd/client.py b/integrations/argocd/client.py index 968e39dbb1..0a701b7ebf 100644 --- a/integrations/argocd/client.py +++ b/integrations/argocd/client.py @@ -23,12 +23,23 @@ class ResourceKindsWithSpecialHandling(StrEnum): class ArgocdClient: - def __init__(self, token: str, server_url: str, ignore_server_error: bool): + def __init__( + self, + token: str, + server_url: str, + ignore_server_error: bool, + allow_insecure: bool, + ): self.token = token self.api_url = f"{server_url}/api/v1" self.ignore_server_error = ignore_server_error + self.allow_insecure = allow_insecure self.api_auth_header = {"Authorization": f"Bearer {self.token}"} - self.http_client = http_async_client + if self.allow_insecure: + # This is not recommended for production use + self.http_client = httpx.AsyncClient(verify=False) + else: + self.http_client = http_async_client self.http_client.headers.update(self.api_auth_header) async def _send_api_request( diff --git a/integrations/argocd/main.py b/integrations/argocd/main.py index 69b17f798c..3c4d56cbc1 100644 --- a/integrations/argocd/main.py +++ b/integrations/argocd/main.py @@ -10,6 +10,7 @@ def init_client() -> ArgocdClient: ocean.integration_config["token"], ocean.integration_config["server_url"], ocean.integration_config["ignore_server_error"], + ocean.integration_config["allow_insecure"], ) diff --git a/integrations/argocd/pyproject.toml b/integrations/argocd/pyproject.toml index d45c9b89a9..272a7c5325 100644 --- a/integrations/argocd/pyproject.toml +++ b/integrations/argocd/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "argocd" -version = "0.1.94" +version = "0.1.95" description = "Argo CD integration powered by Ocean" authors = ["Isaac Coffie "]