-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[!!!]FEATURE] Release new major version to switch to v2 of Friendlyca…
…ptcha
- Loading branch information
Showing
23 changed files
with
74 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,11 +11,11 @@ | |
|
||
class Configuration | ||
{ | ||
public const DEFAULT_JS_PATH = 'EXT:friendlycaptcha_official/Resources/Public/JavaScript/lib/widget-0.9.12.min.js'; | ||
public const DEFAULT_JS_PATH = 'EXT:friendlycaptcha_official/Resources/Public/JavaScript/lib/[email protected].min.js'; | ||
|
||
protected string $siteKey = ''; | ||
protected string $siteSecretKey = ''; | ||
protected string $puzzleUrl = ''; | ||
protected bool $useEuPuzzleEndpoint = false; | ||
protected string $verifyUrl = ''; | ||
protected string $jsPath = ''; | ||
protected bool $skipDevValidation = false; | ||
|
@@ -31,15 +31,15 @@ public function __construct(Site $site = null) | |
$siteConfiguration = $site->getConfiguration(); | ||
$this->siteKey = trim($siteConfiguration['friendlycaptcha_site_key'] ?? ''); | ||
$this->siteSecretKey = trim($siteConfiguration['friendlycaptcha_secret_key'] ?? ''); | ||
$this->puzzleUrl = trim($siteConfiguration['friendlycaptcha_puzzle_url'] ?? ''); | ||
$this->useEuPuzzleEndpoint = (bool)($siteConfiguration['friendlycaptcha_use_eu_puzzle_endpoint'] ?? false); | ||
$this->verifyUrl = trim($siteConfiguration['friendlycaptcha_verify_url'] ?? ''); | ||
$this->jsPath = trim($siteConfiguration['friendlycaptcha_js_path'] ?? ''); | ||
$this->skipDevValidation = (bool)($siteConfiguration['friendlycaptcha_skip_dev_validation'] ?? false); | ||
} | ||
|
||
public function isEnabled(): bool | ||
{ | ||
return $this->siteKey !== '' && $this->siteSecretKey !== '' && $this->puzzleUrl !== '' && $this->verifyUrl !== '' && !$this->hasSkipHeaderValidation(); | ||
return $this->siteKey !== '' && $this->siteSecretKey !== '' && $this->verifyUrl !== '' && !$this->hasSkipHeaderValidation(); | ||
} | ||
|
||
public function getSiteKey(): string | ||
|
@@ -52,9 +52,9 @@ public function getSiteSecretKey(): string | |
return $this->siteSecretKey; | ||
} | ||
|
||
public function getPuzzleUrl(): string | ||
public function useEuPuzzleEndpoint(): bool | ||
{ | ||
return $this->puzzleUrl; | ||
return $this->useEuPuzzleEndpoint; | ||
} | ||
|
||
public function getVerifyUrl(): string | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Add FriendlyCaptcha field to Powermail | ||
tx_powermail.flexForm.type.addFieldOptions { | ||
friendlycaptcha = FriendlyCaptcha | ||
friendlycaptcha = FriendlyCaptcha V2 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
.. include:: /Includes.rst.txt | ||
|
||
.. _v2_migration: | ||
|
||
============ | ||
Migration to FriendlyCaptcha V2 | ||
============ | ||
|
||
If you’re currently using an earlier version of the plugin with **Friendly Captcha V1** and want to switch to **Friendly Captcha V2**: | ||
|
||
* Enable **V2** in yout Application in the Panel at https://friendlycaptcha.com/ | ||
* Install the newest version of the plugin (min v1.0) | ||
* In TYPO3 backend, go to the *Site Management*/*Sites* module and switch to the **FriendlyCaptcha** tab. You need to change the URLs | ||
**Puzzle Endpoint** - check it if you want to use the EU Endpoint | ||
**Verify URL** - `https://global.frcapi.com/api/v2/captcha/siteverify` or `https://eu.frcapi.com/api/v2/captcha/siteverify` if you prefer to use EU endpoint | ||
**JavaScript Path** - `EXT:friendlycaptcha_official/Resources/Public/JavaScript/lib/[email protected]` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,6 @@ | |
|
||
use StudioMitte\FriendlyCaptcha\Tests\RequestTrait; | ||
use StudioMitte\FriendlyCaptcha\ViewHelpers\ConfigurationViewHelper; | ||
use TYPO3\CMS\Fluid\Core\Rendering\RenderingContext; | ||
use TYPO3\TestingFramework\Core\BaseTestCase; | ||
|
||
class ConfigurationViewHelperTest extends BaseTestCase | ||
|
@@ -19,17 +18,14 @@ class ConfigurationViewHelperTest extends BaseTestCase | |
public function viewHelperReturnsProperConfiguration() | ||
{ | ||
self::setupRequest(); | ||
$configurationViewHelper = new ConfigurationViewHelper(); | ||
|
||
$renderingContext = new class () extends RenderingContext { | ||
public function __construct() {} | ||
}; | ||
self::assertSame([ | ||
'languageIsoCode' => 'en', | ||
'siteKey' => '1234', | ||
'verifyUrl' => 'https://verify,https://verify2', | ||
'puzzleUrl' => 'https://puzzle', | ||
'jsPath' => 'EXT:friendlycaptcha_official/Resources/Public/JavaScript/lib/widget-0.9.12.min.js', | ||
'useEuPuzzleEndpoint' => false, | ||
'jsPath' => 'EXT:friendlycaptcha_official/Resources/Public/JavaScript/lib/[email protected].min.js', | ||
'enabled' => true, | ||
], ConfigurationViewHelper::renderStatic([], static fn() => '', $renderingContext)); | ||
], $configurationViewHelper->render()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,5 +17,5 @@ | |
], | ||
], | ||
'state' => 'beta', | ||
'version' => '0.1.8', | ||
'version' => '2.0.0', | ||
]; |