Skip to content

Commit

Permalink
Restructure security and icon services
Browse files Browse the repository at this point in the history
  • Loading branch information
mattamon committed Apr 25, 2024
1 parent 52131c6 commit 64bd343
Show file tree
Hide file tree
Showing 29 changed files with 38 additions and 33 deletions.
8 changes: 8 additions & 0 deletions config/icon.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
services:
_defaults:
autowire: true
autoconfigure: true
public: false

Pimcore\Bundle\StudioBackendBundle\Icon\Service\IconServiceInterface:
class: Pimcore\Bundle\StudioBackendBundle\Icon\Service\IconService
4 changes: 2 additions & 2 deletions config/security.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ services:
tags:
- { name: security.voter }

Pimcore\Bundle\StudioBackendBundle\Service\SecurityServiceInterface:
class: Pimcore\Bundle\StudioBackendBundle\Service\SecurityService
Pimcore\Bundle\StudioBackendBundle\Security\Service\SecurityServiceInterface:
class: Pimcore\Bundle\StudioBackendBundle\Security\Service\SecurityService
4 changes: 0 additions & 4 deletions config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ services:
tags: [ 'controller.service_arguments' ]


Pimcore\Bundle\StudioBackendBundle\Service\IconServiceInterface:
class: Pimcore\Bundle\StudioBackendBundle\Service\IconService





Expand Down
2 changes: 1 addition & 1 deletion src/Asset/Controller/CollectionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
namespace Pimcore\Bundle\StudioBackendBundle\Asset\Controller;

use OpenApi\Attributes\Get;
use Pimcore\Bundle\StudioBackendBundle\Controller\Api\AbstractApiController;
use Pimcore\Bundle\StudioBackendBundle\Controller\AbstractApiController;
use Pimcore\Bundle\StudioBackendBundle\DataIndex\AssetSearchServiceInterface;
use Pimcore\Bundle\StudioBackendBundle\DataIndex\OpenSearchFilterInterface;
use Pimcore\Bundle\StudioBackendBundle\DataIndex\Request\ElementParameters;
Expand Down
2 changes: 1 addition & 1 deletion src/Asset/Controller/GetController.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
namespace Pimcore\Bundle\StudioBackendBundle\Asset\Controller;

use OpenApi\Attributes\Get;
use Pimcore\Bundle\StudioBackendBundle\Controller\Api\AbstractApiController;
use Pimcore\Bundle\StudioBackendBundle\Controller\AbstractApiController;
use Pimcore\Bundle\StudioBackendBundle\DataIndex\AssetSearchServiceInterface;
use Pimcore\Bundle\StudioBackendBundle\OpenApi\Attributes\Parameters\Path\IdParameter;
use Pimcore\Bundle\StudioBackendBundle\OpenApi\Attributes\Response\Content\OneOfAssetJson;
Expand Down
4 changes: 2 additions & 2 deletions src/Authorization/Controller/AuthorizationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
use Pimcore\Bundle\StudioBackendBundle\Authorization\Schema\Refresh;
use Pimcore\Bundle\StudioBackendBundle\Authorization\Schema\Token;
use Pimcore\Bundle\StudioBackendBundle\Authorization\Service\TokenServiceInterface;
use Pimcore\Bundle\StudioBackendBundle\Controller\Api\AbstractApiController;
use Pimcore\Bundle\StudioBackendBundle\Controller\AbstractApiController;
use Pimcore\Bundle\StudioBackendBundle\OpenApi\Attributes\Request\CredentialsRequestBody;
use Pimcore\Bundle\StudioBackendBundle\OpenApi\Attributes\Request\TokenRequestBody;
use Pimcore\Bundle\StudioBackendBundle\OpenApi\Attributes\Response\Error\MethodNotAllowedResponse;
Expand All @@ -31,7 +31,7 @@
use Pimcore\Bundle\StudioBackendBundle\OpenApi\Attributes\Response\Error\UnsupportedMediaTypeResponse;
use Pimcore\Bundle\StudioBackendBundle\OpenApi\Attributes\Response\SuccessResponse;
use Pimcore\Bundle\StudioBackendBundle\OpenApi\Config\Tags;
use Pimcore\Bundle\StudioBackendBundle\Service\SecurityServiceInterface;
use Pimcore\Bundle\StudioBackendBundle\Security\Service\SecurityServiceInterface;
use Pimcore\Security\User\User;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpKernel\Attribute\MapRequestPayload;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* @license http://www.pimcore.org/license GPLv3 and PCL
*/

