Skip to content

Commit 5976e68

Browse files
committed
Update README
1 parent fc07e1e commit 5976e68

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,23 @@ pip install formsg
1818

1919
The SDK provides two main utility functions for handling FormSG webhook:
2020

21-
- [`verify_signature(webhook_uri, signature_header, signature_expiry_seconds=60)`](formsg/webhook.py) verifies that the incoming webhook's signature is valid based on the FormSG production public key.
21+
- [`webhook_uri: str, signature_header: str, signature_expiry_seconds: float = 60)`](formsg/utils.py) verifies that the incoming webhook's signature is valid based on the FormSG production public key.
2222
It raises a `nacl.exceptions.BadSignatureError` if the signature is invalid.
2323
The signature header is usually found in the `X-FormSG-Signature` header.
2424
Details on how the signature is constructed can be found [here](https://github.com/opengovsg/formsg-javascript-sdk/#verifying-signatures-manually).
2525

26-
- [`decrypt_content(body_json, secret_key)`](formsg/webhook.py) will decrypt the encrypted content using the given Base-64 encoded secret key.
27-
`body_json` is expected to be a dictionary-like object.
26+
- [`decrypt_content(body: Mapping[str, Any], secret_key: str)`](formsg/utils.py) will decrypt the encrypted content using the given Base-64 encoded secret key.
27+
`body` is expected to be a dictionary-like object.
28+
29+
- [`decrypt_attachment(body: Mapping[str, Any], field_id: str, secret_key: str)`](formsg/utils.py) will decrypt the encrypted content using the given Base-64 encoded secret key.
30+
`body` is expected to be a dictionary-like object.
2831

2932
For convenience, the SDK implements a [`decrypt_django_request`](formsg/django.py) and [`decrypt_flask_request`](formsg/flask.py) which returns the decrypted FormSG content from a Django/Flask request object directly.
3033

3134
### Example with Flask
3235

3336
```python
34-
from formsg.webhook import decrypt_flask_request
37+
from formsg.flask import decrypt_flask_request
3538

3639
from flask import Flask
3740
from flask import jsonify

0 commit comments

Comments
 (0)