Skip to content

Commit

Permalink
Merge pull request #113 from PADAS/gundi-3168-fix-smart-issues
Browse files Browse the repository at this point in the history
GUNDI-3168: Fix issues in SMART transformer
  • Loading branch information
marianobrc authored Jun 11, 2024
2 parents 4b5bc8c + 37469c4 commit 25f23c3
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 10 deletions.
4 changes: 2 additions & 2 deletions app/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1499,7 +1499,7 @@ def destination_integration_v2_smart(integration_type_smart, smart_ca_uuid):
schemas_v2.IntegrationActionConfiguration(
id=UUID("55760315-3d68-4925-bf2d-c4d39de433c9"),
integration=UUID("b42c9205-5228-49e0-a75b-ebe5b6a9f78e"),
action=schemas_v2.IntegrationActionSummery(
action=schemas_v2.IntegrationActionSummary(
id=UUID("ebe72917-c112-4064-9f38-707bbd14a50f"),
type="push",
name="Push Events",
Expand All @@ -1514,7 +1514,7 @@ def destination_integration_v2_smart(integration_type_smart, smart_ca_uuid):
schemas_v2.IntegrationActionConfiguration(
id=UUID("abce8c67-a74c-46fd-b5c3-62a7b76f2b17"),
integration=UUID("b42c9205-5228-49e0-a75b-ebe5b6a9f78e"),
action=schemas_v2.IntegrationActionSummery(
action=schemas_v2.IntegrationActionSummary(
id=UUID("b0a0e7ed-d668-41b5-96d2-397f026c4ecb"),
type="auth",
name="Authenticate",
Expand Down
15 changes: 13 additions & 2 deletions app/services/transformers.py
Original file line number Diff line number Diff line change
Expand Up @@ -939,9 +939,20 @@ def __init__(self, *, config=None, **kwargs):

self._version = self.auth_config.version or "7.5"
logger.info(f"Using SMART Integration version {self._version}")

url_parse = urlparse(self.config.base_url)
domain = (
f"{url_parse.hostname}:{url_parse.port}"
if url_parse.port
else url_parse.hostname
)
path = url_parse.path or "/server"
path = path.replace("//", "/")
api_url = (
getattr(auth_config, "endpoint", None)
or f"{url_parse.scheme}://{domain}{path}"
)
self.smartconnect_client = AsyncSmartClient(
api=f"{self.config.base_url}/server",
api=api_url,
username=self.auth_config.login,
password=self.auth_config.password,
version=self._version,
Expand Down
6 changes: 3 additions & 3 deletions requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ aioredis==2.0.1
hiredis==2.3.2
packaging==23.0
https://github.com/PADAS/er-client/releases/download/v1.2.0-alpha/earthranger_client-1.2.0-py3-none-any.whl
https://github.com/PADAS/smartconnect-client/releases/download/v1.5.1/smartconnect_client-1.5.1-py3-none-any.whl
https://github.com/PADAS/smartconnect-client/releases/download/v1.5.3/smartconnect_client-1.5.3-py3-none-any.whl
gundi-client==1.0.2
gundi-client-v2==2.2.0
gundi-core==1.3.0
gundi-client-v2==2.3.0
gundi-core==1.4.0
opentelemetry-api==1.14.0
opentelemetry-sdk==1.14.0
opentelemetry-exporter-gcp-trace==1.3.0
Expand Down
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ grpcio-status==1.48.2
# via google-api-core
gundi-client==1.0.2
# via -r requirements.in
gundi-client-v2==2.2.0
gundi-client-v2==2.3.0
# via -r requirements.in
gundi-core==1.3.0
gundi-core==1.4.0
# via
# -r requirements.in
# gundi-client
Expand Down Expand Up @@ -279,7 +279,7 @@ six==1.16.0
# via
# google-auth
# python-dateutil
smartconnect-client @ https://github.com/PADAS/smartconnect-client/releases/download/v1.5.1/smartconnect_client-1.5.1-py3-none-any.whl
smartconnect-client @ https://github.com/PADAS/smartconnect-client/releases/download/v1.5.3/smartconnect_client-1.5.3-py3-none-any.whl
# via -r requirements.in
sniffio==1.3.0
# via
Expand Down

0 comments on commit 25f23c3

Please sign in to comment.