Cette révision appartient à :
Daniel Seifert 2022-12-13 22:24:33 +01:00
Parent 4183ebcf99
révision 68b9f53c14
Signé par: DanielS
ID de la clé GPG: 6A513E13AEE66170
81 fichiers modifiés avec 271 ajouts et 218 suppressions

1
.gitignore externe
Voir le fichier

@ -1,3 +1,4 @@
.idea
.php_cs.cache
src/tests/.phpunit.result.cache
src/tests/reports/

13
.php-cs-fixer.php Fichier normal
Voir le fichier

@ -0,0 +1,13 @@
<?php
$finder = PhpCsFixer\Finder::create()
->in(__DIR__)
;
$config = new PhpCsFixer\Config();
return $config->setRules([
'@PHP74Migration' => true,
'@PSR12' => true
])
->setFinder($finder)
;

Voir le fichier

@ -39,6 +39,7 @@
"ext-json": "*"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.19",
"phpstan/phpstan": "^1.8"
},
"autoload": {

Voir le fichier

@ -78,7 +78,7 @@ class d3user_webauthn extends AdminDetailsController
public function requestNewCredential(): void
{
try {
$this->setPageType( 'requestnew' );
$this->setPageType('requestnew');
$this->setAuthnRegister();
} catch (Exception|ContainerExceptionInterface|NotFoundExceptionInterface|DoctrineDriverException $e) {
$this->d3GetMockableRegistryObject(UtilsView::class)->addErrorToDisplay($e->getMessage());
@ -97,16 +97,16 @@ class d3user_webauthn extends AdminDetailsController
{
try {
$error = Registry::getRequest()->getRequestEscapedParameter('error');
if ( strlen((string) $error) ) {
if (strlen((string) $error)) {
/** @var WebauthnCreateException $e */
$e = oxNew(WebauthnCreateException::class, $error);
throw $e;
}
$credential = Registry::getRequest()->getRequestEscapedParameter('credential');
if ( strlen((string) $credential) ) {
if (strlen((string) $credential)) {
$webauthn = $this->d3GetMockableOxNewObject(Webauthn::class);
$webauthn->saveAuthn($credential, Registry::getRequest()->getRequestEscapedParameter( 'keyname' ) );
$webauthn->saveAuthn($credential, Registry::getRequest()->getRequestEscapedParameter('keyname'));
}
} catch (WebauthnException $e) {
$this->d3GetMockableLogger()->error($e->getDetailedErrorMessage(), ['UserId' => $this->getEditObjectId()]);
@ -175,4 +175,4 @@ class d3user_webauthn extends AdminDetailsController
$credential = $this->d3GetMockableOxNewObject(PublicKeyCredential::class);
$credential->delete(Registry::getRequest()->getRequestEscapedParameter('deleteoxid'));
}
}
}

Voir le fichier

@ -118,7 +118,8 @@ class d3webauthnadminlogin extends AdminController
public function d3AssertAuthn(): ?string
{
try {
$login = $this->d3GetMockableOxNewObject(WebauthnLogin::class,
$login = $this->d3GetMockableOxNewObject(
WebauthnLogin::class,
$this->d3GetMockableRegistryObject(Request::class)->getRequestEscapedParameter('credential'),
$this->d3GetMockableRegistryObject(Request::class)->getRequestEscapedParameter('error')
);
@ -162,4 +163,4 @@ class d3webauthnadminlogin extends AdminController
{
return $this->previousClassIsOrderStep();
}
}
}

Voir le fichier

@ -27,4 +27,4 @@ trait accountTrait
parent::__construct();
}
}
}

Voir le fichier

@ -54,4 +54,4 @@ trait checkoutGetUserTrait
return $user;
}
}
}

Voir le fichier

@ -125,7 +125,7 @@ class d3_account_webauthn extends AccountController
$error = Registry::getRequest()->getRequestEscapedParameter('error');
if (strlen((string) $error)) {
/** @var WebauthnCreateException $e */
$e = oxNew( WebauthnCreateException::class, $error);
$e = oxNew(WebauthnCreateException::class, $error);
throw $e;
}
@ -135,7 +135,7 @@ class d3_account_webauthn extends AccountController
$webauthn->saveAuthn($credential, Registry::getRequest()->getRequestEscapedParameter('keyname'));
}
} catch (WebauthnException $e) {
$this->d3GetMockableRegistryObject(UtilsView::class)->addErrorToDisplay( $e );
$this->d3GetMockableRegistryObject(UtilsView::class)->addErrorToDisplay($e);
}
}
@ -180,4 +180,4 @@ class d3_account_webauthn extends AccountController
return $aPaths;
}
}
}

Voir le fichier

@ -156,4 +156,4 @@ class d3webauthnlogin extends FrontendController
return $aPaths;
}
}
}

Voir le fichier

@ -49,7 +49,7 @@ class PublicKeyCredential extends BaseModel
public function setName(string $name): void
{
$this->assign([
'name' => $name
'name' => $name,
]);
}
@ -67,7 +67,7 @@ class PublicKeyCredential extends BaseModel
public function setCredentialId(string $credentialId): void
{
$this->assign([
'credentialid' => base64_encode($credentialId)
'credentialid' => base64_encode($credentialId),
]);
}
@ -85,7 +85,7 @@ class PublicKeyCredential extends BaseModel
public function setUserId(string $userId): void
{
$this->assign([
'oxuserid' => $userId
'oxuserid' => $userId,
]);
}
@ -103,7 +103,7 @@ class PublicKeyCredential extends BaseModel
public function setCredential(PublicKeyCredentialSource $credential): void
{
$this->assign([
'credential' => base64_encode(serialize($credential))
'credential' => base64_encode(serialize($credential)),
]);
}
@ -182,4 +182,4 @@ class PublicKeyCredential extends BaseModel
return strlen((string) $oxid) ? $oxid : null;
}
}
}

Voir le fichier

@ -162,4 +162,4 @@ class PublicKeyCredentialList extends ListModel implements PublicKeyCredentialSo
$base = $this->getBaseObject();
$base->saveCredentialSource($publicKeyCredentialSource);
}
}
}

Voir le fichier

@ -23,4 +23,4 @@ class WebauthnCreateException extends WebauthnException
{
return WebauthnConf::TYPE_CREATE;
}
}
}

Voir le fichier

@ -26,19 +26,19 @@ class WebauthnException extends StandardException
public $detailedErrorMessage = null;
public function __construct( $sMessage = "not set", $iCode = 0, Exception $previous = null )
public function __construct($sMessage = "not set", $iCode = 0, Exception $previous = null)
{
$this->setDetailedErrorMessage($sMessage);
$this->d3CallMockableFunction(
[
StandardException::class,
'__construct'
'__construct',
],
[
$this->getErrorMessageTranslator()->translateError($sMessage, $this->getRequestType()),
$iCode,
$previous
$previous,
]
);
}
@ -75,4 +75,4 @@ class WebauthnException extends StandardException
{
$this->detailedErrorMessage = 'Webauthn: '.$detailedErrorMessage;
}
}
}

Voir le fichier

@ -23,4 +23,4 @@ class WebauthnGetException extends WebauthnException
{
return WebauthnConf::TYPE_GET;
}
}
}

Voir le fichier

@ -19,4 +19,4 @@ use OxidEsales\Eshop\Core\Exception\StandardException;
class WebauthnLoginErrorException extends StandardException
{
}
}

Voir le fichier

@ -29,11 +29,11 @@ class RelyingPartyEntity extends PublicKeyCredentialRpEntity
$this->d3CallMockableFunction(
[
PublicKeyCredentialRpEntity::class,
'__construct'
'__construct',
],
[
$this->getActiveShop()->getFieldData('oxname'),
$this->getRPShopUrl()
$this->getRPShopUrl(),
]
);
}
@ -79,4 +79,4 @@ class RelyingPartyEntity extends PublicKeyCredentialRpEntity
{
return $this->d3GetMockableRegistryObject(Config::class)->getActiveShop();
}
}
}

Voir le fichier

@ -39,13 +39,13 @@ class UserEntity extends PublicKeyCredentialUserEntity
$this->d3CallMockableFunction(
[
PublicKeyCredentialUserEntity::class,
'__construct'
'__construct',
],
[
strtolower($user->getFieldData('oxusername')),
$user->getId(),
$user->getFieldData('oxfname') . ' ' . $user->getFieldData('oxlname')
$user->getFieldData('oxfname') . ' ' . $user->getFieldData('oxlname'),
]
);
}
}
}

Voir le fichier

