You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+3-4Lines changed: 3 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,16 +18,15 @@ pip install formsg
18
18
19
19
The SDK provides two main utility functions for handling FormSG webhook:
20
20
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.
21
+
-[`webhook_uri: str, signature_header: str, signature_expiry_seconds: float = 60) -> Mapping[str, Any]`](formsg/utils.py) verifies that the incoming webhook's signature is valid based on the FormSG production public key.
22
22
It raises a `nacl.exceptions.BadSignatureError` if the signature is invalid.
23
23
The signature header is usually found in the `X-FormSG-Signature` header.
24
24
Details on how the signature is constructed can be found [here](https://github.com/opengovsg/formsg-javascript-sdk/#verifying-signatures-manually).
25
25
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.
26
+
-[`decrypt_content(body: Mapping[str, Any], secret_key: str) -> Mapping[str, Any]`](formsg/utils.py) will decrypt the encrypted content using the given Base-64 encoded secret key.
27
27
`body` is expected to be a dictionary-like object.
28
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.
29
+
-[`decrypt_attachment(body: Mapping[str, Any], field_id: str, secret_key: str) -> bytes`](formsg/utils.py) will download and decrypt the encrypted attachment for a `field` and using the given Base-64 encoded secret key. `body` is expected to be a dictionary-like object.
31
30
32
31
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.
0 commit comments