Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
535 changes: 535 additions & 0 deletions README-marketplace.md

Large diffs are not rendered by default.

59 changes: 59 additions & 0 deletions composer-marketplace.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"name": "omikron/magento2-factfinder",
"description": "FACTFinder Webcomponents SDK",
"type": "magento2-module",
"version": "1.0.0",
"license": "proprietary",
"authors": [
{
"name": "Omikron Data Quality GmbH",
"homepage": "https://web-components.fact-finder.de"
}
],
"require": {
"php": "~8.1.0||~8.2.0||~8.3.0",
"omikron/factfinder-communication-sdk": "^0.9.9",
"magento/framework": "^103.0.7",
"magento/module-catalog": "^104.0.7",
"magento/module-configurable-product": "^100.4.7",
"magento/module-directory": "^100.4.7",
"magento/module-store": "^101.1.7",
"magento/module-inventory": "1.2.*",
"salesforce/handlebars-php": "3.*",
"ext-json": "*",
"phpseclib/phpseclib": "~3.0"
},
"require-dev": {
"pdepend/pdepend": "^2.16",
"phpmd/phpmd" : "^2.15",
"phpunit/phpunit": "~9.5.0",
"magento/magento-coding-standard": "*",
"friendsofphp/php-cs-fixer": "^3.58"
},
"autoload": {
"files": [
"src/registration.php"
],
"psr-4": {
"Omikron\\Factfinder\\": "src"
}
},
"config": {
"allow-plugins": {
"magento/*": true,
"omikron/*": true,
"dealerdirect/phpcodesniffer-composer-installer": true
}
},
"minimum-stability": "stable",
"prefer-stable": true,
"repositories": [
{
"type": "composer",
"url": "https://repo.magento.com/"
}
],
"extra": {
"magento-force": "override"
}
}
7 changes: 6 additions & 1 deletion src/Model/Stream/Stdout.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use BadMethodCallException;
use Magento\Framework\Filesystem\DriverInterface;
use Omikron\Factfinder\Api\StreamInterface;
use RuntimeException;

class Stdout implements StreamInterface
{
Expand All @@ -31,6 +32,10 @@ public function finalize(): void
{
//after export we need to exit, output has been sent to STDOUT so it is not possible to upload it
//@phpcs:ignore Magento2.Security.LanguageConstruct.ExitUsage
exit();
// exit();

if (empty($this->file)) {
throw new RuntimeException('Feed file is empty!');
}
}
}
2 changes: 1 addition & 1 deletion src/Plugin/AnonymizeUserId.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function __construct(private readonly ScopeConfigInterface $scopeConfig)
*/
public function afterGetUserId(SessionData $_, string $userId)
{
return $this->isAnonymizationEnabled() && $userId ? md5($userId) : $userId; // phpcs:ignore
return $this->isAnonymizationEnabled() && $userId ? hash('sha256', $userId) : $userId; // phpcs:ignore
}

private function isAnonymizationEnabled(): bool
Expand Down
2 changes: 1 addition & 1 deletion src/Test/Unit/Observer/LoginStateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class LoginStateTest extends TestCase
public function testShouldSetUserIdCookie()
{
// Expect & Given
$userId = md5('some user id');
$userId = hash('sha256', 'some user id');
$this->sessionData->method('getUserId')->willReturn($userId);
$this->observer->expects($this->once())
->method('setCookie')
Expand Down
2 changes: 1 addition & 1 deletion src/Test/Unit/Plugin/AnonymizeUserIdTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function test_hash_user_id_if_option_is_enabled()
->with('factfinder/advanced/anonymize_user_id', ScopeInterface::SCOPE_STORES, null)
->willReturn(true);
$userId = '1234';
$hashed = md5($userId); //phpcs:ignore
$hashed = hash('sha256', $userId); //phpcs:ignore

$this->assertSame($hashed, $this->plugin->afterGetUserId($this->createMock(SessionData::class), $userId));
}
Expand Down
2 changes: 1 addition & 1 deletion src/view/frontend/templates/ff/communication.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ $searchImmediate = $communicationParameters['search-immediate'] ?? 'false';
<!-- Set SDK version -->
<script>
document.addEventListener(`_ffSdkVersion`, ({ setSdkVersion }) => {
setSdkVersion(`m2-5.0.3`);
setSdkVersion(`m2-mp-5.0.3`);
});
</script>

Expand Down
Loading