-
Notifications
You must be signed in to change notification settings - Fork 22
Conversation
- Private key is now secret key - Public key is now site key - No concept of challenge field - Update isValid for a string $value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes make sense. However, I have a few concerns about BC; clearly, folks using the service will already have issues, and will need to update their code. However, I think we can minimize the concerns by retaining old methods and config keys, and proxying them to the new equivalents when possible.
@@ -150,10 +150,10 @@ All of the above options may be passed to the constructor by simply removing the | |||
The `Zend\Captcha\ReCaptcha` adapter uses [`Zend\Service\ReCaptcha\ReCaptcha`](https://github.com/zendframework/ZendService_ReCaptcha) | |||
to generate and validate CAPTCHAs. It exposes the following methods: | |||
|
|||
- `setPrivKey($key)` and `getPrivKey()` allow you to specify the private key to | |||
- `setSecretKey($key)` and `getSecretKey()` allow you to specify the secret key to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this change within this component, or within the recaptcha component? If this component, we should likely retain the original methods, have them proxy to the new ones, and mark them deprecated.
src/ReCaptcha.php
Outdated
$this->getService()->setPrivateKey($options['private_key']); | ||
if (! empty($options)) { | ||
if (array_key_exists('secret_key', $options)) { | ||
$this->getService()->setSecretKey($options['secret_key']); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For BC purposes, we should support the old keys.
'xhtml' => true, | ||
'lang' => null, | ||
'theme' => 'red', | ||
'secret_key' => 'secretKey', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll need to document which keys are no longer supported.
- Note what’s supported but deprecated. - Note options keys that are no longer supported.
These are proxied to secret_key and public_key, and are marked as deprecated.
@weierophinney: Documentation added along with BC methods and keys for |
We use phpcs, not php-cs-fixer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, @akrabat !
This supports v2 of the ReCaptcha API and update the CS standards to zend-coding-standard.