Skip to content

Commit

Permalink
allow ldaps for ldap url
Browse files Browse the repository at this point in the history
  • Loading branch information
AmberCharitos committed May 29, 2024
1 parent 6a938dd commit ebb4f5b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/structured_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def sync_ldap_url_validator(cls, value: str) -> Optional[str]:
Raises:
ValueError: in the case when the value incorrectly formatted.
"""
ldap_url_pattern = r"^ldap://.*:\d+$"
ldap_url_pattern = r"^ldaps?://.*:\d+$"
if re.match(ldap_url_pattern, value) is not None:
return value
raise ValueError("Value incorrectly formatted.")
3 changes: 1 addition & 2 deletions tests/integration/test_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,4 @@ async def test_create_service(self, ops_test: OpsTest):
new_service = ranger.get_service(TRINO_SERVICE)
logger.info(f"service: {new_service}")
name = new_service.get("name")
service_id = new_service.get("id")
assert name == TRINO_SERVICE and service_id == 1
assert TRINO_SERVICE in name
2 changes: 1 addition & 1 deletion tests/unit/test_structured_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def test_string_values(_harness) -> None:

# sync-ldap-url
check_invalid_values(_harness, "sync-ldap-url", erroneus_values)
accepted_values = ["ldap://ldap-k8s:3893", "ldap://example-host:636"]
accepted_values = ["ldap://ldap-k8s:3893", "ldaps://example-host:636"]
check_valid_values(_harness, "sync-ldap-url", accepted_values)


Expand Down

0 comments on commit ebb4f5b

Please sign in to comment.