airbyte-cdk 7.2.0__py3-none-any.whl → 7.2.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -459,25 +459,60 @@ def _print_ci_secrets_masks(
459
459
  _print_ci_secrets_masks_for_config(config=config_dict)
460
460
 
461
461
 
462
+ def _print_ci_secret_mask_for_string(secret: str) -> None:
463
+ """Print GitHub CI mask for a single secret string.
464
+
465
+ We expect single-line secrets, but we also handle the case where the secret contains newlines.
466
+ For multi-line secrets, we must print a secret mask for each line separately.
467
+ """
468
+ for line in secret.splitlines():
469
+ if line.strip(): # Skip empty lines
470
+ print(f"::add-mask::{line!s}")
471
+
472
+
473
+ def _print_ci_secret_mask_for_value(value: Any) -> None:
474
+ """Print GitHub CI mask for a single secret value.
475
+
476
+ Call this function for any values identified as secrets, regardless of type.
477
+ """
478
+ if isinstance(value, dict):
479
+ # For nested dicts, we call recursively on each value
480
+ for v in value.values():
481
+ _print_ci_secret_mask_for_value(v)
482
+
483
+ return
484
+
485
+ if isinstance(value, list):
486
+ # For lists, we call recursively on each list item
487
+ for list_item in value:
488
+ _print_ci_secret_mask_for_value(list_item)
489
+
490
+ return
491
+
492
+ # For any other types besides dict and list, we convert to string and mask each line
493
+ # separately to handle multi-line secrets (e.g. private keys).
494
+ for line in str(value).splitlines():
495
+ if line.strip(): # Skip empty lines
496
+ _print_ci_secret_mask_for_string(line)
497
+
498
+
462
499
  def _print_ci_secrets_masks_for_config(
463
500
  config: dict[str, str] | list[Any] | Any,
464
501
  ) -> None:
465
502
  """Print GitHub CI mask for secrets config, navigating child nodes recursively."""
466
503
  if isinstance(config, list):
504
+ # Check each item in the list to look for nested dicts that may contain secrets:
467
505
  for item in config:
468
506
  _print_ci_secrets_masks_for_config(item)
469
507
 
470
- if isinstance(config, dict):
508
+ elif isinstance(config, dict):
471
509
  for key, value in config.items():
472
510
  if _is_secret_property(key):
473
511
  logger.debug(f"Masking secret for config key: {key}")
474
- print(f"::add-mask::{value!s}")
475
- if isinstance(value, dict):
476
- # For nested dicts, we also need to mask the json-stringified version
477
- print(f"::add-mask::{json.dumps(value)!s}")
478
-
479
- if isinstance(value, (dict, list)):
480
- _print_ci_secrets_masks_for_config(config=value)
512
+ _print_ci_secret_mask_for_value(value)
513
+ elif isinstance(value, (dict, list)):
514
+ # Recursively check nested dicts and lists
515
+ _print_ci_secrets_masks_for_config(value)
481
516
 
482
517
 
483
518
  def _is_secret_property(property_name: str) -> bool:
@@ -177,7 +177,11 @@ class ConfigComponentsResolver(ComponentsResolver):
177
177
  )
178
178
 
179
179
  path = [path.eval(self.config, **kwargs) for path in resolved_component.field_path]
180
- parsed_value = self._parse_yaml_if_possible(value)
180
+ # Avoid parsing strings that are meant to be strings
181
+ if not (isinstance(value, str) and valid_types == (str,)):
182
+ parsed_value = self._parse_yaml_if_possible(value)
183
+ else:
184
+ parsed_value = value
181
185
  updated = dpath.set(updated_config, path, parsed_value)
182
186
 
183
187
  if parsed_value and not updated and resolved_component.create_or_update:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: airbyte-cdk
3
- Version: 7.2.0
3
+ Version: 7.2.2
4
4
  Summary: A framework for writing Airbyte Connectors.
5
5
  Home-page: https://airbyte.com
6
6
  License: MIT
@@ -4,7 +4,7 @@ airbyte_cdk/cli/airbyte_cdk/__init__.py,sha256=8IoEcbdYr7CMAh97Xut5__uHH9vV4LKUt
4
4
  airbyte_cdk/cli/airbyte_cdk/_connector.py,sha256=3AaKtp7QIuJcVrk7eHB9JokDyw2mTSBNiHCdpreL5no,6500
5
5
  airbyte_cdk/cli/airbyte_cdk/_image.py,sha256=1Yu5CL5Eo07eY0OPBSgv1NfKoyNXualRr14KeGn0F0E,5773
6
6
  airbyte_cdk/cli/airbyte_cdk/_manifest.py,sha256=aFdeeWgek7oXR3YfZPxk7kBZ64Blmsr0dAXN6BVGiIA,482
7
- airbyte_cdk/cli/airbyte_cdk/_secrets.py,sha256=zkO9bO5pfOA-EJb0HRdEdSiybMFkyiqiQ6MWXldAg0s,17630
7
+ airbyte_cdk/cli/airbyte_cdk/_secrets.py,sha256=RT0KQBIyHhXgSAgTRqoXr3AWbfCEzoJo46VLPMZfAYE,18898
8
8
  airbyte_cdk/cli/airbyte_cdk/_version.py,sha256=ohZNIktLFk91sdzqFW5idaNrZAPX2dIRnz---_fcKOE,352
