-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[4.2] Convert token API auth plugin to services #37804
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
roland-d
merged 21 commits into
joomla:4.2-dev
from
Digital-Peak:j4/plugins/api-auth/token
May 21, 2022
Merged
Changes from 9 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
934404c
Convert token api auth plugin to services
laoneo 3e44d0f
cs
laoneo 5b66d47
final
laoneo ebd9cb1
Update plugins/api-authentication/token/services/provider.php
laoneo 994cb74
Inject filter
laoneo 1562e71
Use the model to load the plugin params
laoneo 1f18983
Update plugins/api-authentication/token/services/provider.php
laoneo b6fefae
Update plugins/api-authentication/token/services/provider.php
laoneo 633c2ce
Merge branch '4.2-dev' into j4/plugins/api-auth/token
laoneo d64feca
Update plugins/api-authentication/token/services/provider.php
laoneo 6e92ad1
Update plugins/api-authentication/token/src/Extension/Token.php
laoneo e96989b
Update plugins/api-authentication/token/token.xml
laoneo 57f1a18
Merge branch '4.2-dev' into j4/plugins/api-auth/token
laoneo 4c75189
Update plugins/api-authentication/token/src/Extension/Token.php
laoneo 2566887
Update plugins/api-authentication/token/src/Extension/Token.php
laoneo 5d1c029
Update plugins/api-authentication/token/src/Extension/Token.php
laoneo 2d498a9
Update administrator/components/com_plugins/src/Model/PluginModel.php
laoneo 88ff0d5
Update administrator/components/com_plugins/src/Model/PluginModel.php
laoneo aa76f6c
Update plugins/api-authentication/token/src/Extension/Token.php
laoneo 693d585
Merge branch '4.2-dev' into j4/plugins/api-auth/token
laoneo 0e62c34
Merge branch '4.2-dev' into j4/plugins/api-auth/token
roland-d File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,51 @@ | ||
| <?php | ||
| /** | ||
| * @package Joomla.Plugin | ||
| * @subpackage Apiauthentication.token | ||
| * | ||
| * @copyright (C) 2022 Open Source Matters, Inc. <https://www.joomla.org> | ||
| * @license GNU General Public License version 2 or later; see LICENSE.txt | ||
| */ | ||
|
|
||
| defined('_JEXEC') or die; | ||
|
|
||
| use Joomla\CMS\Extension\PluginInterface; | ||
| use Joomla\CMS\Plugin\PluginHelper; | ||
| use Joomla\CMS\User\UserFactoryInterface; | ||
| use Joomla\Database\DatabaseInterface; | ||
| use Joomla\DI\Container; | ||
| use Joomla\DI\ServiceProviderInterface; | ||
| use Joomla\Event\DispatcherInterface; | ||
| use Joomla\Filter\InputFilter; | ||
| use Joomla\Plugin\APIAuthentication\Token\Extension\Token; | ||
laoneo marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| return new class implements ServiceProviderInterface | ||
| { | ||
| /** | ||
| * Registers the service provider with a DI container. | ||
| * | ||
| * @param Container $container The DI container. | ||
| * | ||
| * @return void | ||
| * | ||
| * @since __DEPLOY_VERSION__ | ||
| */ | ||
| public function register(Container $container) | ||
| { | ||
| $container->set( | ||
| PluginInterface::class, | ||
| function (Container $container) | ||
| { | ||
| $plugin = new Token( | ||
| $container->get(DispatcherInterface::class), | ||
| (array) PluginHelper::getPlugin('api-authentication', 'token'), | ||
| $container->get(UserFactoryInterface::class), | ||
| new InputFilter | ||
| ); | ||
| $plugin->setDatabase($container->get(DatabaseInterface::class)); | ||
|
|
||
| return $plugin; | ||
| } | ||
| ); | ||
| } | ||
| }; | ||
This file contains hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.