@ -56,7 +56,7 @@ class Webauthn
!empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https' ||
!empty($_SERVER['HTTP_X_FORWARDED_SSL']) && $_SERVER['HTTP_X_FORWARDED_SSL'] == 'on' ||
in_array($_SERVER['REMOTE_ADDR'], ['127.0.0.1', '::1']) || // is localhost
(isset($_SERVER['REMOTE_ADDR']) && preg_match('/.*\.localhost$/mi', $_SERVER['REMOTE_ADDR']) ) // localhost is TLD
(isset($_SERVER['REMOTE_ADDR']) && preg_match('/.*\.localhost$/mi', $_SERVER['REMOTE_ADDR'])) // localhost is TLD
) {
return true;
}
@ -123,7 +123,7 @@ class Webauthn
*/
protected function jsonEncode($creationOptions)
{
return json_encode($creationOptions,JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
return json_encode($creationOptions, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
}
/**
@ -225,9 +225,9 @@ class Webauthn
try {
$this->getServer()->loadAndCheckAssertionResponse(
html_entity_decode( $response ),
html_entity_decode($response),
$this->d3GetMockableRegistryObject(Session::class)
->getVariable( self::SESSION_ASSERTION_OPTIONS ),
->getVariable(self::SESSION_ASSERTION_OPTIONS),
$userEntity,
$serverRequest
);
@ -308,4 +308,4 @@ class Webauthn
return is_array($list) && count($list);
}
}
}

Voir le fichier

@ -78,4 +78,4 @@ class WebauthnAfterLogin
$myUtilsServer->setOxCookie("oxidadminlanguage", $aLanguages[$iLang]->abbr, time() + 31536000);
$language->setTplLanguage($iLang);
}
}
}

Voir le fichier

@ -41,4 +41,4 @@ class WebauthnConf
public const TYPE_CREATE = 'TYPECREATE';
public const TYPE_GET = 'TYPEGET';
}
}

Voir le fichier

@ -59,7 +59,7 @@ class WebauthnErrors
}
if (strtoupper($msg) === self::UNSECURECONNECTION) {
return $lang->translateString($msg);
return $lang->translateString($msg);
}
return $lang->translateString('D3_WEBAUTHN_ERR_TECHNICALERROR', null, true);
@ -72,9 +72,9 @@ class WebauthnErrors
public function getErrIdFromMessage(string $msg): string
{
if (is_int(strpos($msg, ':'))) {
return trim( strtolower( substr( $msg, 0, strpos( $msg, ':' ) ) ) );
return trim(strtolower(substr($msg, 0, strpos($msg, ':'))));
}
return trim(strtolower($msg));
}
}
}

Voir le fichier

@ -360,4 +360,4 @@ class WebauthnLogin
$session->setVariable(WebauthnConf::WEBAUTHN_SESSION_AUTH, $this->getCredential());
$session->setVariable(WebauthnConf::OXID_FRONTEND_AUTH, $user->getId());
}
}
}

Voir le fichier

@ -16,7 +16,7 @@ $sLangName = 'Deutsch';
// -------------------------------
// RESOURCE IDENTIFIER = STRING
// -------------------------------
$aLang = array(
$aLang = [
'charset' => 'UTF-8',
'PAGE_TITLE_D3WEBAUTHNLOGIN' => 'Passwortloses Anmelden',
@ -25,7 +25,7 @@ $aLang = array(
'D3_WEBAUTHN_ACCOUNT_DESC' => 'Verwalten Sie hier Ihre Anmeldeschlüssel.',
'D3_WEBAUTHN_ACC_REGISTERNEW' => 'neue Registrierung erstellen',
'D3_WEBAUTHN_ACC_ADDKEY' => 'Sicherheitsschlüssel hinzufügen',
'D3_WEBAUTHN_ACC_REGISTEREDKEYS' => 'registrierte Schlüssel',
'WEBAUTHN_INPUT_HELP' => 'Bitte mit Hardwareschlüssel authentisieren.',
@ -47,4 +47,4 @@ $aLang = array(
'D3_WEBAUTHN_ERR_UNSECURECONNECTION' => 'Die Verwendung von Sicherheitsschlüsseln ist nur bei lokalen oder gesicherten Verbindungen (https) möglich.',
'D3_WEBAUTHN_ERR_LOGINPROHIBITED' => 'Die Anmeldung mit Sicherheitsschlüssel ist aus technischen Gründen derzeit leider nicht möglich. Bitte verwenden Sie statt dessen Ihr Passwort.',
'D3_WEBAUTHN_ERR_NOTLOADEDUSER' => "Kann keine Anmeldedaten von nicht geladenem Kundenkonto beziehen.",
);
];

Voir le fichier

@ -56,5 +56,5 @@ $aLang = [
'<p>Ist Ihr Shop unter verschiedenen Subdomains erreichbar, können Sie hier die Hauptdomain angeben, die zur Registrierung verwendet werden soll. Beachten Sie bitte, '.
'dass die hier angegebene Adresse mit der des Shopaufrufs übereinstimmen muss. Shopfremde Adressen werden bei der Verwendung abgelehnt.</p>'.
'<p>Bleibt das Feld leer, wird die Adresse des aktuellen Shopaufrufs verwendet. Bei Verwendung unterschiedlicher Adressen muss vom Nutzer für jede Adresse eine separate '.
'Schlüsselregistrierung durchgeführt werden.</p>'
'Schlüsselregistrierung durchgeführt werden.</p>',
];

Voir le fichier

@ -57,5 +57,5 @@ $aLang = [
'<p>If your shop can be reached under different subdomains, you can enter the main domain here that is to be used for registration. Please '.
'note that the address given here must match the address of the shop call. Addresses that do not match the shop will be rejected.</p>'.
'<p>If the field remains empty, the address of the current shop call is used. If different addresses are used, a separate key registration '.
'must be carried out by the user for each address.</p>'
'must be carried out by the user for each address.</p>',
];

Voir le fichier

@ -15,7 +15,9 @@ namespace D3\Webauthn\Modules\Application\Component
{
use OxidEsales\Eshop\Application\Component\UserComponent;
class d3_webauthn_UserComponent_parent extends UserComponent {}
class d3_webauthn_UserComponent_parent extends UserComponent
{
}
}
namespace D3\Webauthn\Modules\Application\Controller
@ -35,44 +37,74 @@ namespace D3\Webauthn\Modules\Application\Controller
use OxidEsales\Eshop\Application\Controller\PaymentController;
use OxidEsales\Eshop\Application\Controller\UserController;
class d3_webauthn_UserController_parent extends UserController {}
class d3_webauthn_UserController_parent extends UserController
{
}
class d3_webauthn_OrderController_parent extends OrderController {}
class d3_webauthn_OrderController_parent extends OrderController
{
}
class d3_webauthn_PaymentController_parent extends PaymentController {}
class d3_webauthn_PaymentController_parent extends PaymentController
{
}
/** workarounds for missing tpl blocks (https://github.com/OXID-eSales/wave-theme/pull/124) */
class d3_AccountController_Webauthn_parent extends AccountController {}
class d3_AccountController_Webauthn_parent extends AccountController
{
}
class d3_AccountDownloadsController_Webauthn_parent extends AccountDownloadsController {}
class d3_AccountDownloadsController_Webauthn_parent extends AccountDownloadsController
{
}
class d3_AccountNoticeListController_Webauthn_parent extends AccountNoticeListController {}
class d3_AccountNoticeListController_Webauthn_parent extends AccountNoticeListController
{
}
class d3_AccountWishlistController_Webauthn_parent extends AccountWishlistController {}
class d3_AccountWishlistController_Webauthn_parent extends AccountWishlistController
{
}
class d3_AccountRecommlistController_Webauthn_parent extends AccountRecommlistController {}
class d3_AccountRecommlistController_Webauthn_parent extends AccountRecommlistController
{
}
class d3_AccountPasswordController_Webauthn_parent extends AccountPasswordController {}
class d3_AccountPasswordController_Webauthn_parent extends AccountPasswordController
{
}
class d3_AccountNewsletterController_Webauthn_parent extends AccountNewsletterController {}
class d3_AccountNewsletterController_Webauthn_parent extends AccountNewsletterController
{
}
class d3_AccountUserController_Webauthn_parent extends AccountUserController {}
class d3_AccountUserController_Webauthn_parent extends AccountUserController
{
}
class d3_AccountOrderController_Webauthn_parent extends AccountOrderController {}
class d3_AccountOrderController_Webauthn_parent extends AccountOrderController
{
}
class d3_AccountReviewController_Webauthn_parent extends AccountReviewController {}
class d3_AccountReviewController_Webauthn_parent extends AccountReviewController
{
}
}
namespace D3\Webauthn\Modules\Application\Controller\Admin
{
use OxidEsales\Eshop\Application\Controller\Admin\LoginController;
class d3_LoginController_Webauthn_parent extends LoginController {}
class d3_LoginController_Webauthn_parent extends LoginController
{
}
}
namespace D3\Webauthn\Modules\Application\Model
{
use OxidEsales\Eshop\Application\Model\User;
class d3_User_Webauthn_parent extends User {}
}
class d3_User_Webauthn_parent extends User
{
}
}

Voir le fichier

