Skip to content

Commit 1b3b78e

Browse files
chore: remove custom code
1 parent e276951 commit 1b3b78e

File tree

9 files changed

+252
-594
lines changed

9 files changed

+252
-594
lines changed

README.md

Lines changed: 0 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -216,96 +216,6 @@ client.files.create(
216216

217217
The async client uses the exact same interface. If you pass a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance, the file contents will be read asynchronously automatically.
218218

219-
## Webhook verification
220-
221-
Verifying webhook signatures is _optional but encouraged_.
222-
223-
For more information about webhooks, see [the API docs](https://increase.com/documentation/webhooks#events-and-webhooks).
224-
225-
### Parsing webhook payloads
226-
227-
For most use cases, you will likely want to verify the webhook and parse the payload at the same time. To achieve this, we provide the method `client.webhooks.unwrap()`, which parses a webhook request and verifies that it was sent by Increase. This method will raise an error if the signature is invalid.
228-
229-
Note that the `body` parameter must be the raw JSON string sent from the server (do not parse it first). The `.unwrap()` method will parse this JSON for you into an event object after verifying the webhook was sent from Increase.
230-
231-
```python
232-
from increase import Increase
233-
from flask import Flask, request
234-
235-
app = Flask(__name__)
236-
237-
# You can also configure the webhook secret with any of:
238-
# - The `INCREASE_WEBHOOK_SECRET` environment variable.
239-
# - The `webhook_secret` argument to the Increase client.
240-
# - The `secret` argument to `webhooks.unwrap`
241-
client = Increase()
242-
243-
244-
@app.route("/webhook", methods=["POST"])
245-
def webhook():
246-
request_body = request.get_data(as_text=True)
247-
248-
try:
249-
event = client.webhooks.unwrap(request_body, request.headers, secret="your webhook secret")
250-
251-
if event.type == "account.created":
252-
print("Account created:", event.data)
253-
elif event.type == "account.updated":
254-
print("Account updated:", event.data)
255-
else:
256-
print("Unhandled event type:", event.type)
257-
258-
return "ok"
259-
except Exception as e:
260-
print("Invalid signature:", e)
261-
return "Invalid signature", 400
262-
263-
264-
if __name__ == "__main__":
265-
app.run(port=8000)
266-
```
267-
268-
### Verifying webhook payloads directly
269-
270-
In some cases, you may want to verify the webhook separately from parsing the payload. If you prefer to handle these steps separately, we provide the method `client.webhooks.verify_signature()` to _only verify_ the signature of a webhook request. Like `.unwrap()`, this method will raise an error if the signature is invalid.
271-
272-
Note that the `body` parameter must be the raw JSON string sent from the server (do not parse it first). You will then need to parse the body after verifying the signature.
273-
274-
```python
275-
import json
276-
from increase import Increase
277-
from flask import Flask, request
278-
279-
app = Flask(__name__)
280-
281-
# You can also configure the webhook secret with any of:
282-
# - The `INCREASE_WEBHOOK_SECRET` environment variable.
283-
# - The `webhook_secret` argument to the Increase client.
284-
# - The `secret` argument to `webhooks.unwrap`
285-
client = Increase()
286-
287-
288-
@app.route("/webhook", methods=["POST"])
289-
def webhook():
290-
request_body = request.get_data(as_text=True)
291-
292-
try:
293-
client.webhooks.verify_signature(request_body, request.headers)
294-
295-
# Parse the body after verification
296-
event = json.loads(request_body)
297-
print("Verified event:", event)
298-
299-
return "ok"
300-
except Exception as e:
301-
print("Invalid signature:", e)
302-
return "Invalid signature", 400
303-
304-
305-
if __name__ == "__main__":
306-
app.run(port=8000)
307-
```
308-
309219
## Handling errors
310220

311221
When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `increase.APIConnectionError` is raised.

SECURITY.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
11
# Security Policy
22

3-
Please visit https://increase.com/security for our security policy.
3+
## Reporting Security Issues
4+
5+
This SDK is generated by [Stainless Software Inc](http://stainless.com). Stainless takes security seriously, and encourages you to report any security vulnerability promptly so that appropriate action can be taken.
6+
7+
To report a security issue, please contact the Stainless team at security@stainless.com.
8+
9+
## Responsible Disclosure
10+
11+
We appreciate the efforts of security researchers and individuals who help us maintain the security of
12+
SDKs we generate. If you believe you have found a security vulnerability, please adhere to responsible
13+
disclosure practices by allowing us a reasonable amount of time to investigate and address the issue
14+
before making any information public.
15+
16+
## Reporting Non-SDK Related Security Issues
17+
18+
If you encounter security issues that are not directly related to SDKs but pertain to the services
19+
or products provided by Increase, please follow the respective company's security reporting guidelines.
20+
21+
### Increase Terms and Policies
22+
23+
Please contact dev-feedback@increase.com for any questions or concerns regarding the security of our services.
24+
25+
---
26+
27+
Thank you for helping us keep the SDKs and systems they interact with secure.

api.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -759,13 +759,6 @@ Methods:
759759
- <code title="get /intrafi_exclusions">client.intrafi_exclusions.<a href="./src/increase/resources/intrafi_exclusions.py">list</a>(\*\*<a href="src/increase/types/intrafi_exclusion_list_params.py">params</a>) -> <a href="./src/increase/types/intrafi_exclusion.py">SyncPage[IntrafiExclusion]</a></code>
760760
- <code title="post /intrafi_exclusions/{intrafi_exclusion_id}/archive">client.intrafi_exclusions.<a href="./src/increase/resources/intrafi_exclusions.py">archive</a>(intrafi_exclusion_id) -> <a href="./src/increase/types/intrafi_exclusion.py">IntrafiExclusion</a></code>
761761

762-
# Webhooks
763-
764-
Methods:
765-
766-
- <code>client.webhooks.<a href="./src/increase/resources/webhooks.py">unwrap</a>(\*args) -> object</code>
767-
- <code>client.webhooks.<a href="./src/increase/resources/webhooks.py">verify_signature</a>(\*args) -> None</code>
768-
769762
# CardTokens
770763

771764
Types:

src/increase/_base_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -804,7 +804,7 @@ def _should_retry(self, response: httpx.Response) -> bool:
804804
return False
805805

806806
def _idempotency_key(self) -> str:
807-
return f"increase-python-retry-{uuid.uuid4()}"
807+
return f"stainless-python-retry-{uuid.uuid4()}"
808808

809809

810810
class _DefaultHttpxClient(httpx.Client):

0 commit comments

Comments
 (0)