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
* add risk intelligence on siteverify
* add risk intelligence /retrieve
* bump required python version
* fix actions
* use importlib.metadata instead of deprecated pkg_resources
* bump version
* format
* fix tests
* support new response format
* support optional sitekey
* save raw risk intelligence response
* always use latest version in examples and add comment
* Bump pydantic version
* Fix deprecation warnings from pydantic bump
These validators should now be instance methods rather than class
methods.
* Ensure response.success==False if there is an error
* require >= for requests
* unify the example
* reformat example
---------
Co-authored-by: Aaron Greenberg <aaron@friendlycaptcha.com>
print(result.data.risk_intelligence) # The risk intelligence data
87
+
```
88
+
74
89
### Configuration
75
90
76
91
The client offers several configuration options:
77
92
78
93
-**api_key**: Your Friendly Captcha API key.
79
-
-**sitekey**: Your Friendly Captcha sitekey.
94
+
-**sitekey**: (Optional) Your Friendly Captcha sitekey. Configure this if you want to ensure that a captcha solution or risk intelligence token was generated from a specific sitekey.
80
95
-**strict**: (Optional) In case the client was not able to verify the captcha response at all (for example if there is a network failure or a mistake in configuration), by default the `verify_captcha_response` returns `True` regardless. By passing `strict=True`, it will return `False` instead: every response needs to be strictly verified.
81
-
-**siteverify_endpoint**: (Optional) The endpoint URL for the site verification API. Shorthands `eu` or `global` are also accepted. Default is `global`.
96
+
-**api_endpoint**: (Optional) Base API endpoint (for example `https://eu.frcapi.com`). Shorthands `eu` or `global` are also accepted. Default is `global`.
97
+
-**siteverify_endpoint**: (Optional,Deprecated) Kept for backwards compatibility, use `api_endpoint` instead. Accepts a full siteverify URL or shorthands `eu`/`global`; path is stripped and converted to `api_endpoint`.
82
98
-**verbose**: (Optional) Default is False. Turn on basic logging.
83
99
- Error Handling: The client has built-in error handling mechanisms. In case of unexpected responses or errors from the Friendly Captcha API, the client will log the error and provide a default response.
This application integrates Friendly Captcha for form submissions using FastAPI.
4
+
It verifies captcha responses and retrieves risk intelligence (if enabled on the application) from the same form flow.
4
5
5
6
### Requirements
6
7
7
-
- Python 3.9+
8
+
- Python 3.10+
8
9
- Your Friendly Captcha API key and sitekey.
9
10
10
11
### Start the application
11
12
12
-
- Clone the repository:
13
-
14
-
```bash
15
-
git clone <repository_url>
16
-
cd<repository_directory>
17
-
```
18
-
19
13
- Set up a virtual environment (recommended):
20
14
21
15
```bash
@@ -24,15 +18,16 @@ source venv/bin/activate # On Windows, use `venv\Scripts\activate`
24
18
pip install -r requirements.txt
25
19
```
26
20
27
-
-Setup env variables and start the application
21
+
-Set environment variables and start the application
28
22
29
-
> NOTE: `FRC_SITEVERIFY_ENDPOINT` and `FRC_WIDGET_ENDPOINT` are optional. If not set, the default values will be used. You can also use `global` or `eu` as shorthands for both.
23
+
> NOTE: `FRC_API_ENDPOINT` and `FRC_WIDGET_ENDPOINT` are optional. If not set, default values are used. You can also use `global` or `eu` as shorthands for both.
24
+
> For the frontend `data-api-endpoint`, use the base endpoint (for example `http://localhost:8182`), not `/api/v2/captcha`.
0 commit comments