namespace Pimcore\Bundle\StudioBackendBundle\Controller\Api;
namespace Pimcore\Bundle\StudioBackendBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse;
Expand Down
2 changes: 1 addition & 1 deletion src/DataIndex/Hydrator/Asset/ArchiveHydrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

use Pimcore\Bundle\GenericDataIndexBundle\Model\Search\Asset\SearchResult\SearchResultItem\Archive as ArchiveItem;
use Pimcore\Bundle\StudioBackendBundle\DataIndex\Hydrator\PermissionsHydratorInterface;
use Pimcore\Bundle\StudioBackendBundle\Icon\Service\IconServiceInterface;
use Pimcore\Bundle\StudioBackendBundle\Response\Asset\Archive;
use Pimcore\Bundle\StudioBackendBundle\Service\IconServiceInterface;

final readonly class ArchiveHydrator implements ArchiveHydratorInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/DataIndex/Hydrator/Asset/AudioHydrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

use Pimcore\Bundle\GenericDataIndexBundle\Model\Search\Asset\SearchResult\SearchResultItem\Audio as AudioItem;
use Pimcore\Bundle\StudioBackendBundle\DataIndex\Hydrator\PermissionsHydratorInterface;
use Pimcore\Bundle\StudioBackendBundle\Icon\Service\IconServiceInterface;
use Pimcore\Bundle\StudioBackendBundle\Response\Asset\Audio;
use Pimcore\Bundle\StudioBackendBundle\Service\IconServiceInterface;

final readonly class AudioHydrator implements AudioHydratorInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/DataIndex/Hydrator/Asset/DocumentHydrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

use Pimcore\Bundle\GenericDataIndexBundle\Model\Search\Asset\SearchResult\SearchResultItem\Document as DocumentItem;
use Pimcore\Bundle\StudioBackendBundle\DataIndex\Hydrator\PermissionsHydratorInterface;
use Pimcore\Bundle\StudioBackendBundle\Icon\Service\IconServiceInterface;
use Pimcore\Bundle\StudioBackendBundle\Response\Asset\Document;
use Pimcore\Bundle\StudioBackendBundle\Service\IconServiceInterface;

final readonly class DocumentHydrator implements DocumentHydratorInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/DataIndex/Hydrator/Asset/FolderHydrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

use Pimcore\Bundle\GenericDataIndexBundle\Model\Search\Asset\SearchResult\SearchResultItem\Folder as FolderItem;
use Pimcore\Bundle\StudioBackendBundle\DataIndex\Hydrator\PermissionsHydratorInterface;
use Pimcore\Bundle\StudioBackendBundle\Icon\Service\IconServiceInterface;
use Pimcore\Bundle\StudioBackendBundle\Response\Asset\Folder;
use Pimcore\Bundle\StudioBackendBundle\Service\IconServiceInterface;

final readonly class FolderHydrator implements FolderHydratorInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/DataIndex/Hydrator/Asset/ImageHydrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

use Pimcore\Bundle\GenericDataIndexBundle\Model\Search\Asset\SearchResult\SearchResultItem\Image as ImageItem;
use Pimcore\Bundle\StudioBackendBundle\DataIndex\Hydrator\PermissionsHydratorInterface;
use Pimcore\Bundle\StudioBackendBundle\Icon\Service\IconServiceInterface;
use Pimcore\Bundle\StudioBackendBundle\Response\Asset\Image;
use Pimcore\Bundle\StudioBackendBundle\Service\IconServiceInterface;

final readonly class ImageHydrator implements ImageHydratorInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/DataIndex/Hydrator/Asset/TextHydrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

use Pimcore\Bundle\GenericDataIndexBundle\Model\Search\Asset\SearchResult\SearchResultItem\Text as TextItem;
use Pimcore\Bundle\StudioBackendBundle\DataIndex\Hydrator\PermissionsHydratorInterface;
use Pimcore\Bundle\StudioBackendBundle\Icon\Service\IconServiceInterface;
use Pimcore\Bundle\StudioBackendBundle\Response\Asset\Text;
use Pimcore\Bundle\StudioBackendBundle\Service\IconServiceInterface;

final readonly class TextHydrator implements TextHydratorInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/DataIndex/Hydrator/Asset/UnknownHydrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

