
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
This library offers the API client to communicate with kuantaz to verify a submission.
This Python library lets you connect to a kuantaz installation and verify the submitted data.
Install this library by using pip:
pip install kuantaz-api-client
<div id="kuantaz-box"></div>
<script src="https://[URL]/build/kuantaz-frontend.js" defer></script>
<script>
var kz;
window.onload = function () {
kz = new kzCaptcha("kuantaz-box", "https://[URL]", "[UUID]", "[PUBLIC_KEY]");
};
</script>
pip install kuantaz-api-client
from kuantaz_api_client import Client
api_client = Client(host, public_key, private_key)
your_post_data = {} # This needs to be filled with the post data
kuantaz_submit_token = your_post_data['_kuantaz_submitToken']
kuantaz_validation_token = your_post_data['_kuantaz_validationToken']
result = api_client.verify_submission(your_post_data, kuantaz_submit_token, kuantaz_validation_token)
if result.is_submittable():
# Send the email or process the data
pass
else:
# Show error message
pass
Create a new client object to use the API client.
from kuantaz_api_client import Client
api_client = Client(host, public_key, private_key, verify_ssl)
Parameter | Type | Description |
---|---|---|
host | str | The host of the kuantaz installation |
public_key | str | The public key of the kuantaz project |
private_key | str | The private key of the kuantaz project |
verify_ssl | bool | Set to False if the SSL certificate should not be verified. |
To verify the form data, call verify_submission
with the form data in an array and the submit and validation tokens, which kuantaz generated on the form initialization and the form data validation. The method will return a VerificationResult
object.
result = api_client.verify_submission(form_data, kuantaz_submit_token, kuantaz_validation_token)
Parameter | Type | Description |
---|---|---|
form_data | dict | The dictionary with all the submitted form data. |
kuantaz_submit_token | str | The submit token which was generated by kuantaz and submitted with the form data |
kuantaz_validation_token | str | The validation token which kuantaz generated after the validation and which was submitted with the form data |
FIELD_NOT_VERIFIED
: 'not-verified'FIELD_VALID
: 'valid'FIELD_INVALID
: 'invalid'is_submittable()
: boolReturns True
if the form is submittable. This means that the verification was successful and the
form data are valid.
is_valid()
: boolReturns True
if kuantaz determined the form as valid. The difference to is_submittable()
is, that this
is the original result from kuantaz, while is_submittable()
also checks if the verification was done correctly.
get_verified_fields()
: list (see Constants)Returns an array with all verified field keys.
get_verified_field(key)
: string (see Constants)Returns the verification status of one field.
has_issues()
: boolReturns True
if there were verification issues.
get_issues()
: listReturns an array with all verification issues.
To get the statistic data grouped by date, call get_statistic_by_date
. The method accepts a time range in seconds for which the data should be returned (last x seconds). The method will return a StatisticResult
object.
result = api_client.get_statistic_by_date(range)
Parameter | Type | Description |
---|---|---|
range | int | The time range in seconds for which the statistic should be returned (last X seconds) |
get_number_of_valid_submissions()
: intReturn the number of valid submissions in the requested time range.
get_number_of_spam_submissions()
: intReturn the number of spam submissions in the requested time range.
get_numbers_by_date()
: dictReturn the numbers grouped by date.
FAQs
Python API Client to communicate with kzCaptcha.
We found that kuantaz-api-client demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.