@ -58,12 +58,12 @@ class d3_webauthn_UserComponent extends d3_webauthn_UserComponent_parent
*/
public function d3WebauthnLogin(): void
{
$lgn_user = $this->d3GetMockableRegistryObject(Request::class)->getRequestParameter( 'lgn_usr');
$lgn_user = $this->d3GetMockableRegistryObject(Request::class)->getRequestParameter('lgn_usr');
/** @var d3_User_Webauthn $user */
$user = $this->d3GetMockableOxNewObject(User::class);
$userId = $user->d3GetLoginUserId($lgn_user);
if ( $this->d3CanUseWebauthn( $lgn_user, $userId)) {
if ($this->d3CanUseWebauthn($lgn_user, $userId)) {
if ($this->d3HasWebauthnButNotLoggedin($userId)) {
$session = $this->d3GetMockableRegistryObject(Session::class);
$session->setVariable(
@ -95,15 +95,15 @@ class d3_webauthn_UserComponent extends d3_webauthn_UserComponent_parent
*
* @return bool
*/
protected function d3CanUseWebauthn( $lgn_user, ?string $userId): bool
protected function d3CanUseWebauthn($lgn_user, ?string $userId): bool
{
$password = $this->d3GetMockableRegistryObject(Request::class)->getRequestParameter( 'lgn_pwd');
$password = $this->d3GetMockableRegistryObject(Request::class)->getRequestParameter('lgn_pwd');
return $lgn_user &&
$userId &&
false === $this->d3GetMockableRegistryObject(Session::class)
->hasVariable( WebauthnConf::WEBAUTHN_SESSION_AUTH ) &&
( ! strlen( trim( (string) $password ) ) );
->hasVariable(WebauthnConf::WEBAUTHN_SESSION_AUTH) &&
(! strlen(trim((string) $password)));
}
/**
@ -147,7 +147,8 @@ class d3_webauthn_UserComponent extends d3_webauthn_UserComponent_parent
public function d3AssertAuthn(): void
{
try {
$login = $this->d3GetMockableOxNewObject(WebauthnLogin::class,
$login = $this->d3GetMockableOxNewObject(
WebauthnLogin::class,
$this->d3GetMockableRegistryObject(Request::class)->getRequestEscapedParameter('credential'),
$this->d3GetMockableRegistryObject(Request::class)->getRequestEscapedParameter('error')
);
@ -158,6 +159,7 @@ class d3_webauthn_UserComponent extends d3_webauthn_UserComponent_parent
$this->_afterLogin($this->getUser());
} catch (WebauthnGetException $e) {
$this->d3GetMockableRegistryObject(UtilsView::class)->addErrorToDisplay($e);
} catch (WebauthnLoginErrorException $e) {}
} catch (WebauthnLoginErrorException $e) {
}
}
}
}

Voir le fichier

@ -40,7 +40,7 @@ class d3_LoginController_Webauthn extends d3_LoginController_Webauthn_parent
*/
public function checklogin()
{
$lgn_user = $this->d3GetMockableRegistryObject(Request::class)->getRequestParameter( 'user') ?:
$lgn_user = $this->d3GetMockableRegistryObject(Request::class)->getRequestParameter('user') ?:
$this->d3GetMockableRegistryObject(Session::class)
->getVariable(WebauthnConf::WEBAUTHN_ADMIN_SESSION_LOGINUSER);
@ -48,16 +48,16 @@ class d3_LoginController_Webauthn extends d3_LoginController_Webauthn_parent
$user = $this->d3GetMockableOxNewObject(User::class);
$userId = $user->d3GetLoginUserId($lgn_user, 'malladmin');
if ( $this->d3CanUseWebauthn( $lgn_user, $userId)) {
if ($this->d3CanUseWebauthn($lgn_user, $userId)) {
$this->d3GetMockableRegistryObject(Session::class)->setVariable(
WebauthnConf::WEBAUTHN_ADMIN_PROFILE,
$this->d3GetMockableRegistryObject(Request::class)
->getRequestEscapedParameter( 'profile')
->getRequestEscapedParameter('profile')
);
$this->d3GetMockableRegistryObject(Session::class)->setVariable(
WebauthnConf::WEBAUTHN_ADMIN_CHLANGUAGE,
$this->d3GetMockableRegistryObject(Request::class)
->getRequestEscapedParameter( 'chlanguage')
->getRequestEscapedParameter('chlanguage')
);
if ($this->hasWebauthnButNotLoggedin($userId)) {
@ -96,15 +96,15 @@ class d3_LoginController_Webauthn extends d3_LoginController_Webauthn_parent
*
* @return bool
*/
protected function d3CanUseWebauthn( $lgn_user, ?string $userId): bool
protected function d3CanUseWebauthn($lgn_user, ?string $userId): bool
{
$password = $this->d3GetMockableRegistryObject(Request::class)->getRequestParameter( 'pwd');
$password = $this->d3GetMockableRegistryObject(Request::class)->getRequestParameter('pwd');
return $lgn_user &&
$userId &&
false === $this->d3GetMockableRegistryObject(Session::class)
->hasVariable( WebauthnConf::WEBAUTHN_ADMIN_SESSION_AUTH ) &&
( ! strlen( trim( (string) $password ) ) );
->hasVariable(WebauthnConf::WEBAUTHN_ADMIN_SESSION_AUTH) &&
(! strlen(trim((string) $password)));
}
/**
@ -121,4 +121,4 @@ class d3_LoginController_Webauthn extends d3_LoginController_Webauthn_parent
&& !$this->d3GetMockableRegistryObject(Session::class)
->getVariable(WebauthnConf::WEBAUTHN_ADMIN_SESSION_AUTH);
}
}
}

Voir le fichier

@ -21,4 +21,4 @@ use D3\Webauthn\Application\Controller\Traits\accountTrait;
class d3_AccountController_Webauthn extends d3_AccountController_Webauthn_parent
{
use accountTrait;
}
}

Voir le fichier

@ -21,4 +21,4 @@ use D3\Webauthn\Application\Controller\Traits\accountTrait;
class d3_AccountDownloadsController_Webauthn extends d3_AccountDownloadsController_Webauthn_parent
{
use accountTrait;
}
}

Voir le fichier

@ -21,4 +21,4 @@ use D3\Webauthn\Application\Controller\Traits\accountTrait;
class d3_AccountNewsletterController_Webauthn extends d3_AccountNewsletterController_Webauthn_parent
{
use accountTrait;
}
}

Voir le fichier

@ -21,4 +21,4 @@ use D3\Webauthn\Application\Controller\Traits\accountTrait;
class d3_AccountNoticeListController_Webauthn extends d3_AccountNoticeListController_Webauthn_parent
{
use accountTrait;
}
}

Voir le fichier

@ -21,4 +21,4 @@ use D3\Webauthn\Application\Controller\Traits\accountTrait;
class d3_AccountOrderController_Webauthn extends d3_AccountOrderController_Webauthn_parent
{
use accountTrait;
}
}

Voir le fichier

@ -21,4 +21,4 @@ use D3\Webauthn\Application\Controller\Traits\accountTrait;
class d3_AccountPasswordController_Webauthn extends d3_AccountPasswordController_Webauthn_parent
{
use accountTrait;
}
}

Voir le fichier

@ -21,4 +21,4 @@ use D3\Webauthn\Application\Controller\Traits\accountTrait;
class d3_AccountRecommlistController_Webauthn extends d3_AccountRecommlistController_Webauthn_parent
{
use accountTrait;
}
}

Voir le fichier

@ -21,4 +21,4 @@ use D3\Webauthn\Application\Controller\Traits\accountTrait;
class d3_AccountReviewController_Webauthn extends d3_AccountReviewController_Webauthn_parent
{
use accountTrait;
}
}

Voir le fichier

@ -21,4 +21,4 @@ use D3\Webauthn\Application\Controller\Traits\accountTrait;
class d3_AccountUserController_Webauthn extends d3_AccountUserController_Webauthn_parent
{
use accountTrait;
}
}

Voir le fichier

@ -21,4 +21,4 @@ use D3\Webauthn\Application\Controller\Traits\accountTrait;
class d3_AccountWishlistController_Webauthn extends d3_AccountWishlistController_Webauthn_parent
{
use accountTrait;
}
}

Voir le fichier

@ -22,4 +22,4 @@ class d3_webauthn_OrderController extends d3_webauthn_OrderController_parent
use checkoutGetUserTrait;
private $parentClass = d3_webauthn_OrderController_parent::class;
}
}

Voir le fichier

@ -22,4 +22,4 @@ class d3_webauthn_PaymentController extends d3_webauthn_PaymentController_parent
use checkoutGetUserTrait;
private $parentClass = d3_webauthn_PaymentController_parent::class;
}
}

Voir le fichier

@ -22,4 +22,4 @@ class d3_webauthn_UserController extends d3_webauthn_UserController_parent
use checkoutGetUserTrait;
private $parentClass = d3_webauthn_UserController_parent::class;
}
}

Voir le fichier

@ -99,7 +99,7 @@ class d3_User_Webauthn extends d3_User_Webauthn_parent
$this,
[
$userName,
$shopId
$shopId,
]
);
}
@ -145,4 +145,4 @@ class d3_User_Webauthn extends d3_User_Webauthn_parent
return $qb->execute()->fetchOne() ?: null;
}
}
}

Voir le fichier

@ -139,8 +139,8 @@ class Actions
public function clearCache()
{
try {
$oUtils = $this->d3GetMockableRegistryObject( Utils::class );
$oUtils->resetTemplateCache( $this->getModuleTemplates() );
$oUtils = $this->d3GetMockableRegistryObject(Utils::class);
$oUtils->resetTemplateCache($this->getModuleTemplates());
$oUtils->resetLanguageCache();
} catch (ContainerExceptionInterface|NotFoundExceptionInterface|ModuleConfigurationNotFoundException $e) {
$this->d3GetMockableLogger()->error($e->getMessage(), [$this]);
@ -175,7 +175,7 @@ class Actions
{
/** @var $template ModuleConfiguration\Template */
return array_map(
function($template) {
function ($template) {
return $template->getTemplateKey();
},
$moduleConfiguration->getTemplates()
@ -191,7 +191,7 @@ class Actions
{
/** @var $templateBlock ModuleConfiguration\TemplateBlock */
return array_map(
function($templateBlock) {
function ($templateBlock) {
return basename($templateBlock->getShopTemplatePath());
},
$moduleConfiguration->getTemplateBlocks()
@ -261,4 +261,4 @@ class Actions
{
return ContainerFactory::getInstance()->getContainer();
}
}
}

Voir le fichier

@ -47,4 +47,4 @@ class Events
public static function onDeactivate(): void
{
}
}
}

Voir le fichier

@ -61,7 +61,7 @@ $logo = '<img src="https://logos.oxidmodule.com/d3logo.svg" alt="(D3)" style="he
/**
* Module information
*/
$aModule = array(
$aModule = [
'id' => $sModuleId,
'title' => $logo.' Webauthn / FIDO2 Login',
'description' => [
@ -90,13 +90,13 @@ $aModule = array(
AccountNewsletterController::class => d3_AccountNewsletterController_Webauthn::class,
AccountUserController::class => d3_AccountUserController_Webauthn::class,
AccountOrderController::class => d3_AccountOrderController_Webauthn::class,
AccountReviewController::class => d3_AccountReviewController_Webauthn::class
AccountReviewController::class => d3_AccountReviewController_Webauthn::class,
],
'controllers' => [
'd3user_webauthn' => d3user_webauthn::class,
'd3webauthnlogin' => d3webauthnlogin::class,
'd3webauthnadminlogin' => d3webauthnadminlogin::class,
'd3_account_webauthn' => d3_account_webauthn::class
'd3_account_webauthn' => d3_account_webauthn::class,
],
'templates' => [
'd3user_webauthn.tpl' => 'd3/oxwebauthn/Application/views/admin/tpl/d3user_webauthn.tpl',
@ -139,14 +139,14 @@ $aModule = array(
'template' => 'page/checkout/inc/options.tpl',
'block' => 'checkout_options_login',
'file' => 'Application/views/blocks/page/checkout/inc/checkout_options_login.tpl',
]
],
],
'settings' => [
[
'group' => $sModuleId.'_general',
'name' => $sModuleId.'_diffshopurl',
'type' => 'str',
'value' => false
'value' => false,
],
]
);
],
];

Voir le fichier

@ -41,7 +41,7 @@ class passwordAdminAuthTest extends integrationTestCase
'oxshopid' => 1,
'oxusername' => 'noadmin@user.localhost',
'oxpassword' => '$2y$10$QErMJNHQCoN03tfCUQDRfOvbwvqfzwWw1iI/7bC49fKQrPKoDdnaK', // 123456
'oxstreet' => __CLASS__
'oxstreet' => __CLASS__,
],
true
);
@ -54,7 +54,7 @@ class passwordAdminAuthTest extends integrationTestCase
'oxshopid' => 1,
'oxusername' => 'admin@user.localhost',
'oxpassword' => '$2y$10$QErMJNHQCoN03tfCUQDRfOvbwvqfzwWw1iI/7bC49fKQrPKoDdnaK', // 123456
'oxstreet' => __CLASS__
'oxstreet' => __CLASS__,
],
true
);
@ -67,7 +67,7 @@ class passwordAdminAuthTest extends integrationTestCase
'oxshopid' => 2,
'oxusername' => 'wrongshop@user.localhost',
'oxpassword' => '$2y$10$QErMJNHQCoN03tfCUQDRfOvbwvqfzwWw1iI/7bC49fKQrPKoDdnaK', // 123456
'oxstreet' => __CLASS__
'oxstreet' => __CLASS__,
],
true
);
@ -80,7 +80,7 @@ class passwordAdminAuthTest extends integrationTestCase
'oxshopid' => 1,
'oxusername' => 'inactive@user.localhost',
'oxpassword' => '$2y$10$QErMJNHQCoN03tfCUQDRfOvbwvqfzwWw1iI/7bC49fKQrPKoDdnaK', // 123456
'oxstreet' => __CLASS__
'oxstreet' => __CLASS__,
],
true
);
@ -126,4 +126,4 @@ class passwordAdminAuthTest extends integrationTestCase
'account ok' => ['admin@user.localhost', '123456', 'admin_start'],
];
}
}
}

