Skip to content

Commit 0f4e499

Browse files
feat(api): api update
1 parent b3c7347 commit 0f4e499

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 234
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-dd0c83cac837fbe98857fa997663b0d0469344a7564bd4fe506e6c71d1d6af73.yml
33
openapi_spec_hash: 2352f37602105b164533038199b21804
4-
config_hash: 890ca5fa6b8209d4eaac90550c7dc62c
4+
config_hash: b7ec7f54fa76c1f8bde7a548710a1d38

src/increase/resources/events.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,12 @@ def unwrap(self, payload: str, *, headers: Mapping[str, str], key: str | bytes |
146146
raise IncreaseError("You need to install `increase[webhooks]` to use this method") from exc
147147

148148
if key is None:
149-
key = self._client.webhook_secret
150-
if key is None:
149+
raw_key = self._client.webhook_secret
150+
if raw_key is None:
151151
raise ValueError(
152152
"Cannot verify a webhook without a key on either the client's webhook_secret or passed in as an argument"
153153
)
154+
key = raw_key.encode("utf-8")
154155

155156
if not isinstance(headers, dict):
156157
headers = dict(headers)
@@ -284,11 +285,12 @@ def unwrap(self, payload: str, *, headers: Mapping[str, str], key: str | bytes |
284285
raise IncreaseError("You need to install `increase[webhooks]` to use this method") from exc
285286

286287
if key is None:
287-
key = self._client.webhook_secret
288-
if key is None:
288+
raw_key = self._client.webhook_secret
289+
if raw_key is None:
289290
raise ValueError(
290291
"Cannot verify a webhook without a key on either the client's webhook_secret or passed in as an argument"
291292
)
293+
key = raw_key.encode("utf-8")
292294

293295
if not isinstance(headers, dict):
294296
headers = dict(headers)

tests/api_resources/test_events.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def test_streaming_response_list(self, client: Increase) -> None:
103103
@pytest.mark.parametrize(
104104
"client_opt,method_opt",
105105
[
106-
("whsec_c2VjcmV0Cg==", None),
106+
("secret\n", None),
107107
("wrong", b"secret\n"),
108108
("wrong", "whsec_c2VjcmV0Cg=="),
109109
(None, b"secret\n"),
@@ -227,7 +227,7 @@ async def test_streaming_response_list(self, async_client: AsyncIncrease) -> Non
227227
@pytest.mark.parametrize(
228228
"client_opt,method_opt",
229229
[
230-
("whsec_c2VjcmV0Cg==", None),
230+
("secret\n", None),
231231
("wrong", b"secret\n"),
232232
("wrong", "whsec_c2VjcmV0Cg=="),
233233
(None, b"secret\n"),

0 commit comments

Comments
 (0)