Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Support ZendService-ReCaptcha v3 #29

Merged
merged 10 commits into from
Feb 14, 2017
Merged

Conversation

akrabat
Copy link
Contributor

@akrabat akrabat commented Feb 10, 2017

This supports v2 of the ReCaptcha API and update the CS standards to zend-coding-standard.

Copy link
Member

@weierophinney weierophinney left a 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
Copy link
Member

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.

$this->getService()->setPrivateKey($options['private_key']);
if (! empty($options)) {
if (array_key_exists('secret_key', $options)) {
$this->getService()->setSecretKey($options['secret_key']);
}
Copy link
Member

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',
Copy link
Member

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.
@akrabat
Copy link
Contributor Author

akrabat commented Feb 13, 2017

@weierophinney: Documentation added along with BC methods and keys for privKey & pubKey.

@akrabat akrabat mentioned this pull request Feb 13, 2017
Copy link
Member

@weierophinney weierophinney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, @akrabat !

@akrabat akrabat added this to the 2.7.0 milestone Feb 14, 2017
@akrabat akrabat merged commit 43fb5b6 into zendframework:develop Feb 14, 2017
akrabat added a commit that referenced this pull request Feb 14, 2017
akrabat added a commit that referenced this pull request Feb 15, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants