Skip to content

Commit d23bbb9

Browse files
committed
tidy up rule match logic
1 parent f2e72b0 commit d23bbb9

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

airbyte_cdk/cli/airbyte_cdk/_secrets.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
import rich_click as click
4141
import yaml
4242
from click import style
43-
from numpy import isin
4443
from rich.console import Console
4544
from rich.table import Table
4645

@@ -398,9 +397,15 @@ def _print_ci_secrets_masks_for_config(
398397

399398

400399
def _is_secret_property(property_name: str) -> bool:
401-
"""Check if the property name is in the list of properties to mask."""
400+
"""Check if the property name is in the list of properties to mask.
401+
402+
To avoid false negatives, we perform a case-insensitive check, and we include any property name
403+
that contains a rule entry, even if it is not an exact match.
404+
405+
For example, if the rule entry is "password", we will also match "PASSWORD" and "my_password".
406+
"""
402407
names_to_mask: list[str] = _get_spec_mask()
403-
if any([property_name.lower() in mask.lower() for mask in names_to_mask]):
408+
if any([mask.lower() in property_name.lower() for mask in names_to_mask]):
404409
return True
405410

406411
return False

0 commit comments

Comments
 (0)