Skip to content

Commit 06d1f17

Browse files
committed
coderabbit fixes
1 parent 8481137 commit 06d1f17

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

airbyte_cdk/sources/declarative/interpolation/filters.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,14 +141,14 @@ def hmac(value: Any, key: str, hash_type: str = "sha256") -> str:
141141
Implementation of a custom Jinja2 hmac filter with SHA-256 support.
142142
143143
This filter creates a Hash-based Message Authentication Code (HMAC) using a cryptographic
144-
hash function and a secret key. Currently only supports SHA-256.
144+
hash function and a secret key. Currently only supports SHA-256, and returns hexdigest of the signature.
145145
146146
Example usage in a low code connector:
147147
148148
auth_headers:
149149
$ref: "#/definitions/base_auth"
150150
$parameters:
151-
signature: "{{ 'message_to_sign' | hmac_hash('my_secret_key') }}"
151+
signature: "{{ 'message_to_sign' | hmac('my_secret_key') }}"
152152
153153
:param value: The message to be authenticated
154154
:param key: The secret key for the HMAC

unit_tests/sources/declarative/interpolation/test_filters.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,5 +162,5 @@ def test_hmac_with_invalid_hash_type() -> None:
162162

163163
s = "{{ '%s' | hmac('%s', 'md5') }}" % (message, secret_key)
164164

165-
with pytest.raises(Exception):
165+
with pytest.raises(ValueError):
166166
interpolation.eval(s, config={})

0 commit comments

Comments
 (0)