airbyte-cdk 6.40.1__py3-none-any.whl → 6.41.1__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.
@@ -93,6 +93,24 @@ def base64decode(value: str) -> str:
93
93
  return base64.b64decode(value.encode("utf-8")).decode()
94
94
 
95
95
 
96
+ def base64binascii_decode(value: str) -> str:
97
+ """
98
+ Implementation of a custom Jinja2 filter to decode base64 strings using ASCII encoding
99
+
100
+ For example:
101
+
102
+ OAuthAuthenticator:
103
+ $ref: "#/definitions/OAuthAuthenticator"
104
+ $parameters:
105
+ name: "client_id"
106
+ value: "{{ config['client_id'] | base64binascii_decode }}"
107
+
108
+ :param value: value to be decoded from base64 using ascii
109
+ :return: base64 decoded string ascii
110
+ """
111
+ return base64.standard_b64encode(value.encode("ascii")).decode("ascii")
112
+
113
+
96
114
  def string(value: Any) -> str:
97
115
  """
98
116
  Converts the input value to a string.
@@ -117,5 +135,5 @@ def regex_search(value: str, regex: str) -> str:
117
135
  return ""
118
136
 
119
137
 
120
- _filters_list = [hash, base64encode, base64decode, string, regex_search]
138
+ _filters_list = [hash, base64encode, base64decode, base64binascii_decode, string, regex_search]
121
139
  filters = {f.__name__: f for f in _filters_list}
@@ -19,7 +19,7 @@ SDM_COMPONENTS_MODULE_NAME = "source_declarative_manifest.components"
19
19
  INJECTED_MANIFEST = "__injected_declarative_manifest"
20
20
  INJECTED_COMPONENTS_PY = "__injected_components_py"
21
21
  INJECTED_COMPONENTS_PY_CHECKSUMS = "__injected_components_py_checksums"
22
- ENV_VAR_ALLOW_CUSTOM_CODE = "AIRBYTE_ALLOW_CUSTOM_CODE"
22
+ ENV_VAR_ALLOW_CUSTOM_CODE = "AIRBYTE_ENABLE_UNSAFE_CODE"
23
23
 
24
24
 
25
25
  class AirbyteCodeTamperedError(Exception):
@@ -35,7 +35,7 @@ class AirbyteCustomCodeNotPermittedError(Exception):
35
35
  def __init__(self) -> None:
36
36
  super().__init__(
37
37
  "Custom connector code is not permitted in this environment. "
38
- "If you need to run custom code, please ask your administrator to set the `AIRBYTE_ALLOW_CUSTOM_CODE` "
38
+ "If you need to run custom code, please ask your administrator to set the `AIRBYTE_ENABLE_UNSAFE_CODE` "
39
39
  "environment variable to 'true' in your Airbyte environment. "
40
40
  "If you see this message in Airbyte Cloud, your workspace does not allow executing "
41
41
  "custom connector code."
@@ -55,7 +55,7 @@ def _hash_text(input_text: str, hash_type: str = "md5") -> str:
55
55
  def custom_code_execution_permitted() -> bool:
56
56
  """Return `True` if custom code execution is permitted, otherwise `False`.
57
57
 