Voir le fichier

@ -36,7 +36,7 @@ class passwordFrontendAuthTest extends integrationTestCase
'oxshopid' => 1,
'oxusername' => 'noadmin@user.localhost',
'oxpassword' => '$2y$10$b3O5amXZVMGGZbL4X10TIOHiOwEkq3C0ofObuTgHAS4Io0uMLauUS', // 123456
'oxstreet' => __CLASS__
'oxstreet' => __CLASS__,
]
);
@ -48,7 +48,7 @@ class passwordFrontendAuthTest extends integrationTestCase
'oxshopid' => 2,
'oxusername' => 'wrongshop_fe@user.localhost',
'oxpassword' => '$2y$10$b3O5amXZVMGGZbL4X10TIOHiOwEkq3C0ofObuTgHAS4Io0uMLauUS', // 123456
'oxstreet' => __CLASS__
'oxstreet' => __CLASS__,
]
);
@ -60,7 +60,7 @@ class passwordFrontendAuthTest extends integrationTestCase
'oxshopid' => 1,
'oxusername' => 'inactive@user.localhost',
'oxpassword' => '$2y$10$b3O5amXZVMGGZbL4X10TIOHiOwEkq3C0ofObuTgHAS4Io0uMLauUS', // 123456
'oxstreet' => __CLASS__
'oxstreet' => __CLASS__,
]
);
}
@ -108,4 +108,4 @@ class passwordFrontendAuthTest extends integrationTestCase
'account ok' => ['noadmin@user.localhost', '123456', 'payment'],
];
}
}
}

Voir le fichier

