core.bones.captcha
¶
Module Contents¶
Classes¶
The CaptchaBone is used to ensure that a user is not a bot. |
- class core.bones.captcha.CaptchaBone(*, publicKey=None, privateKey=None, **kwargs)¶
Bases:
viur.core.bones.base.BaseBone
The CaptchaBone is used to ensure that a user is not a bot.
The Captcha bone uses the Google reCAPTCHA API to perform the Captcha validation and is derived from the BaseBone.
- Parameters:
publicKey – The public key for the Captcha validation.
privateKey – The private key for the Captcha validation.
**kwargs – Additional arguments to pass to the base class constructor.
Initializes a new Bone.
- type = 'captcha'¶
- serialize(skel, name, parentIndexed)¶
Serializing the Captcha bone is not possible so it return False
- Parameters:
skel (SkeletonInstance) –
name (str) –
parentIndexed (bool) –
- Return type:
bool
- unserialize(skel, name)¶
Unserialize the Captcha bone.
- Parameters:
skel – The SkeletonInstance containing the Captcha bone.
name – The name of the Captcha bone.
- Returns:
boolean, that is true, as the Captcha bone is always unserialized successfully.
- Return type:
bool
- fromClient(skel, name, data)¶
Reads a value from the client. If this value is valid for this bone, store this value and return None. Otherwise our previous value is left unchanged and an error-message is returned.
- Parameters:
name (str) – Our name in the skeleton
data (dict) – User-supplied request-data
skel (SkeletonInstance) –
- Returns:
None or a list of errors
- Return type:
None | list[viur.core.bones.base.ReadFromClientError]