use Pimcore\Bundle\GenericDataIndexBundle\Model\Search\Asset\SearchResult\SearchResultItem\Unknown as UnknownItem;
use Pimcore\Bundle\StudioBackendBundle\DataIndex\Hydrator\PermissionsHydratorInterface;
use Pimcore\Bundle\StudioBackendBundle\Icon\Service\IconServiceInterface;
use Pimcore\Bundle\StudioBackendBundle\Response\Asset\Unknown;
use Pimcore\Bundle\StudioBackendBundle\Service\IconServiceInterface;

final readonly class UnknownHydrator implements UnknownHydratorInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/DataIndex/Hydrator/Asset/VideoHydrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

use Pimcore\Bundle\GenericDataIndexBundle\Model\Search\Asset\SearchResult\SearchResultItem\Video as VideoItem;
use Pimcore\Bundle\StudioBackendBundle\DataIndex\Hydrator\PermissionsHydratorInterface;
use Pimcore\Bundle\StudioBackendBundle\Icon\Service\IconServiceInterface;
use Pimcore\Bundle\StudioBackendBundle\Response\Asset\Video;
use Pimcore\Bundle\StudioBackendBundle\Service\IconServiceInterface;

final readonly class VideoHydrator implements VideoHydratorInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/DataIndex/Hydrator/AssetHydrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

use Pimcore\Bundle\GenericDataIndexBundle\Model\Search\Asset\SearchResult\AssetSearchResultItem;
use Pimcore\Bundle\StudioBackendBundle\DataIndex\Hydrator\Asset\MetaDataHydratorInterface;
use Pimcore\Bundle\StudioBackendBundle\Icon\Service\IconServiceInterface;
use Pimcore\Bundle\StudioBackendBundle\Response\Asset;
use Pimcore\Bundle\StudioBackendBundle\Service\IconServiceInterface;

final readonly class AssetHydrator implements AssetHydratorInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/DataIndex/OpenSearchFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
use Pimcore\Bundle\StudioBackendBundle\Exception\InvalidFilterTypeException;
use Pimcore\Bundle\StudioBackendBundle\Exception\InvalidQueryTypeException;
use Pimcore\Bundle\StudioBackendBundle\Factory\QueryFactoryInterface;
use Pimcore\Bundle\StudioBackendBundle\Filter\Service\FilterServiceInterface;
use Pimcore\Bundle\StudioBackendBundle\Request\CollectionParametersInterface;
use Pimcore\Bundle\StudioBackendBundle\Service\FilterServiceInterface;

/**
* @internal
Expand Down
2 changes: 1 addition & 1 deletion src/DataObject/Controller/CollectionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
namespace Pimcore\Bundle\StudioBackendBundle\DataObject\Controller;

use OpenApi\Attributes\Get;
use Pimcore\Bundle\StudioBackendBundle\Controller\Api\AbstractApiController;
use Pimcore\Bundle\StudioBackendBundle\Controller\AbstractApiController;
use Pimcore\Bundle\StudioBackendBundle\DataIndex\DataObjectSearchServiceInterface;
use Pimcore\Bundle\StudioBackendBundle\DataIndex\OpenSearchFilterInterface;
use Pimcore\Bundle\StudioBackendBundle\DataIndex\Request\DataObjectParameters;
Expand Down
1 change: 1 addition & 0 deletions src/DependencyInjection/PimcoreStudioBackendExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public function load(array $configs, ContainerBuilder $container): void
$loader->load('data_objects.yaml');
$loader->load('event_subscribers.yaml');
$loader->load('factories.yaml');
$loader->load('icon.yaml');
$loader->load('open_api.yaml');
$loader->load('providers.yaml');
$loader->load('security.yaml');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* @license http://www.pimcore.org/license GPLv3 and PCL
*/

namespace Pimcore\Bundle\StudioBackendBundle\Service;
namespace Pimcore\Bundle\StudioBackendBundle\Filter\Service;

interface FilterServiceInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* @license http://www.pimcore.org/license GPLv3 and PCL
*/

namespace Pimcore\Bundle\StudioBackendBundle\Service;
namespace Pimcore\Bundle\StudioBackendBundle\Icon\Service;

final class IconService implements IconServiceInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* @license http://www.pimcore.org/license GPLv3 and PCL
*/