@ -32,7 +32,7 @@ class webauthnAdminAuthTest extends passwordAdminAuthTest
2 => 'credId2',
3 => 'credId3',
4 => 'credId4',
5 => 'credId5'
5 => 'credId5',
];
public function createTestData()
@ -47,7 +47,7 @@ class webauthnAdminAuthTest extends passwordAdminAuthTest
'oxshopid' => 1,
'oxusername' => 'wawrongshopid@user.localhost',
'oxpassword' => '$2y$10$QErMJNHQCoN03tfCUQDRfOvbwvqfzwWw1iI/7bC49fKQrPKoDdnaK', // 123456
'oxstreet' => __CLASS__
'oxstreet' => __CLASS__,
],
true
);
@ -60,7 +60,7 @@ class webauthnAdminAuthTest extends passwordAdminAuthTest
'oxshopid' => 1,
'name' => __CLASS__,
'credentialid' => 'ITSNkDRdN1bfRrb9MDCNOfBNay7YqT3ZxWxxqIQWVvwN0tFOG7SN2JiCfcUfPMBhE9bTLU1Gbb/8+5eHyFR2d5DCrxAAAA==',
'credential'=> 'TzozNDoiV2ViYXV0aG5cUHVibGljS2V5Q3JlZGVudGlhbFNvdXJjZSI6MTA6e3M6MjQ6IgAqAHB1YmxpY0tleUNyZWRlbnRpYWxJZCI7czo3MDoiITSNkDRdN1bfRrb9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9uZSI7czoxMjoiACoAdHJ1c3RQYXRoIjtPOjMzOiJXZWJhdXRoblxUcnVzdFBhdGhcRW1wdHlUcnVzdFBhdGgiOjA6e31zOjk6IgAqAGFhZ3VpZCI7TzozNToiUmFtc2V5XFV1aWRcTGF6eVxMYXp5VXVpZEZyb21TdHJpbmciOjE6e3M6Njoic3RyaW5nIjtzOjM2OiIwMDAwMDAwMC0wMDAwLTAwMDAtMDAwMC0wMDAwMDAwMDAwMDAiO31zOjIyOiIAKgBjcmVkZW50aWFsUHVibGljS2V5IjtzOjc3OiKlAQIDJiABIVggHucXfQh0acwpsffVRM02F7P57mVm6hPX/l8Pjbh0jOwiWCBRT5MMqa909tcXHqG/EKfjXXDd9UEisk+ZF7QSTfwv0CI7czoxMzoiACoAdXNlckhhbmRsZSI7czoxNDoib3hkZWZhdWx0YWRtaW4iO3M6MTA6IgAqAGNvdW50ZXIiO2k6NDI3MTtzOjEwOiIAKgBvdGhlclVJIjtOO30=',
]
);
@ -72,7 +72,7 @@ class webauthnAdminAuthTest extends passwordAdminAuthTest
'oxshopid' => 1,
'name' => __CLASS__,
'credentialid' => 'ITSNkDRdN1bfRrb9MDCNOfBNay7YqT3ZxWxxqIQWVvwN0tFOG7SN2JiCfcUfPMBhE9bTLU1Gbb/8+5eHyFR2d5DCrxAAAA==',
'credential'=> 'TzozNDoiV2ViYXV0aG5cUHVibGljS2V5Q3JlZGVudGlhbFNvdXJjZSI6MTA6e3M6MjQ6IgAqAHB1YmxpY0tleUNyZWRlbnRpYWxJZCI7czo3MDoiITSNkDRdN1bfRrb9MDCNOfBNay7YqT3ZxWxxqIQWVvwN0tFOG7SN2JiCfcUfPMBhE9bTLU1Gbb/8+5eHyFR2d5DCrxAAACI7czo3OiIAKgB0eXBlIjtzOjEwOiJwdWJsaWMta2V5IjtzOjEzOiIAKgB0cmFuc3BvcnRzIjthOjA6e31zOjE4OiIAKgBhdHRlc3RhdGlvblR5cGUiO3M6NDoibm9uZSI7czoxMjoiACoAdH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wMDAtMDAwMC0wMDAwMDAwMDAwMDAiO31zOjIyOiIAKgBjcmVkZW50aWFsUHVibGljS2V5IjtzOjc3OiKlAQIDJiABIVggHucXfQh0acwpsffVRM02F7P57mVm6hPX/l8Pjbh0jOwiWCBRT5MMqa909tcXHqG/EKfjXXDd9UEisk+ZF7QSTfwv0CI7czoxMzoiACoAdXNlckhhbmRsZSI7czoxNDoib3hkZWZhdWx0YWRtaW4iO3M6MTA6IgAqAGNvdW50ZXIiO2k6NDI3MTtzOjEwOiIAKgBvdGhlclVJIjtOO30=',
]
);
@ -84,7 +84,7 @@ class webauthnAdminAuthTest extends passwordAdminAuthTest
'oxshopid' => 1,
'name' => __CLASS__,
'credentialid' => 'ITSNkDRdN1bfRrb9MDCNOfBNay7YqT3ZxWxxqIQWVvwN0tFOG7SN2JiCfcUfPMBhE9bTLU1Gbb/8+5eHyFR2d5DCrxAAAA==',
'credential'=> 'TzozNDoiV2ViYXV0aG5cUHVibGljS2V5Q3JlZGVudGlhbFNvdXJjZSI6MTA6e3M6MjQ6IgAqAHB1YmxpY0tleUNyZWRlbnRpYWxJZCI7czo3MDoiITSNkDRdN1bfRrb9MDCNOfBNay7YqT3ZxWxxqIQWVvwN0tFOG7SN2JiCfcUfPMBhE9bTLU1Gbb/8+5eHyFR2d5DCrxAAACI7czo3OiIAKgB0eXBlIjtzOjEwOiJwdWJsaWMta2V5IjtzOjEzOiIAKgB0cmFuc3BvcnRzIjthOjA6e31zOjE4OiIAKgBhdHRlc3RhdGlvblR5cGUiO3M6NDoibm9uZSI7czoxMjoiACoAdHJ1c3RQYXRoIjtPOjMzOiJXZWJhdXRoblxUcnVzdFBhdGhcRW1wdHlUcnVzdFBhdGgiOjA6e31zOjk6IgAqAGFhZ3VpZCI7TzozNToiUmFtc2V5XFV1aWRcTGF6eVxMYXp5VXVpZEZyb21TdHJpbmciOjE6e3M6Njoic3RyaW5nIjtzOjM2OiIwMDAwMDAwMC0wMDAwLTAwMDAtMDAwMC0wMDAwM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x0YWRtaW4iO3M6MTA6IgAqAGNvdW50ZXIiO2k6NDI3MTtzOjEwOiIAKgBvdGhlclVJIjtOO30=',
]
);
@ -96,7 +96,7 @@ class webauthnAdminAuthTest extends passwordAdminAuthTest
'oxshopid' => 1,
'name' => __CLASS__,
'credentialid' => 'ITSNkDRdN1bfRrb9MDCNOfBNay7YqT3ZxWxxqIQWVvwN0tFOG7SN2JiCfcUfPMBhE9bTLU1Gbb/8+5eHyFR2d5DCrxAAAA==',
'credential'=> 'TzozNDoiV2ViYXV0aG5cUHVibGljS2V5Q3JlZGVudGlhbFNvdXJjZSI6MTA6e3M6MjQ6IgAqAHB1YmxpY0tleUNyZWRlbnRpYWxJZCI7czo3MDoiITSNkDRdN1bfRrb9MDCNOfBNay7YqT3ZxWxxqIQWVvwN0tFOG7SN2JiCfcUfPMBhE9bTLU1Gbb/8+5eHyFR2d5DCrxAAACI7czo3OiIAKgB0eXBlIjtzOjEwOiJwdWJsaWMta2V5IjtzOjEzOiIAKgB0cmFuc3BvcnRzIjthOjA6e31zOjE4OiIAKgBhdHRlc3RhdGlvblR5cGUiO3M6NDoibm9uZSI7czoxMjoiACoAdHJ1c3RQYXRoIjtPOjMzOiJXZWJhdXRoblxUcnVzdFBhdGhcRW1wdHlUcnVzdFBhdGgiOjA6e31zOjk6IgAqAGFhZ3VpZCI7TzozNToiUmFtc2V5XFV1aWRcTGF6eVxMYXp5VXVpZEZyb21TdHJpbmciOjE6e3M6Njoic3RyaW5nIjtzOjM2OiIwMDAwMDAwMC0wMDAwLTAwMDAtMDAwMC0wMDAwMDAwMDAwMDAiO31zOjIyOiIAKgBjcmVkZW50aWFsUHVibGljS2V5IjtzOjc3OiKlAQIDJiABIVggHucXfQh0acwpsffVRM02F7P57mVm6hPX/l8Pjbh0jOwiWCBRT5MMqa909tcXHqG/EKfjXXDd9UEisk+ZF7QSTfwv0CI7czoxMzoiACoAdXNlckhhbmRsZSI7czoxNDoib3hkZWZhdWx0YWRtaW4iO3M6MTA6IgAqAGNvdW50ZXIiO2k6NDI3MTtzOjEwOiIAKgBvdGhlclVJIjtOO30='
'credential'=> 'TzozNDoiV2ViYXV0aG5cUHVibGljS2V5Q3JlZGVudGlhbFNvdXJjZSI6MTA6e3M6MjQ6IgAqAHB1YmxpY0tleUNyZWRlbnRpYWxJZCI7czo3MDoiITSNkDRdN1bfRrb9MDCNOfBNay7YqT3ZxWxxqIQWVvwN0tFOG7SN2JiCfcUfPMBhE9bTLU1Gbb/8+5eHyFR2d5DCrxAAACI7czo3OiIAKgB0eXBlIjtzOjEwOiJwdWJsaWMta2V5IjtzOjEzOiIAKgB0cmFuc3BvcnRzIjthOjA6e31zOjE4OiIAKgBhdHRlc3RhdGlvblR5cGUiO3M6NDoibm9uZSI7czoxMjoiACoAdHJ1c3RQYXRoIjtPOjMzOiJXZWJhdXRoblxUcnVzdFBhdGhcRW1wdHlUcnVzdFBhdGgiOjA6e31zOjk6IgAqAGFhZ3VpZCI7TzozNToiUmFtc2V5XFV1aWRcTGF6eVxMYXp5VXVpZEZyb21TdHJpbmciOjE6e3M6Njoic3RyaW5nIjtzOjM2OiIwMDAwMDAwMC0wMDAwLTAwMDAtMDAwMC0wMDAwMDAwMDAwMDAiO31zOjIyOiIAKgBjcmVkZW50aWFsUHVibGljS2V5IjtzOjc3OiKlAQIDJiABIVggHucXfQh0acwpsffVRM02F7P57mVm6hPX/l8Pjbh0jOwiWCBRT5MMqa909tcXHqG/EKfjXXDd9UEisk+ZF7QSTfwv0CI7czoxMzoiACoAdXNlckhhbmRsZSI7czoxNDoib3hkZWZhdWx0YWRtaW4iO3M6MTA6IgAqAGNvdW50ZXIiO2k6NDI3MTtzOjEwOiIAKgBvdGhlclVJIjtOO30=',
]
);
@ -108,7 +108,7 @@ class webauthnAdminAuthTest extends passwordAdminAuthTest
'oxshopid' => 2,
'name' => __CLASS__,
'credentialid' => 'ITSNkDRdN1bfRrb9MDCNOfBNay7YqT3ZxWxxqIQWVvwN0tFOG7SN2JiCfcUfP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0tFOG7SN2JiCfcUfPMBhE9bTLU1Gbb/8+5eHyFR2d5DCrxAAACI7czo3OiIAKgB0eXBlIjtzOjEwOiJwdWJsaWMta2V5IjtzOjEzOiIAKgB0cmFuc3BvcnRzIjthOjA6e31zOjE4OiIAKgBhdHRlc3RhdGlvblR5cGUiO3M6NDoibm9uZSI7czoxMjoiACoAdHJ1c3RQYXRoIjtPOjMzOiJXZWJhdXRoblxUcnVzdFBhdGhcRW1wdHlUcnVzdFBhdGgiOjA6e31zOjk6IgAqAGFhZ3VpZCI7TzozNToiUmFtc2V5XFV1aWRcTGF6eVxMYXp5VXVpZEZyb21TdHJpbmciOjE6e3M6Njoic3RyaW5nIjtzOjM2OiIwMDAwMDAwMC0wMDAwLTAwMDAtMDAwMC0wMDAwMDAwMDAwMDAiO31zOjIyOiIAKgBjcmVkZW50aWFsUHVibGljS2V5IjtzOjc3OiKlAQIDJiABIVggHucXfQh0acwpsffVRM02F7P57mVm6hPX/l8Pjbh0jOwiWCBRT5MMqa909tcXHqG/EKfjXXDd9UEisk+ZF7QSTfwv0CI7czoxMzoiACoAdXNlckhhbmRsZSI7czoxNDoib3hkZWZhdWx0YWRtaW4iO3M6MTA6IgAqAGNvdW50ZXIiO2k6NDI3MTtzOjEwOiIAKgBvdGhlclVJIjtOO30=',
]
);
}
@ -142,4 +142,4 @@ class webauthnAdminAuthTest extends passwordAdminAuthTest
'credpass. wrong shopid'=> ['wawrongshopid@user.localhost', '123456', 'admin_start'],
];
}
}
}

