Skip to content

Commit

Permalink
WebAuthn passwordless authentication
Browse files Browse the repository at this point in the history
Change the namespaces
  • Loading branch information
Nicholas K. Dionysopoulos committed Jul 25, 2019
1 parent 415bd11 commit 8a3db27
Show file tree
Hide file tree
Showing 20 changed files with 57 additions and 56 deletions.
1 change: 1 addition & 0 deletions libraries/src/Plugin/CMSPlugin.php
Expand Up @@ -12,6 +12,7 @@

use Joomla\CMS\Extension\PluginInterface;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\Event\AbstractEvent;
use Joomla\Event\DispatcherAwareInterface;
use Joomla\Event\DispatcherAwareTrait;
Expand Down
4 changes: 2 additions & 2 deletions plugins/system/webauthn/Webauthn/CredentialRepository.php
Expand Up @@ -7,9 +7,9 @@
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

namespace Akeeba\Passwordless\Webauthn;
namespace Joomla\Plugin\System\Webauthn;

use Akeeba\Passwordless\Webauthn\Helper\Joomla;
use Joomla\Plugin\System\Webauthn\Helper\Joomla;
use Exception;
use Joomla\CMS\Application\CMSApplication;
use Joomla\CMS\Factory;
Expand Down
Expand Up @@ -7,7 +7,7 @@
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

namespace Akeeba\Passwordless\Webauthn\Exception;
namespace Joomla\Plugin\System\Webauthn\Exception;

use RuntimeException;

Expand Down
Expand Up @@ -7,9 +7,9 @@
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

namespace Akeeba\Passwordless\Webauthn\Helper;
namespace Joomla\Plugin\System\Webauthn\Helper;

use Akeeba\Passwordless\Webauthn\CredentialRepository;
use Joomla\Plugin\System\Webauthn\CredentialRepository;
use CBOR\Decoder;
use CBOR\OtherObject\OtherObjectManager;
use CBOR\Tag\TagObjectManager;
Expand Down
2 changes: 1 addition & 1 deletion plugins/system/webauthn/Webauthn/Helper/Integration.php
Expand Up @@ -7,7 +7,7 @@
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

namespace Akeeba\Passwordless\Webauthn\Helper;
namespace Joomla\Plugin\System\Webauthn\Helper;


use Joomla\CMS\HTML\HTMLHelper;
Expand Down
2 changes: 1 addition & 1 deletion plugins/system/webauthn/Webauthn/Helper/Joomla.php
Expand Up @@ -7,7 +7,7 @@
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

namespace Akeeba\Passwordless\Webauthn\Helper;
namespace Joomla\Plugin\System\Webauthn\Helper;

// Protect from unauthorized access
use DateTimeZone;
Expand Down
6 changes: 3 additions & 3 deletions plugins/system/webauthn/Webauthn/PluginTraits/AjaxHandler.php
Expand Up @@ -7,10 +7,10 @@
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

namespace Akeeba\Passwordless\Webauthn\PluginTraits;
namespace Joomla\Plugin\System\Webauthn\PluginTraits;

use Akeeba\Passwordless\Webauthn\Helper\Joomla;
use Akeeba\Passwordless\Webauthn\Exception\AjaxNonCmsAppException;
use Joomla\Plugin\System\Webauthn\Helper\Joomla;
use Joomla\Plugin\System\Webauthn\Exception\AjaxNonCmsAppException;
use Exception;
use Joomla\CMS\Application\CMSApplication;
use Joomla\CMS\Factory;
Expand Down
Expand Up @@ -7,10 +7,10 @@
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

namespace Akeeba\Passwordless\Webauthn\PluginTraits;
namespace Joomla\Plugin\System\Webauthn\PluginTraits;

use Akeeba\Passwordless\Webauthn\CredentialRepository;
use Akeeba\Passwordless\Webauthn\Helper\Joomla;
use Joomla\Plugin\System\Webauthn\CredentialRepository;
use Joomla\Plugin\System\Webauthn\Helper\Joomla;
use Exception;
use Joomla\CMS\Factory;
use Joomla\CMS\Uri\Uri;
Expand Down
Expand Up @@ -7,11 +7,11 @@
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

namespace Akeeba\Passwordless\Webauthn\PluginTraits;
namespace Joomla\Plugin\System\Webauthn\PluginTraits;

use Akeeba\Passwordless\Webauthn\CredentialRepository;
use Akeeba\Passwordless\Webauthn\Helper\CredentialsCreation;
use Akeeba\Passwordless\Webauthn\Helper\Joomla;
use Joomla\Plugin\System\Webauthn\CredentialRepository;
use Joomla\Plugin\System\Webauthn\Helper\CredentialsCreation;
use Joomla\Plugin\System\Webauthn\Helper\Joomla;
use Exception;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
Expand Down
Expand Up @@ -7,10 +7,10 @@
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

