Skip to content

Commit 248a7a9

Browse files
committed
Added the info about bypass protection and added the SECURITY file
1 parent 00e5bae commit 248a7a9

File tree

4 files changed

+27
-2
lines changed

4 files changed

+27
-2
lines changed

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,28 @@ result = api_client.verify_submission(form_data, mosparo_submit_token, mosparo_v
114114
| mosparo_submit_token | str | The submit token which was generated by mosparo and submitted with the form data |
115115
| mosparo_validation_token | str | The validation token which mosparo generated after the validation and which was submitted with the form data |
116116

117+
#### Bypass protection
118+
119+
After the verification of the submission by mosparo, you have to verify that all required fields and all possible fields were verified correctly. For this you have to check that all your required fields are set in the result ([get_verified_fields](#get_verified_fields-list-see-constants)).
120+
121+
See [Bypass protection](https://documentation.mosparo.io/docs/integration/bypass_protection) in the mosparo documentation.
122+
123+
##### Example
124+
125+
```python
126+
verified_fields = result.get_verified_fields()
127+
required_field_difference = set(list_of_required_field_names) - set(verified_fields.keys())
128+
verifiable_field_difference = set(list_of_verifiable_field_names) - set(verified_fields.keys())
129+
130+
# The submission is only valid if all required and verifiable fields got verified
131+
if result.is_submittable() and not required_field_difference and not verifiable_field_difference:
132+
print('All good, send email')
133+
else:
134+
raise Exception('mosparo did not verify all required fields. This submission looks like spam.')
135+
```
136+
137+
`list_of_required_field_names` and `list_of_verifiable_field_names` contain the names of all required or verifiable fields. Verifiable fields are fields that mosparo can validate and verify (for example, text fields). A checkbox field, for example, will not be validated and verified by mosparo.
138+
117139
### VerificationResult
118140

119141
#### Constants

SECURITY.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Security
2+
3+
See the SECURITY.md file of [mosparo/mosparo](https://github.com/mosparo/mosparo/blob/master/SECURITY.md) on GitHub or [security.txt](https://mosparo.io/security.txt)

mosparo_api_client/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__project__ = 'mosparo_api_client'
2-
__version__ = "1.1.0"
2+
__version__ = "1.1.1"
33

44
from .Client import *
55
from .MosparoException import *

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "mosparo_api_client"
7-
version = "1.1.0"
7+
version = "1.1.1"
88
description = "Python API Client to communicate with mosparo."
99
readme = "README.md"
1010
authors = [{ name = "mosparo Core Developers", email = "info@mosparo.io" }]

0 commit comments

Comments
 (0)