Voir le fichier

@ -71,7 +71,7 @@ class d3user_webauthnTest extends TestCase
->onlyMethods([
'd3CallMockableFunction',
'getEditObjectId',
'd3GetMockableOxNewObject'
'd3GetMockableOxNewObject',
])
->getMock();
$sutMock->method('d3CallMockableFunction')->willReturn(true);
@ -145,7 +145,7 @@ class d3user_webauthnTest extends TestCase
'setPageType',
'setAuthnRegister',
'd3GetMockableLogger',
'd3GetMockableRegistryObject'
'd3GetMockableRegistryObject',
])
->getMock();
$sutMock->expects($this->atLeastOnce())->method('setPageType');
@ -194,7 +194,7 @@ class d3user_webauthnTest extends TestCase
'setPageType',
'setAuthnRegister',
'd3GetMockableLogger',
'd3GetMockableRegistryObject'
'd3GetMockableRegistryObject',
])
->getMock();
$sutMock->expects($this->atLeastOnce())->method('setPageType');
@ -566,7 +566,7 @@ class d3user_webauthnTest extends TestCase
public function canDeleteDataProvider(): array
{
return [
'has delete id' => ['deleteId', $this->once()]
'has delete id' => ['deleteId', $this->once()],
];
}
}
}

Voir le fichier

@ -61,7 +61,8 @@ class d3webauthnadminloginTest extends d3webauthnloginTest
* @return void
*/
public function canGetNavigationParams()
{}
{
}
/**
* @test
@ -78,7 +79,7 @@ class d3webauthnadminloginTest extends d3webauthnloginTest
->getMock();
$sessionMock->method('hasVariable')->willReturnMap([
[WebauthnConf::WEBAUTHN_ADMIN_SESSION_AUTH, $auth],
[WebauthnConf::WEBAUTHN_ADMIN_SESSION_CURRENTUSER, $userFromLogin]
[WebauthnConf::WEBAUTHN_ADMIN_SESSION_CURRENTUSER, $userFromLogin],
]);
/** @var Utils|MockObject $utilsMock */
@ -97,7 +98,7 @@ class d3webauthnadminloginTest extends d3webauthnloginTest
/** @var d3webauthnlogin|MockObject $sut */
$sut = $this->getMockBuilder($this->sutClassName)
->onlyMethods(['d3GetMockableRegistryObject', 'd3CallMockableFunction', 'd3GetMockableOxNewObject',
'generateCredentialRequest', 'addTplParam'])
'generateCredentialRequest', 'addTplParam', ])
->getMock();
$sut->method('d3GetMockableRegistryObject')->willReturnCallback(
function () use ($utilsMock, $sessionMock) {
@ -331,4 +332,4 @@ class d3webauthnadminloginTest extends d3webauthnloginTest
'assertion succ shop1' => ['admin_start', false, 'cookie', 1],
];
}
}
}

Voir le fichier

@ -47,7 +47,7 @@ class d3webauthnloginTest extends UnitTestCase
->onlyMethods(['getVariable'])
->getMock();
$sessionMock->method('getVariable')->willReturn([
'key1' => 'variable1'
'key1' => 'variable1',
]);
/** @var d3webauthnlogin|MockObject $sut */
@ -71,7 +71,7 @@ class d3webauthnloginTest extends UnitTestCase
[
'defKey1' => 'devValues1',
'key1' => 'variable1',
'cl' => NULL,
'cl' => null,
],
$this->callMethod(
$sut,
@ -99,7 +99,7 @@ class d3webauthnloginTest extends UnitTestCase
->getMock();
$sessionMock->method('hasVariable')->willReturnMap([
[WebauthnConf::WEBAUTHN_SESSION_AUTH, $auth],
[WebauthnConf::WEBAUTHN_SESSION_CURRENTUSER, $userFromLogin]
[WebauthnConf::WEBAUTHN_SESSION_CURRENTUSER, $userFromLogin],
]);
/** @var Utils|MockObject $utilsMock */
@ -112,7 +112,7 @@ class d3webauthnloginTest extends UnitTestCase
/** @var d3webauthnlogin|MockObject $sut */
$sut = $this->getMockBuilder($this->sutClassName)
->onlyMethods(['d3GetMockableRegistryObject', 'd3CallMockableFunction',
'generateCredentialRequest', 'addTplParam'])
'generateCredentialRequest', 'addTplParam', ])
->getMock();
$sut->method('d3GetMockableRegistryObject')->willReturnCallback(
function () use ($utilsMock, $sessionMock) {
@ -174,7 +174,7 @@ class d3webauthnloginTest extends UnitTestCase
->onlyMethods(['getVariable'])
->getMock();
$sessionMock->method('getVariable')->willReturnMap([
[$userSessionVarName, $currUserFixture]
[$userSessionVarName, $currUserFixture],
]);
/** @var Webauthn|MockObject $webAuthnMock */
@ -240,7 +240,7 @@ class d3webauthnloginTest extends UnitTestCase
->onlyMethods(['getVariable', 'setVariable'])
->getMock();
$sessionMock->method('getVariable')->willReturnMap([
[$userVarName, $currUserFixture]
[$userVarName, $currUserFixture],
]);
$sessionMock->expects($this->once())->method('setVariable')->with(WebauthnConf::GLOBAL_SWITCH)
->willReturn(true);
@ -262,7 +262,7 @@ class d3webauthnloginTest extends UnitTestCase
/** @var d3webauthnlogin|MockObject $sut */
$sut = $this->getMockBuilder($this->sutClassName)
->onlyMethods(['d3GetMockableOxNewObject', 'addTplParam',
'd3GetMockableLogger', 'd3GetMockableRegistryObject'])
'd3GetMockableLogger', 'd3GetMockableRegistryObject', ])
->getMock();
$sut->method('d3GetMockableOxNewObject')->willReturnCallback(
function () use ($webAuthnMock) {
@ -313,7 +313,7 @@ class d3webauthnloginTest extends UnitTestCase
->onlyMethods(['getVariable'])
->getMock();
$sessionMock->method('getVariable')->willReturnMap([
[$sessionVarName, $currClassFixture]
[$sessionVarName, $currClassFixture],
]);
/** @var d3webauthnlogin|MockObject $sut */
@ -410,7 +410,7 @@ class d3webauthnloginTest extends UnitTestCase
{
return [
[true],
[false]
[false],
];
}
@ -431,4 +431,4 @@ class d3webauthnloginTest extends UnitTestCase
)
);
}
}
}

Voir le fichier

@ -105,7 +105,7 @@ class PublicKeyCredentialListTest extends UnitTestCase
$pkc->setId($oxid);
$pkc->assign([
'credentialid' => base64_encode('myCredentialId'),
'oxshopid' => 55
'oxshopid' => 55,
]);
$pkc->setCredential($pkcsMock);
$pkc->save();
@ -132,7 +132,7 @@ class PublicKeyCredentialListTest extends UnitTestCase
{
return [
'existing' => [true, 'pkcsource'],
'not existing' => [false, null]
'not existing' => [false, null],
];
}
@ -185,7 +185,7 @@ class PublicKeyCredentialListTest extends UnitTestCase
$pkc->setId($oxid);
$pkc->assign([
'oxuserid' => 'userid',
'oxshopid' => 55
'oxshopid' => 55,
]);
$pkc->setCredential($pkcsMock);
$pkc->save();
@ -271,7 +271,7 @@ class PublicKeyCredentialListTest extends UnitTestCase
$pkc->setId($oxid);
$pkc->assign([
'oxuserid' => 'userid',
'oxshopid' => 55
'oxshopid' => 55,
]);
$pkc->setCredential($pkcsMock);
$pkc->save();
@ -338,4 +338,4 @@ class PublicKeyCredentialListTest extends UnitTestCase
[$pkcsMock]
);
}
}
}

Voir le fichier

@ -86,7 +86,7 @@ class PublicKeyCredentialTest extends UnitTestCase
/** @var PublicKeyCredential $sut */
$sut = oxNew(PublicKeyCredential::class);
$sut->assign([
$fieldName => $setValue
$fieldName => $setValue,
]);
$this->assertEquals(
@ -318,7 +318,7 @@ class PublicKeyCredentialTest extends UnitTestCase
$sut->setId($oxid);
$sut->assign([
'credentialid' => base64_encode($pkcId),
'oxshopid' => $shopId
'oxshopid' => $shopId,
]);
$sut->save();
}
@ -344,7 +344,7 @@ class PublicKeyCredentialTest extends UnitTestCase
{
return [
'item exists' => [true, 'idFixture'],
'item not exists' => [false, null]
'item not exists' => [false, null],
];
}
}
}