namespace Akeeba\Passwordless\Webauthn\PluginTraits;
namespace Joomla\Plugin\System\Webauthn\PluginTraits;

use Akeeba\Passwordless\Webauthn\CredentialRepository;
use Akeeba\Passwordless\Webauthn\Helper\Joomla;
use Joomla\Plugin\System\Webauthn\CredentialRepository;
use Joomla\Plugin\System\Webauthn\Helper\Joomla;
use Exception;
use Joomla\CMS\Application\CMSApplication;
use Joomla\CMS\Factory;
Expand Down
Expand Up @@ -7,10 +7,10 @@
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

namespace Akeeba\Passwordless\Webauthn\PluginTraits;
namespace Joomla\Plugin\System\Webauthn\PluginTraits;

use Akeeba\Passwordless\Webauthn\CredentialRepository;
use Akeeba\Passwordless\Webauthn\Helper\Joomla;
use Joomla\Plugin\System\Webauthn\CredentialRepository;
use Joomla\Plugin\System\Webauthn\Helper\Joomla;
use CBOR\Decoder;
use CBOR\OtherObject\OtherObjectManager;
use CBOR\Tag\TagObjectManager;
Expand Down
Expand Up @@ -7,10 +7,10 @@
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

namespace Akeeba\Passwordless\Webauthn\PluginTraits;
namespace Joomla\Plugin\System\Webauthn\PluginTraits;

use Akeeba\Passwordless\Webauthn\CredentialRepository;
use Akeeba\Passwordless\Webauthn\Helper\Joomla;
use Joomla\Plugin\System\Webauthn\CredentialRepository;
use Joomla\Plugin\System\Webauthn\Helper\Joomla;
use Exception;
use Joomla\CMS\Application\CMSApplication;
use Joomla\CMS\Factory;
Expand Down
Expand Up @@ -7,10 +7,10 @@
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

namespace Akeeba\Passwordless\Webauthn\PluginTraits;
namespace Joomla\Plugin\System\Webauthn\PluginTraits;

use Akeeba\Passwordless\Webauthn\Helper\Integration;
use Akeeba\Passwordless\Webauthn\Helper\Joomla;
use Joomla\Plugin\System\Webauthn\Helper\Integration;
use Joomla\Plugin\System\Webauthn\Helper\Joomla;
use Exception;
use Joomla\CMS\Factory;

Expand Down
Expand Up @@ -7,10 +7,10 @@
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

namespace Akeeba\Passwordless\Webauthn\PluginTraits;
namespace Joomla\Plugin\System\Webauthn\PluginTraits;

use Akeeba\Passwordless\Webauthn\Helper\Integration;
use Akeeba\Passwordless\Webauthn\Helper\Joomla;
use Joomla\Plugin\System\Webauthn\Helper\Integration;
use Joomla\Plugin\System\Webauthn\Helper\Joomla;
use Exception;
use Joomla\CMS\Application\CMSApplication;
use Joomla\CMS\Factory;
Expand Down
Expand Up @@ -7,9 +7,9 @@
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

namespace Akeeba\Passwordless\Webauthn\PluginTraits;
namespace Joomla\Plugin\System\Webauthn\PluginTraits;

use Akeeba\Passwordless\Webauthn\Helper\Joomla;
use Joomla\Plugin\System\Webauthn\Helper\Joomla;
use Exception;
use Joomla\CMS\Factory;
use Joomla\Database\DatabaseDriver;
Expand Down
Expand Up @@ -7,9 +7,9 @@
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

namespace Akeeba\Passwordless\Webauthn\PluginTraits;
namespace Joomla\Plugin\System\Webauthn\PluginTraits;

use Akeeba\Passwordless\Webauthn\Helper\Joomla;
use Joomla\Plugin\System\Webauthn\Helper\Joomla;
use Exception;
use Joomla\CMS\Factory;
use Joomla\CMS\Form\Form;
Expand Down
4 changes: 2 additions & 2 deletions plugins/system/webauthn/fields/webauthn.php
Expand Up @@ -8,7 +8,7 @@
*/

// Prevent direct access
use Akeeba\Passwordless\Webauthn\Helper\Joomla;
use Joomla\Plugin\System\Webauthn\Helper\Joomla;
use Joomla\CMS\Factory;
use Joomla\CMS\Form\FormField;
use Joomla\CMS\HTML\HTMLHelper;
Expand Down Expand Up @@ -47,7 +47,7 @@ function getInput()
Text::script('PLG_SYSTEM_WEBAUTHN_ERR_LABEL_NOT_SAVED', true);

$app = Factory::getApplication();
$credentialRepository = new \Akeeba\Passwordless\Webauthn\CredentialRepository();
$credentialRepository = new \Joomla\Plugin\System\Webauthn\CredentialRepository();

