ReCaptchaV3Connection
in package
implements
ConnectionTypeInterface
FinalYes
Google reCAPTCHA v3 — score based, never shows a challenge. An alternative to {@see ReCaptchaV2Connection} (same group): the operator enables one of them.
A v3 key pair is a different key type at Google; v2 keys do not work here.
Table of Contents
Interfaces
- ConnectionTypeInterface
- A kind of external connection the system knows how to use (reCAPTCHA, maps…).
Constants
- CODE : string = 'recaptcha_v3'
- DEFAULT_MIN_SCORE : float = 0.5
- FIELD_MIN_SCORE : string = 'minScore'
- Requests scoring below this are rejected; Google's own suggested default.
- FIELD_SECRET_KEY : string = 'secretKey'
- FIELD_SITE_KEY : string = 'siteKey'
Methods
- check() : ConnectionCheck|null
- Verifies the given values against the third party. Null = this type cannot be verified remotely.
- getCode() : string
- Stable identifier stored in `cms_system_external_connections.type`.
- getFields() : array<int, ConnectionField>
- getGroup() : string
- Connections of the same group are alternatives (e.g. `captcha`: reCAPTCHA v2 or v3) — only one of them should be enabled. Null = independent connection.
- supportsCheck() : bool
- Same limitation as v2: `siteverify` cannot tell a wrong secret without a real browser token.
Constants
CODE
public
string
CODE
= 'recaptcha_v3'
DEFAULT_MIN_SCORE
public
float
DEFAULT_MIN_SCORE
= 0.5
FIELD_MIN_SCORE
Requests scoring below this are rejected; Google's own suggested default.
public
string
FIELD_MIN_SCORE
= 'minScore'
FIELD_SECRET_KEY
public
string
FIELD_SECRET_KEY
= 'secretKey'
FIELD_SITE_KEY
public
string
FIELD_SITE_KEY
= 'siteKey'
Methods
check()
Verifies the given values against the third party. Null = this type cannot be verified remotely.
public
check(array<string|int, mixed> $values) : ConnectionCheck|null
Parameters
- $values : array<string|int, mixed>
Return values
ConnectionCheck|nullgetCode()
Stable identifier stored in `cms_system_external_connections.type`.
public
getCode() : string
Return values
stringgetFields()
public
getFields() : array<int, ConnectionField>
Return values
array<int, ConnectionField>getGroup()
Connections of the same group are alternatives (e.g. `captcha`: reCAPTCHA v2 or v3) — only one of them should be enabled. Null = independent connection.
public
getGroup() : string
Return values
stringsupportsCheck()
Same limitation as v2: `siteverify` cannot tell a wrong secret without a real browser token.
public
supportsCheck() : bool