Voir le fichier

@ -46,4 +46,4 @@ class WebauthnCreateExceptionTest extends UnitTestCase
)
);
}
}
}

Voir le fichier

@ -48,7 +48,7 @@ class WebauthnExceptionTest extends UnitTestCase
/** @var WebauthnException|MockObject $sut */
$sut = $this->getMockBuilder(WebauthnException::class)
->onlyMethods(['setDetailedErrorMessage', 'getErrorMessageTranslator', 'getRequestType',
'd3CallMockableFunction'])
'd3CallMockableFunction', ])
->disableOriginalConstructor()
->getMock();
$sut->expects($this->once())->method('setDetailedErrorMessage');
@ -150,7 +150,7 @@ class WebauthnExceptionTest extends UnitTestCase
{
return [
'message is string' => ['errorMessageFixture'],
'message is null' => [null]
'message is null' => [null],
];
}
}
}

Voir le fichier

@ -46,4 +46,4 @@ class WebauthnGetExceptionTest extends UnitTestCase
)
);
}
}
}

Voir le fichier

@ -96,7 +96,7 @@ class RelyingPartyEntityTest extends TestCase
'null' => [null, false],
'empty string' => ['', false],
'space string' => [' ', false],
'non empty string' => ['content', true]
'non empty string' => ['content', true],
];
}
@ -222,7 +222,7 @@ class RelyingPartyEntityTest extends TestCase
{
return [
'configured' => [true, ' subd.mydomain.com', 'www.myhost.de', 'subd.mydomain.com'],
'not configured'=> [false, ' subd.mydomain.com', 'www.myhost.de', 'www.myhost.de']
'not configured'=> [false, ' subd.mydomain.com', 'www.myhost.de', 'www.myhost.de'],
];
}
@ -249,4 +249,4 @@ class RelyingPartyEntityTest extends TestCase
)
);
}
}
}

Voir le fichier

@ -59,7 +59,7 @@ class UserEntityTest extends UnitTestCase
$this->identicalTo([
'usernamefixture',
'userId',
'fNameFixture lNameFixture'
'fNameFixture lNameFixture',
])
);
@ -85,4 +85,4 @@ class UserEntityTest extends UnitTestCase
'user ok' => [true, 'userId', true],
];
}
}
}

Voir le fichier

@ -66,7 +66,7 @@ class WebauthnAfterLoginTest extends UnitTestCase
->getMock();
$sessionMock->method('getVariable')->willReturnMap([
[WebauthnConf::WEBAUTHN_ADMIN_PROFILE, $sessionProfile],
['aAdminProfiles', [['prof','No0'], ['prof', 'No1'], ['prof','No2']]]
['aAdminProfiles', [['prof','No0'], ['prof', 'No1'], ['prof','No2']]],
]);
$sessionMock->expects($this->once())->method('deleteVariable');
$sessionMock->expects($this->exactly((int) $setSessionVar))->method('setVariable');
@ -210,7 +210,7 @@ class WebauthnAfterLoginTest extends UnitTestCase
$en_2->selected = 0;
return [
$de_1,
$en_2
$en_2,
];
}
@ -227,4 +227,4 @@ class WebauthnAfterLoginTest extends UnitTestCase
'no selected language' => [null, null, 0, 'de'],
];
}
}
}

Voir le fichier

@ -127,7 +127,7 @@ class WebauthnErrorsTest extends UnitTestCase
{
return [
'with colon' => [' My Text With : Colon', 'my text with'],
'without colon' => [' My Text With Colon', 'my text with colon']
'without colon' => [' My Text With Colon', 'my text with colon'],
];
}
}
}

Voir le fichier

@ -216,7 +216,7 @@ class WebauthnLoginTest extends UnitTestCase
$sut = $this->getMockBuilder(WebauthnLogin::class)
->onlyMethods(['getUserId', 'handleErrorMessage', 'assertUser', 'assertAuthn',
'setFrontendSession', 'handleBackendCookie', 'handleBackendSubshopRights', 'setSessionCookie',
'd3GetMockableOxNewObject', 'getCredential', 'regenerateSessionId'])
'd3GetMockableOxNewObject', 'getCredential', 'regenerateSessionId', ])
->disableOriginalConstructor()
->getMock();
$sut->expects($this->exactly((int) $setCookie))->method('setSessionCookie');
@ -281,7 +281,7 @@ class WebauthnLoginTest extends UnitTestCase
$sut = $this->getMockBuilder(WebauthnLogin::class)
->onlyMethods(['getUserId', 'handleErrorMessage', 'assertUser', 'assertAuthn', 'd3GetMockableRegistryObject',
'setFrontendSession', 'handleBackendCookie', 'handleBackendSubshopRights', 'setSessionCookie',
'd3GetMockableLogger', 'd3GetMockableOxNewObject', 'getCredential', 'regenerateSessionId'])
'd3GetMockableLogger', 'd3GetMockableOxNewObject', 'getCredential', 'regenerateSessionId', ])
->disableOriginalConstructor()
->getMock();
$sut->method('handleErrorMessage')->willThrowException(oxNew($exceptionClass));
@ -350,7 +350,7 @@ class WebauthnLoginTest extends UnitTestCase
$sut = $this->getMockBuilder(WebauthnLogin::class)
->onlyMethods(['getUserId', 'handleErrorMessage', 'assertUser', 'assertAuthn',
'setAdminSession', 'handleBackendCookie', 'handleBackendSubshopRights',
'd3GetMockableOxNewObject'])
'd3GetMockableOxNewObject', ])
->disableOriginalConstructor()
->getMock();
$sut->method('d3GetMockableOxNewObject')->willReturnCallback(
@ -412,7 +412,7 @@ class WebauthnLoginTest extends UnitTestCase
->onlyMethods(['getUserId', 'handleErrorMessage', 'assertUser', 'assertAuthn',
'setAdminSession', 'handleBackendCookie', 'handleBackendSubshopRights',
'd3GetMockableOxNewObject', 'd3GetMockableRegistryObject',
'd3GetMockableLogger'])
'd3GetMockableLogger', ])
->disableOriginalConstructor()
->getMock();
$sut->method('handleErrorMessage')->willThrowException(oxNew($exceptionClass));
@ -675,7 +675,7 @@ class WebauthnLoginTest extends UnitTestCase
{
return [
'set cookie' => [true],
'dont set cookie' => [false]
'dont set cookie' => [false],
];
}
@ -1065,10 +1065,11 @@ class WebauthnLoginTest extends UnitTestCase
$sessionMock->method('getVariable')->willReturnCallback(
function () {
$args = func_get_args();
if ($args[0] === WebauthnConf::WEBAUTHN_ADMIN_SESSION_CURRENTUSER)
if ($args[0] === WebauthnConf::WEBAUTHN_ADMIN_SESSION_CURRENTUSER) {
return 'adminUser';
elseif ($args[0] === WebauthnConf::WEBAUTHN_SESSION_CURRENTUSER)
} elseif ($args[0] === WebauthnConf::WEBAUTHN_SESSION_CURRENTUSER) {
return 'frontendUser';
}
return null;
}
);
@ -1126,11 +1127,11 @@ class WebauthnLoginTest extends UnitTestCase
$sessionMock->expects($this->exactly(2))->method('setVariable')->withConsecutive(
[
$this->identicalTo(WebauthnConf::WEBAUTHN_SESSION_AUTH),
$this->identicalTo('credentialFixture')
$this->identicalTo('credentialFixture'),
],
[
$this->identicalTo(WebauthnConf::OXID_FRONTEND_AUTH),
$this->identicalTo('idFixture')
$this->identicalTo('idFixture'),
]
);
@ -1164,4 +1165,4 @@ class WebauthnLoginTest extends UnitTestCase
[$userMock]
);
}
}
}

Voir le fichier