9
9
  airbyte_cdk/cli/airbyte_cdk/exceptions.py,sha256=bsGmlWN6cXL2jCD1WYAZMqFmK1OLg2xLrcC_60KHSeA,803
10
10
  airbyte_cdk/cli/source_declarative_manifest/README.md,sha256=aviNYFk1qKXGm33NQ2mJtJNyQ1MO0SPrm_fggUs0MVE,2460
@@ -228,7 +228,7 @@ airbyte_cdk/sources/declarative/requesters/request_path.py,sha256=S3MeFvcaQrMbOk
228
228
  airbyte_cdk/sources/declarative/requesters/requester.py,sha256=T6tMx_Bx4iT-0YVjY7IzgRil-gaIu9n01b1iwpTh3Ek,5516
229
229
  airbyte_cdk/sources/declarative/resolvers/__init__.py,sha256=xVhOWLQW0wFBTAtRYu3GdFebPqKCDSt1uoP2TiBGrvs,1643
230
230
  airbyte_cdk/sources/declarative/resolvers/components_resolver.py,sha256=rkNatGGhPQhasor95CujY7StmVn5q2UDGAcEzMKueGE,2213
231
- airbyte_cdk/sources/declarative/resolvers/config_components_resolver.py,sha256=OqL3Xil-2905pNfGwE-uPtEu53ksnT99Aec91cu5eSM,8408
231
+ airbyte_cdk/sources/declarative/resolvers/config_components_resolver.py,sha256=KF2wYDVLRf9-iGIg2AvmUVCryUIGgjLOBeljIn78-UA,8619
232
232
  airbyte_cdk/sources/declarative/resolvers/http_components_resolver.py,sha256=Y3P2tViKhJaOPp7Zl-uiCn5RiHkVEkpBAMi50PVXfoI,4830
233
233
  airbyte_cdk/sources/declarative/resolvers/parametrized_components_resolver.py,sha256=BUmvbsMeIGusZSCd80NiTFcwcosq-uhXHGNheAFs-10,5147
234
234
  airbyte_cdk/sources/declarative/retrievers/__init__.py,sha256=LQQspOQS9oyOx9cGnRIz1mq-8DZCBysyDJDPqjy1HvM,449
@@ -457,9 +457,9 @@ airbyte_cdk/utils/slice_hasher.py,sha256=EDxgROHDbfG-QKQb59m7h_7crN1tRiawdf5uU7G
457
457
  airbyte_cdk/utils/spec_schema_transformations.py,sha256=9YDJmnIGFsT51CVQf2tSSvTapGimITjEFGbUTSZAGTI,963
458
458
  airbyte_cdk/utils/stream_status_utils.py,sha256=ZmBoiy5HVbUEHAMrUONxZvxnvfV9CesmQJLDTAIWnWw,1171
459
459
  airbyte_cdk/utils/traced_exception.py,sha256=C8uIBuCL_E4WnBAOPSxBicD06JAldoN9fGsQDp463OY,6292
460
- airbyte_cdk-7.2.0.dist-info/LICENSE.txt,sha256=Wfe61S4BaGPj404v8lrAbvhjYR68SHlkzeYrg3_bbuM,1051
461
- airbyte_cdk-7.2.0.dist-info/LICENSE_SHORT,sha256=aqF6D1NcESmpn-cqsxBtszTEnHKnlsp8L4x9wAh3Nxg,55
462
- airbyte_cdk-7.2.0.dist-info/METADATA,sha256=ED1_ERExNBHJb7zIlVC9sCkx0QreL_PHmikMB71G7SI,6798
463
- airbyte_cdk-7.2.0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
464
- airbyte_cdk-7.2.0.dist-info/entry_points.txt,sha256=eLZ2UYvJZGm1s07Pplcs--1Gim60YhZWTb53j_dghwU,195
465
- airbyte_cdk-7.2.0.dist-info/RECORD,,
460
+ airbyte_cdk-7.2.2.dist-info/LICENSE.txt,sha256=Wfe61S4BaGPj404v8lrAbvhjYR68SHlkzeYrg3_bbuM,1051
461
+ airbyte_cdk-7.2.2.dist-info/LICENSE_SHORT,sha256=aqF6D1NcESmpn-cqsxBtszTEnHKnlsp8L4x9wAh3Nxg,55
462
+ airbyte_cdk-7.2.2.dist-info/METADATA,sha256=27N0WYrEGnDXJ0WvTf39WTbepPszAR-5-pdq-cFZBL8,6798
463
+ airbyte_cdk-7.2.2.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
464
+ airbyte_cdk-7.2.2.dist-info/entry_points.txt,sha256=eLZ2UYvJZGm1s07Pplcs--1Gim60YhZWTb53j_dghwU,195
465
+ airbyte_cdk-7.2.2.dist-info/RECORD,,