return Joomla::renderLayout('akeeba.webauthn.manage', [
'user' => Factory::getContainer()->get(UserFactoryInterface::class)->loadUserById($user_id),
Expand Down
6 changes: 3 additions & 3 deletions plugins/system/webauthn/layout/akeeba/webauthn/button.php
@@ -1,6 +1,6 @@
<?php

use Akeeba\Passwordless\Webauthn\Helper\Joomla;
use Joomla\Plugin\System\Webauthn\Helper\Joomla;
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
Expand Down Expand Up @@ -60,11 +60,11 @@
*
* If you change the element from a <button> to something else, e.g. <a>, you may have to do a template override for the
* login.js Javascript file as well. This file is always loaded automatically by the
* Akeeba\Passwordless\Webauthn\PluginTraits\LoginModuleButtons PHP class which you cannot override. You can do that by
* Joomla\Plugin\System\Webauthn\PluginTraits\LoginModuleButtons PHP class which you cannot override. You can do that by
* copying /media/plg_system_webauthn/js/dist/login.css to your template's js/plg_system_webauthn/dist folder.
*
* If you want to change the look and feel of the button you need to do a template override of the CSS file button.css.
* This file is always loaded automatically by the Akeeba\Passwordless\Webauthn\PluginTraits\LoginModuleButtons PHP
* This file is always loaded automatically by the Joomla\Plugin\System\Webauthn\PluginTraits\LoginModuleButtons PHP
* class which you cannot override. You can do that by copying /media/plg_system_webauthn/css/button.css to your
* template's css/plg_system_webauthn folder (note the lack of a final css folder!).
*
Expand Down
4 changes: 2 additions & 2 deletions plugins/system/webauthn/layout/akeeba/webauthn/manage.php
Expand Up @@ -7,8 +7,8 @@
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

use Akeeba\Passwordless\Webauthn\Helper\CredentialsCreation;
use Akeeba\Passwordless\Webauthn\Helper\Joomla;
use Joomla\Plugin\System\Webauthn\Helper\CredentialsCreation;
use Joomla\Plugin\System\Webauthn\Helper\Joomla;
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
Expand Down
26 changes: 13 additions & 13 deletions plugins/system/webauthn/webauthn.php
Expand Up @@ -7,27 +7,27 @@
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

use Akeeba\Passwordless\Webauthn\Helper\Joomla;
use Akeeba\Passwordless\Webauthn\PluginTraits\AjaxHandler;
use Akeeba\Passwordless\Webauthn\PluginTraits\AjaxHandlerChallenge;
use Akeeba\Passwordless\Webauthn\PluginTraits\AjaxHandlerCreate;
use Akeeba\Passwordless\Webauthn\PluginTraits\AjaxHandlerDelete;
use Akeeba\Passwordless\Webauthn\PluginTraits\AjaxHandlerLogin;
use Akeeba\Passwordless\Webauthn\PluginTraits\AjaxHandlerSaveLabel;
use Akeeba\Passwordless\Webauthn\PluginTraits\ButtonsInModules;
use Akeeba\Passwordless\Webauthn\PluginTraits\ButtonsInUserPage;
use Akeeba\Passwordless\Webauthn\PluginTraits\UserDeletion;
use Akeeba\Passwordless\Webauthn\PluginTraits\UserProfileFields;
use Joomla\Plugin\System\Webauthn\Helper\Joomla;
use Joomla\Plugin\System\Webauthn\PluginTraits\AjaxHandler;
use Joomla\Plugin\System\Webauthn\PluginTraits\AjaxHandlerChallenge;
use Joomla\Plugin\System\Webauthn\PluginTraits\AjaxHandlerCreate;
use Joomla\Plugin\System\Webauthn\PluginTraits\AjaxHandlerDelete;
use Joomla\Plugin\System\Webauthn\PluginTraits\AjaxHandlerLogin;
use Joomla\Plugin\System\Webauthn\PluginTraits\AjaxHandlerSaveLabel;
use Joomla\Plugin\System\Webauthn\PluginTraits\ButtonsInModules;
use Joomla\Plugin\System\Webauthn\PluginTraits\ButtonsInUserPage;
use Joomla\Plugin\System\Webauthn\PluginTraits\UserDeletion;
use Joomla\Plugin\System\Webauthn\PluginTraits\UserProfileFields;
use Joomla\CMS\Form\Form;
use Joomla\CMS\Plugin\CMSPlugin;

// Protect from unauthorized access
defined('_JEXEC') or die();

// Register a PSR-4 autoloader for this plugin's classes if necessary
if (!class_exists('Akeeba\\Passwordless\\Webauthn\\Helper\\Joomla', true))
if (!class_exists('Joomla\\Plugin\\System\\Webauthn\\Helper\\Joomla', true))
{
JLoader::registerNamespace('Akeeba\\Passwordless\\Webauthn', __DIR__ . '/Webauthn', false, false, 'psr4');
JLoader::registerNamespace('Joomla\\Plugin\\System\\Webauthn', __DIR__ . '/Webauthn', false, false, 'psr4');
}

/**
Expand Down

0 comments on commit 8a3db27

Please sign in to comment.