@ -107,7 +107,7 @@ class WebauthnTest extends UnitTestCase
'REMOTE_ADDR v6' => [null, null, null, '::1', true],
'REMOTE_ADDR localhost' => [null, null, null, 'some.localhost', true],
'unset' => [null, null, null, null, false],
'not valid' => ['off', 'http', 'off', '160.158.23.7', false]
'not valid' => ['off', 'http', 'off', '160.158.23.7', false],
];
}
@ -164,7 +164,7 @@ class WebauthnTest extends UnitTestCase
/** @var Webauthn|MockObject $sut */
$sut = $this->getMockBuilder(Webauthn::class)
->onlyMethods(['d3GetMockableOxNewObject', 'getServer', 'd3GetMockableRegistryObject', 'jsonEncode',
'getExistingCredentials'
'getExistingCredentials',
])
->getMock();
$sut->method('d3GetMockableOxNewObject')->willReturnCallback(
@ -192,7 +192,7 @@ class WebauthnTest extends UnitTestCase
);
$sut->expects($this->once())->method('jsonEncode')->willReturn($jsonReturn);
$sut->expects($this->once())->method('getExistingCredentials')->willReturn([
$pubKeyCredDescriptorMock
$pubKeyCredDescriptorMock,
]);
if (!$jsonReturn) {
@ -361,7 +361,7 @@ class WebauthnTest extends UnitTestCase
/** @var Webauthn|MockObject $sut */
$sut = $this->getMockBuilder(Webauthn::class)
->onlyMethods(['d3GetMockableOxNewObject', 'getServer', 'd3GetMockableRegistryObject', 'jsonEncode',
'getExistingCredentials'
'getExistingCredentials',
])
->getMock();
$sut->method('d3GetMockableOxNewObject')->willReturnCallback(
@ -391,7 +391,7 @@ class WebauthnTest extends UnitTestCase
);
$sut->expects($this->once())->method('jsonEncode')->willReturn($jsonReturn);
$sut->expects($this->once())->method('getExistingCredentials')->willReturn([
$pubKeyCredDescriptorMock
$pubKeyCredDescriptorMock,
]);
if (!$jsonReturn) {
@ -695,7 +695,7 @@ class WebauthnTest extends UnitTestCase
$sessionMock->method('getVariable')->willReturnMap(
[
[WebauthnConf::WEBAUTHN_ADMIN_SESSION_CURRENTUSER, $adminUser],
[WebauthnConf::WEBAUTHN_SESSION_CURRENTUSER, $frontendUser]
[WebauthnConf::WEBAUTHN_SESSION_CURRENTUSER, $frontendUser],
]
);
@ -732,7 +732,7 @@ class WebauthnTest extends UnitTestCase
{
return [
'admin' => [true, 'admUsr', 'frontendUsr', 'admUsr'],
'frontend' => [false, 'admUsr', 'frontendUsr', 'frontendUsr']
'frontend' => [false, 'admUsr', 'frontendUsr', 'frontendUsr'],
];
}
@ -819,7 +819,7 @@ class WebauthnTest extends UnitTestCase
'user use webauthn, config disabled' => [true, false, true, false],
'user use webauthn, session disabled' => [false, true, true, false],
'user use webauthn, both disabled' => [true, true, true, false],
'user dont use ' => [false, false, false, false]
'user dont use ' => [false, false, false, false],
];
}
@ -883,4 +883,4 @@ class WebauthnTest extends UnitTestCase
'filled array' => [['abc'], true],
];
}
}
}

Voir le fichier

@ -92,7 +92,7 @@ class UserComponentWebauthnTest extends UnitTestCase
->onlyMethods(['getRequestParameter'])
->getMock();
$requestMock->method('getRequestParameter')->willReturnMap([
['lgn_usr', 'myUserName']
['lgn_usr', 'myUserName'],
]);
/** @var User|MockObject $userMock */
@ -112,7 +112,7 @@ class UserComponentWebauthnTest extends UnitTestCase
/** @var d3_webauthn_UserComponent|MockObject $sut */
$sut = $this->getMockBuilder(UserComponent::class)
->onlyMethods(['d3CanUseWebauthn', 'd3CallMockableFunction', 'd3HasWebauthnButNotLoggedin',
'd3GetMockableOxNewObject', 'd3GetMockableRegistryObject', 'getParent'
'd3GetMockableOxNewObject', 'd3GetMockableRegistryObject', 'getParent',
])
->getMock();
$sut->method('d3CanUseWebauthn')->willReturn($canUseWebauthn);
@ -433,7 +433,7 @@ class UserComponentWebauthnTest extends UnitTestCase
return [
'passed' => [null, $this->once(), $this->never()],
'webauthnException' => [WebauthnGetException::class, $this->never(), $this->once()],
'webauthnLoginError' => [WebauthnLoginErrorException::class, $this->never(), $this->never()]
'webauthnLoginError' => [WebauthnLoginErrorException::class, $this->never(), $this->never()],
];
}
}
}

Voir le fichier

@ -23,4 +23,4 @@ class AccountControllerTest extends UnitTestCase
use AccountTestTrait;
protected $sutClass = AccountController::class;
}
}

Voir le fichier

@ -23,4 +23,4 @@ class AccountDownloadsControllerTest extends UnitTestCase
use AccountTestTrait;
protected $sutClass = AccountDownloadsController::class;
}
}

Voir le fichier

@ -23,4 +23,4 @@ class AccountNewsletterControllerTest extends UnitTestCase
use AccountTestTrait;
protected $sutClass = AccountNewsletterController::class;
}
}

Voir le fichier

@ -23,4 +23,4 @@ class AccountNoticeListControllerTest extends UnitTestCase
use AccountTestTrait;
protected $sutClass = AccountNoticeListController::class;
}
}

Voir le fichier

@ -23,4 +23,4 @@ class AccountOrderControllerTest extends UnitTestCase
use AccountTestTrait;
protected $sutClass = AccountOrderController::class;
}
}

Voir le fichier

@ -23,4 +23,4 @@ class AccountPasswordControllerTest extends UnitTestCase
use AccountTestTrait;
protected $sutClass = AccountPasswordController::class;
}
}

Voir le fichier

@ -23,4 +23,4 @@ class AccountRecommlistControllerTest extends UnitTestCase
use AccountTestTrait;
protected $sutClass = AccountRecommlistController::class;
}
}

Voir le fichier

@ -23,4 +23,4 @@ class AccountReviewControllerTest extends UnitTestCase
use AccountTestTrait;
protected $sutClass = AccountReviewController::class;
}
}

Voir le fichier

@ -70,4 +70,4 @@ trait AccountTestTrait
)
);
}
}
}

Voir le fichier

@ -23,4 +23,4 @@ class AccountUserControllerTest extends UnitTestCase
use AccountTestTrait;
protected $sutClass = AccountUserController::class;
}
}

Voir le fichier

@ -23,4 +23,4 @@ class AccountWishlistControllerTest extends UnitTestCase
use AccountTestTrait;
protected $sutClass = AccountWishlistController::class;
}
}

Voir le fichier

@ -228,7 +228,7 @@ class LoginControllerWebauthnTest extends UnitTestCase
->getMock();
$requestMock->method('getRequestParameter')->willReturnMap([
['user', 'myUserName'],
['profile', 'myProfile']
['profile', 'myProfile'],
]);
/** @var User|MockObject $userMock */
@ -248,7 +248,7 @@ class LoginControllerWebauthnTest extends UnitTestCase
/** @var LoginController|MockObject $sut */
$sut = $this->getMockBuilder(LoginController::class)
->onlyMethods(['d3CanUseWebauthn', 'd3CallMockableFunction', 'hasWebauthnButNotLoggedin',
'd3GetMockableOxNewObject', 'd3GetMockableRegistryObject'
'd3GetMockableOxNewObject', 'd3GetMockableRegistryObject',
])
->getMock();
$sut->method('d3CanUseWebauthn')->willReturn($canUseWebauthn);
@ -299,4 +299,4 @@ class LoginControllerWebauthnTest extends UnitTestCase
'passed' => [true, true, 5, 'd3webauthnadminlogin'],
];
}
}
}

Voir le fichier

@ -117,7 +117,7 @@ trait CheckoutTestTrait
$sut->setUser(oxNew(User::class));
if ($expected === 'parent') {
$this->assertSame( $return, $hasUser ? $this->userFixture : false);
$this->assertSame($return, $hasUser ? $this->userFixture : false);
} else {
$this->assertSame($return, $expected);
}
@ -142,4 +142,4 @@ trait CheckoutTestTrait
'no webauthn auth' => [true, true, null, false],
];
}
}
}

Voir le fichier

@ -23,4 +23,4 @@ class OrderControllerTest extends UnitTestCase
use CheckoutTestTrait;
protected $sutClass = OrderController::class;
}
}

Voir le fichier

@ -23,4 +23,4 @@ class PaymentControllerTest extends UnitTestCase
use CheckoutTestTrait;
protected $sutClass = PaymentController::class;
}
}

Voir le fichier

@ -23,4 +23,4 @@ class UserControllerTest extends UnitTestCase
use CheckoutTestTrait;
protected $sutClass = UserController::class;
}
}

Voir le fichier

@ -58,7 +58,8 @@ class UserWebauthnTest extends UnitTestCase
/** @var d3_User_Webauthn $user */
$user = oxNew(User::class);
$user->delete($this->userId);
} catch (Exception $e) {}
} catch (Exception $e) {
}
}
/**
@ -163,7 +164,7 @@ class UserWebauthnTest extends UnitTestCase
->getMock();
$sessionMock->method('getVariable')->willReturnMap([
[WebauthnConf::WEBAUTHN_SESSION_AUTH, $authInSession],
[WebauthnConf::WEBAUTHN_SESSION_LOGINUSER, $userNameInSession]
[WebauthnConf::WEBAUTHN_SESSION_LOGINUSER, $userNameInSession],
]);
/** @var User|MockObject $sut */
@ -275,4 +276,4 @@ class UserWebauthnTest extends UnitTestCase
'user not loadable' => ['unknown', '15', '20', null],
];
}
}
}

Voir le fichier

@ -569,7 +569,7 @@ class ActionsTest extends UnitTestCase
{
return [
'has SEO url' => ['https://testshop.dev/securitykeys', true],
'has no SEO url'=> ['', false]
'has no SEO url'=> ['', false],
];
}
@ -625,4 +625,4 @@ class ActionsTest extends UnitTestCase
)
);
}
}
}