Skip to content

Commit

Permalink
Fix allowed hosts check (airbytehq#29459)
Browse files Browse the repository at this point in the history
  • Loading branch information
bnchrch authored and harrytou committed Sep 1, 2023
1 parent 0691d96 commit 2707ad2
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions airbyte-ci/connectors/connector_ops/connector_ops/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ def download_catalog(catalog_url):
"ql": 400,
}

ALLOWED_HOST_THRESHOLD = {
"ql": 300,
}


class ConnectorInvalidNameError(Exception):
pass
Expand Down Expand Up @@ -346,6 +350,15 @@ def requires_high_test_strictness_level(self) -> bool:
"""
return self.ab_internal_ql >= IMPORTANT_CONNECTOR_THRESHOLDS["ql"]

@property
def requires_allowed_hosts_check(self) -> bool:
"""Check if a connector requires allowed hosts.
Returns:
bool: True if the connector requires allowed hosts, False otherwise.
"""
return self.ab_internal_ql >= ALLOWED_HOST_THRESHOLD["ql"]

@property
def allowed_hosts(self) -> Optional[List[str]]:
return self.metadata.get("allowedHosts") if self.metadata else None
Expand Down

0 comments on commit 2707ad2

Please sign in to comment.