namespace Pimcore\Bundle\StudioBackendBundle\Service;
namespace Pimcore\Bundle\StudioBackendBundle\Icon\Service;

interface IconServiceInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* @license http://www.pimcore.org/license GPLv3 and PCL
*/

namespace Pimcore\Bundle\StudioBackendBundle\Service;
namespace Pimcore\Bundle\StudioBackendBundle\Security\Service;

use Pimcore\Bundle\StaticResolverBundle\Models\Tool\TmpStoreResolverInterface;
use Pimcore\Bundle\StudioBackendBundle\Authorization\Schema\Credentials;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* @license http://www.pimcore.org/license GPLv3 and PCL
*/

namespace Pimcore\Bundle\StudioBackendBundle\Service;
namespace Pimcore\Bundle\StudioBackendBundle\Security\Service;

use Pimcore\Bundle\StudioBackendBundle\Authorization\Schema\Credentials;
use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
Expand Down
2 changes: 1 addition & 1 deletion src/Security/Voter/AuthorizationVoter.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

use Pimcore\Bundle\StudioBackendBundle\Exception\NoRequestException;
use Pimcore\Bundle\StudioBackendBundle\Exception\NotAuthorizedException;
use Pimcore\Bundle\StudioBackendBundle\Service\SecurityServiceInterface;
use Pimcore\Bundle\StudioBackendBundle\Security\Service\SecurityServiceInterface;
use Pimcore\Bundle\StudioBackendBundle\Util\Traits\RequestTrait;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
Expand Down
2 changes: 1 addition & 1 deletion src/Security/Voter/PublicAuthorizationVoter.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
use Pimcore\Bundle\StudioBackendBundle\Exception\NonPublicTranslationException;
use Pimcore\Bundle\StudioBackendBundle\Exception\NoRequestException;
use Pimcore\Bundle\StudioBackendBundle\Exception\NotAuthorizedException;
use Pimcore\Bundle\StudioBackendBundle\Service\SecurityServiceInterface;
use Pimcore\Bundle\StudioBackendBundle\Security\Service\SecurityServiceInterface;
use Pimcore\Bundle\StudioBackendBundle\Util\Traits\PublicTranslationTrait;
use Pimcore\Bundle\StudioBackendBundle\Util\Traits\RequestTrait;
use Symfony\Component\HttpFoundation\Request;
Expand Down
2 changes: 1 addition & 1 deletion src/Translation/Controller/TranslationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

use OpenApi\Attributes\JsonContent;
use OpenApi\Attributes\Post;
use Pimcore\Bundle\StudioBackendBundle\Controller\Api\AbstractApiController;
use Pimcore\Bundle\StudioBackendBundle\Controller\AbstractApiController;
use Pimcore\Bundle\StudioBackendBundle\OpenApi\Attributes\Request\TranslationRequestBody;
use Pimcore\Bundle\StudioBackendBundle\OpenApi\Attributes\Response\Error\MethodNotAllowedResponse;
use Pimcore\Bundle\StudioBackendBundle\OpenApi\Attributes\Response\Error\UnauthorizedResponse;
Expand Down
2 changes: 1 addition & 1 deletion src/Util/Traits/StudioBackendPathTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

namespace Pimcore\Bundle\StudioBackendBundle\Util\Traits;

use Pimcore\Bundle\StudioBackendBundle\Controller\Api\AbstractApiController;
use Pimcore\Bundle\StudioBackendBundle\Controller\AbstractApiController;

/**
* @internal
Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/Service/Security/SecurityServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
use Pimcore\Bundle\StaticResolverBundle\Models\Tool\TmpStoreResolverInterface;
use Pimcore\Bundle\StudioBackendBundle\Authorization\Schema\Credentials;
use Pimcore\Bundle\StudioBackendBundle\Exception\AccessDeniedException;
use Pimcore\Bundle\StudioBackendBundle\Service\SecurityService;
use Pimcore\Bundle\StudioBackendBundle\Service\SecurityServiceInterface;
use Pimcore\Bundle\StudioBackendBundle\Security\Service\SecurityService;
use Pimcore\Bundle\StudioBackendBundle\Security\Service\SecurityServiceInterface;
use Pimcore\Model\Tool\TmpStore;
use Pimcore\Security\User\User;
use Pimcore\Security\User\UserProvider;
Expand Down

0 comments on commit 64bd343

Please sign in to comment.