58
- Custom code execution is permitted if the `AIRBYTE_ALLOW_CUSTOM_CODE` environment variable is set to 'true'.
58
+ Custom code execution is permitted if the `AIRBYTE_ENABLE_UNSAFE_CODE` environment variable is set to 'true'.
59
59
  """
60
60
  return os.environ.get(ENV_VAR_ALLOW_CUSTOM_CODE, "").lower() == "true"
61
61
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: airbyte-cdk
3
- Version: 6.40.1
3
+ Version: 6.41.1
4
4
  Summary: A framework for writing Airbyte Connectors.
5
5
  Home-page: https://airbyte.com
6
6
  License: MIT
@@ -101,7 +101,7 @@ airbyte_cdk/sources/declarative/incremental/per_partition_cursor.py,sha256=9IAJT
101
101
  airbyte_cdk/sources/declarative/incremental/per_partition_with_global.py,sha256=2YBOA2NnwAeIKlIhSwUB_W-FaGnPcmrG_liY7b4mV2Y,8365
102
102
  airbyte_cdk/sources/declarative/incremental/resumable_full_refresh_cursor.py,sha256=10LFv1QPM-agVKl6eaANmEBOfd7gZgBrkoTcMggsieQ,4809
103
103
  airbyte_cdk/sources/declarative/interpolation/__init__.py,sha256=Kh7FxhfetyNVDnAQ9zSxNe4oUbb8CvoW7Mqz7cs2iPg,437
104
- airbyte_cdk/sources/declarative/interpolation/filters.py,sha256=JXdjSmi6eTUTA-qBoR9wSmXlEYvVCOZRKq2GhkDg09M,3640
104
+ airbyte_cdk/sources/declarative/interpolation/filters.py,sha256=9tqTLFlmIp47QtN6zTToLh-YmO9b4Mbylc3bivEa448,4210
105
105
  airbyte_cdk/sources/declarative/interpolation/interpolated_boolean.py,sha256=8F3ntT_Mfo8cO9n6dCq8rTfJIpfKmzRCsVtVdhzaoGc,1964
106
106
  airbyte_cdk/sources/declarative/interpolation/interpolated_mapping.py,sha256=h36RIng4GZ9v4o_fRmgJjTNOtWmhK7NOILU1oSKPE4Q,2083
107
107
  airbyte_cdk/sources/declarative/interpolation/interpolated_nested_mapping.py,sha256=vjwvkLk7_l6YDcFClwjCMcTleRjQBh7-dzny7PUaoG8,1857
@@ -116,7 +116,7 @@ airbyte_cdk/sources/declarative/migrations/state_migration.py,sha256=KWPjealMLKS
116
116
  airbyte_cdk/sources/declarative/models/__init__.py,sha256=nUFxNCiKeYRVXuZEKA7GD-lTHxsiKcQ8FitZjKhPIvE,100
117
117
  airbyte_cdk/sources/declarative/models/declarative_component_schema.py,sha256=uO-NMBY90yb8Kg_SdGTsXgerUKAKBM6rsWovXbvPclI,106527
118
118
  airbyte_cdk/sources/declarative/parsers/__init__.py,sha256=ZnqYNxHsKCgO38IwB34RQyRMXTs4GTvlRi3ImKnIioo,61
119
- airbyte_cdk/sources/declarative/parsers/custom_code_compiler.py,sha256=jDw_TttD3_hpfevXOH-0Ws0eRuqt6wvED0BqosGPRjI,5938
119
+ airbyte_cdk/sources/declarative/parsers/custom_code_compiler.py,sha256=nlVvHC511NUyDEEIRBkoeDTAvLqKNp-hRy8D19z8tdk,5941
120
120
  airbyte_cdk/sources/declarative/parsers/custom_exceptions.py,sha256=Rir9_z3Kcd5Es0-LChrzk-0qubAsiK_RSEnLmK2OXm8,553
121
121
  airbyte_cdk/sources/declarative/parsers/manifest_component_transformer.py,sha256=CXwTfD3wSQq3okcqwigpprbHhSURUokh4GK2OmOyKC8,9132
122
122
  airbyte_cdk/sources/declarative/parsers/manifest_reference_resolver.py,sha256=IWUOdF03o-aQn0Occo1BJCxU0Pz-QILk5L67nzw2thw,6803
@@ -358,9 +358,9 @@ airbyte_cdk/utils/slice_hasher.py,sha256=EDxgROHDbfG-QKQb59m7h_7crN1tRiawdf5uU7G
358
358
  airbyte_cdk/utils/spec_schema_transformations.py,sha256=-5HTuNsnDBAhj-oLeQXwpTGA0HdcjFOf2zTEMUTTg_Y,816
359
359
  airbyte_cdk/utils/stream_status_utils.py,sha256=ZmBoiy5HVbUEHAMrUONxZvxnvfV9CesmQJLDTAIWnWw,1171
360
360
  airbyte_cdk/utils/traced_exception.py,sha256=C8uIBuCL_E4WnBAOPSxBicD06JAldoN9fGsQDp463OY,6292
361
- airbyte_cdk-6.40.1.dist-info/LICENSE.txt,sha256=Wfe61S4BaGPj404v8lrAbvhjYR68SHlkzeYrg3_bbuM,1051
362
- airbyte_cdk-6.40.1.dist-info/LICENSE_SHORT,sha256=aqF6D1NcESmpn-cqsxBtszTEnHKnlsp8L4x9wAh3Nxg,55
363
- airbyte_cdk-6.40.1.dist-info/METADATA,sha256=cxtGJx117AJBU77S3OwsO99Qezf5qbhp7b84xIMBzaQ,6071
364
- airbyte_cdk-6.40.1.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
365
- airbyte_cdk-6.40.1.dist-info/entry_points.txt,sha256=fj-e3PAQvsxsQzyyq8UkG1k8spunWnD4BAH2AwlR6NM,95
366
- airbyte_cdk-6.40.1.dist-info/RECORD,,
361
+ airbyte_cdk-6.41.1.dist-info/LICENSE.txt,sha256=Wfe61S4BaGPj404v8lrAbvhjYR68SHlkzeYrg3_bbuM,1051
362
+ airbyte_cdk-6.41.1.dist-info/LICENSE_SHORT,sha256=aqF6D1NcESmpn-cqsxBtszTEnHKnlsp8L4x9wAh3Nxg,55
363
+ airbyte_cdk-6.41.1.dist-info/METADATA,sha256=8j8OQmwe1vPCemtpm8U5OkeIQZxyVr4uMvP1G8Tzlwg,6071
364
+ airbyte_cdk-6.41.1.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
365
+ airbyte_cdk-6.41.1.dist-info/entry_points.txt,sha256=fj-e3PAQvsxsQzyyq8UkG1k8spunWnD4BAH2AwlR6NM,95
366
+ airbyte_cdk-6.41.1.dist-info/RECORD,,