Skip to content
Snippets Groups Projects
Commit aa1a43d5 authored by Reiter, Christoph's avatar Reiter, Christoph :snake:
Browse files

Rename to the new relay naming schema without breaking API

This changes everything except the ShortName and the API paths, so
HTTP clients continue to work as before.

The remaining changes will follow once all  PHP users are ported.
parent ae3f8716
No related branches found
Tags v0.1.14
No related merge requests found
Pipeline #56731 passed
Showing
with 61 additions and 61 deletions
...@@ -16,7 +16,7 @@ composer require dbp/api-base-bundle ...@@ -16,7 +16,7 @@ composer require dbp/api-base-bundle
```php ```php
... ...
DBP\API\BaseBundle\DbpBaseBundle::class => ['all' => true], Dbp\Relay\BaseBundle\DbpRelayBaseBundle::class => ['all' => true],
DBP\API\CoreBundle\DbpCoreBundle::class => ['all' => true], DBP\API\CoreBundle\DbpCoreBundle::class => ['all' => true],
]; ];
``` ```
......
{ {
"name": "dbp/api-base-bundle", "name": "dbp/relay-base-bundle",
"type": "symfony-bundle", "type": "symfony-bundle",
"license": "AGPL-3.0-or-later", "license": "AGPL-3.0-or-later",
"require": { "require": {
...@@ -32,12 +32,12 @@ ...@@ -32,12 +32,12 @@
}, },
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"DBP\\API\\BaseBundle\\": "src/" "Dbp\\Relay\\BaseBundle\\": "src/"
} }
}, },
"autoload-dev": { "autoload-dev": {
"psr-4": { "psr-4": {
"DBP\\API\\BaseBundle\\Tests\\": "tests/" "Dbp\\Relay\\BaseBundle\\Tests\\": "tests/"
} }
}, },
"config": { "config": {
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "2cd489c238235dc4f2259cf92594c168", "content-hash": "412a6debb11df123e57bd8a615074b4b",
"packages": [ "packages": [
{ {
"name": "api-platform/core", "name": "api-platform/core",
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<server name="SYMFONY_PHPUNIT_REMOVE" value=""/> <server name="SYMFONY_PHPUNIT_REMOVE" value=""/>
<server name="SYMFONY_PHPUNIT_VERSION" value="9"/> <server name="SYMFONY_PHPUNIT_VERSION" value="9"/>
<server name="SYMFONY_DEPRECATIONS_HELPER" value="weak"/> <server name="SYMFONY_DEPRECATIONS_HELPER" value="weak"/>
<server name="KERNEL_CLASS" value="DBP\API\BaseBundle\Tests\Kernel"/> <server name="KERNEL_CLASS" value="Dbp\Relay\BaseBundle\Tests\Kernel"/>
</php> </php>
<testsuites> <testsuites>
<testsuite name="Project Test Suite"> <testsuite name="Project Test Suite">
......
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
declare(strict_types=1); declare(strict_types=1);
namespace DBP\API\BaseBundle\API; namespace Dbp\Relay\BaseBundle\API;
use DBP\API\BaseBundle\Entity\Organization; use Dbp\Relay\BaseBundle\Entity\Organization;
use DBP\API\BaseBundle\Entity\Person; use Dbp\Relay\BaseBundle\Entity\Person;
interface OrganizationProviderInterface interface OrganizationProviderInterface
{ {
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
declare(strict_types=1); declare(strict_types=1);
namespace DBP\API\BaseBundle\API; namespace Dbp\Relay\BaseBundle\API;
use DBP\API\BaseBundle\Entity\Person; use Dbp\Relay\BaseBundle\Entity\Person;
interface PersonProviderInterface interface PersonProviderInterface
{ {
......
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
declare(strict_types=1); declare(strict_types=1);
namespace DBP\API\BaseBundle\Controller; namespace Dbp\Relay\BaseBundle\Controller;
use ApiPlatform\Core\DataProvider\PaginatorInterface; use ApiPlatform\Core\DataProvider\PaginatorInterface;
use DBP\API\BaseBundle\API\OrganizationProviderInterface; use Dbp\Relay\BaseBundle\API\OrganizationProviderInterface;
use DBP\API\BaseBundle\API\PersonProviderInterface; use Dbp\Relay\BaseBundle\API\PersonProviderInterface;
use Dbp\Relay\CoreBundle\Exception\ApiError; use Dbp\Relay\CoreBundle\Exception\ApiError;
use Dbp\Relay\CoreBundle\Helpers\ArrayFullPaginator; use Dbp\Relay\CoreBundle\Helpers\ArrayFullPaginator;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
......
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
declare(strict_types=1); declare(strict_types=1);
namespace DBP\API\BaseBundle\DataProvider; namespace Dbp\Relay\BaseBundle\DataProvider;
use ApiPlatform\Core\DataProvider\ContextAwareCollectionDataProviderInterface; use ApiPlatform\Core\DataProvider\ContextAwareCollectionDataProviderInterface;
use ApiPlatform\Core\DataProvider\RestrictedDataProviderInterface; use ApiPlatform\Core\DataProvider\RestrictedDataProviderInterface;
use DBP\API\BaseBundle\API\OrganizationProviderInterface; use Dbp\Relay\BaseBundle\API\OrganizationProviderInterface;
use DBP\API\BaseBundle\Entity\Organization; use Dbp\Relay\BaseBundle\Entity\Organization;
use Dbp\Relay\CoreBundle\Helpers\ArrayFullPaginator; use Dbp\Relay\CoreBundle\Helpers\ArrayFullPaginator;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
......
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
declare(strict_types=1); declare(strict_types=1);
namespace DBP\API\BaseBundle\DataProvider; namespace Dbp\Relay\BaseBundle\DataProvider;
use ApiPlatform\Core\DataProvider\ItemDataProviderInterface; use ApiPlatform\Core\DataProvider\ItemDataProviderInterface;
use ApiPlatform\Core\DataProvider\RestrictedDataProviderInterface; use ApiPlatform\Core\DataProvider\RestrictedDataProviderInterface;
use DBP\API\BaseBundle\API\OrganizationProviderInterface; use Dbp\Relay\BaseBundle\API\OrganizationProviderInterface;
use DBP\API\BaseBundle\Entity\Organization; use Dbp\Relay\BaseBundle\Entity\Organization;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
final class OrganizationDataProvider extends AbstractController implements ItemDataProviderInterface, RestrictedDataProviderInterface final class OrganizationDataProvider extends AbstractController implements ItemDataProviderInterface, RestrictedDataProviderInterface
......
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
declare(strict_types=1); declare(strict_types=1);
namespace DBP\API\BaseBundle\DataProvider; namespace Dbp\Relay\BaseBundle\DataProvider;
use ApiPlatform\Core\DataProvider\CollectionDataProviderInterface; use ApiPlatform\Core\DataProvider\CollectionDataProviderInterface;
use ApiPlatform\Core\DataProvider\RestrictedDataProviderInterface; use ApiPlatform\Core\DataProvider\RestrictedDataProviderInterface;
use DBP\API\BaseBundle\API\PersonProviderInterface; use Dbp\Relay\BaseBundle\API\PersonProviderInterface;
use DBP\API\BaseBundle\Entity\Person; use Dbp\Relay\BaseBundle\Entity\Person;
use Dbp\Relay\CoreBundle\Helpers\ArrayFullPaginator; use Dbp\Relay\CoreBundle\Helpers\ArrayFullPaginator;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
......
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
declare(strict_types=1); declare(strict_types=1);
namespace DBP\API\BaseBundle\DataProvider; namespace Dbp\Relay\BaseBundle\DataProvider;
use ApiPlatform\Core\DataProvider\ItemDataProviderInterface; use ApiPlatform\Core\DataProvider\ItemDataProviderInterface;
use ApiPlatform\Core\DataProvider\RestrictedDataProviderInterface; use ApiPlatform\Core\DataProvider\RestrictedDataProviderInterface;
use DBP\API\BaseBundle\API\PersonProviderInterface; use Dbp\Relay\BaseBundle\API\PersonProviderInterface;
use DBP\API\BaseBundle\Entity\Person; use Dbp\Relay\BaseBundle\Entity\Person;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
final class PersonItemDataProvider extends AbstractController implements ItemDataProviderInterface, RestrictedDataProviderInterface final class PersonItemDataProvider extends AbstractController implements ItemDataProviderInterface, RestrictedDataProviderInterface
......
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
declare(strict_types=1); declare(strict_types=1);
namespace DBP\API\BaseBundle; namespace Dbp\Relay\BaseBundle;
use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle; use Symfony\Component\HttpKernel\Bundle\Bundle;
class DbpBaseBundle extends Bundle class DbpRelayBaseBundle extends Bundle
{ {
public function build(ContainerBuilder $container) public function build(ContainerBuilder $container)
{ {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
declare(strict_types=1); declare(strict_types=1);
namespace DBP\API\BaseBundle\DependencyInjection; namespace Dbp\Relay\BaseBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface; use Symfony\Component\Config\Definition\ConfigurationInterface;
...@@ -11,7 +11,7 @@ class Configuration implements ConfigurationInterface ...@@ -11,7 +11,7 @@ class Configuration implements ConfigurationInterface
{ {
public function getConfigTreeBuilder() public function getConfigTreeBuilder()
{ {
$treeBuilder = new TreeBuilder('dbp_base'); $treeBuilder = new TreeBuilder('dbp_relay_base');
return $treeBuilder; return $treeBuilder;
} }
......
...@@ -2,14 +2,14 @@ ...@@ -2,14 +2,14 @@
declare(strict_types=1); declare(strict_types=1);
namespace DBP\API\BaseBundle\DependencyInjection; namespace Dbp\Relay\BaseBundle\DependencyInjection;
use Symfony\Component\Config\FileLocator; use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
use Symfony\Component\HttpKernel\DependencyInjection\ConfigurableExtension; use Symfony\Component\HttpKernel\DependencyInjection\ConfigurableExtension;
class DbpBaseExtension extends ConfigurableExtension class DbpRelayBaseExtension extends ConfigurableExtension
{ {
public function loadInternal(array $mergedConfig, ContainerBuilder $container) public function loadInternal(array $mergedConfig, ContainerBuilder $container)
{ {
......
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
declare(strict_types=1); declare(strict_types=1);
namespace DBP\API\BaseBundle\Entity; namespace Dbp\Relay\BaseBundle\Entity;
use ApiPlatform\Core\Annotation\ApiProperty; use ApiPlatform\Core\Annotation\ApiProperty;
use ApiPlatform\Core\Annotation\ApiResource; use ApiPlatform\Core\Annotation\ApiResource;
use DBP\API\BaseBundle\Controller\GetOrganizationsByPerson; use Dbp\Relay\BaseBundle\Controller\GetOrganizationsByPerson;
use Symfony\Component\Serializer\Annotation\Groups; use Symfony\Component\Serializer\Annotation\Groups;
/** /**
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
declare(strict_types=1); declare(strict_types=1);
namespace DBP\API\BaseBundle\Entity; namespace Dbp\Relay\BaseBundle\Entity;
use ApiPlatform\Core\Annotation\ApiResource; use ApiPlatform\Core\Annotation\ApiResource;
...@@ -31,7 +31,7 @@ use ApiPlatform\Core\Annotation\ApiResource; ...@@ -31,7 +31,7 @@ use ApiPlatform\Core\Annotation\ApiResource;
* iri="http://schema.org/Person", * iri="http://schema.org/Person",
* description="A person of the LDAP system", * description="A person of the LDAP system",
* normalizationContext={ * normalizationContext={
* "groups" = {"Person:output"}, * "groups" = {"BasePerson:output"},
* "jsonld_embed_context" = true, * "jsonld_embed_context" = true,
* } * }
* ) * )
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
declare(strict_types=1); declare(strict_types=1);
namespace DBP\API\BaseBundle\Entity; namespace Dbp\Relay\BaseBundle\Entity;
use ApiPlatform\Core\Annotation\ApiProperty; use ApiPlatform\Core\Annotation\ApiProperty;
use Symfony\Component\Serializer\Annotation\Groups; use Symfony\Component\Serializer\Annotation\Groups;
...@@ -11,7 +11,7 @@ trait PersonTrait ...@@ -11,7 +11,7 @@ trait PersonTrait
{ {
/** /**
* @ApiProperty(identifier=true) * @ApiProperty(identifier=true)
* @Groups({"Person:output"}) * @Groups({"BasePerson:output"})
* *
* @var string * @var string
*/ */
...@@ -19,7 +19,7 @@ trait PersonTrait ...@@ -19,7 +19,7 @@ trait PersonTrait
/** /**
* @ApiProperty(iri="http://schema.org/givenName") * @ApiProperty(iri="http://schema.org/givenName")
* @Groups({"Person:output"}) * @Groups({"BasePerson:output"})
* *
* @var string * @var string
*/ */
...@@ -28,7 +28,7 @@ trait PersonTrait ...@@ -28,7 +28,7 @@ trait PersonTrait
/** /**
* @var string * @var string
* @ApiProperty(iri="http://schema.org/familyName") * @ApiProperty(iri="http://schema.org/familyName")
* @Groups({"Person:output"}) * @Groups({"BasePerson:output"})
* *
* @var string * @var string
*/ */
...@@ -36,7 +36,7 @@ trait PersonTrait ...@@ -36,7 +36,7 @@ trait PersonTrait
/** /**
* @ApiProperty(iri="http://schema.org/email") * @ApiProperty(iri="http://schema.org/email")
* @Groups({"Person:current-user", "Person:extended-access"}) * @Groups({"BasePerson:current-user", "BasePerson:extended-access"})
* *
* @var string * @var string
*/ */
...@@ -44,14 +44,14 @@ trait PersonTrait ...@@ -44,14 +44,14 @@ trait PersonTrait
/** /**
* @var array * @var array
* @Groups({"Person:current-user"}) * @Groups({"BasePerson:current-user"})
*/ */
private $roles; private $roles;
/** /**
* @var string * @var string
* @ApiProperty(iri="http://schema.org/birthDate") * @ApiProperty(iri="http://schema.org/birthDate")
* @Groups({"Person:current-user"}) * @Groups({"BasePerson:current-user"})
*/ */
private $birthDate; private $birthDate;
...@@ -127,7 +127,7 @@ trait PersonTrait ...@@ -127,7 +127,7 @@ trait PersonTrait
/** /**
* @ApiProperty(iri="http://schema.org/name") * @ApiProperty(iri="http://schema.org/name")
* @Groups({"Person:output"}) * @Groups({"BasePerson:output"})
*/ */
public function getName(): ?string public function getName(): ?string
{ {
......
services: services:
DBP\API\BaseBundle\Controller\: Dbp\Relay\BaseBundle\Controller\:
resource: '../../Controller' resource: '../../Controller'
autowire: true autowire: true
autoconfigure: true autoconfigure: true
DBP\API\BaseBundle\API\OrganizationProviderInterface: Dbp\Relay\BaseBundle\API\OrganizationProviderInterface:
'@DBP\API\BaseBundle\Service\DummyOrganizationProvider' '@Dbp\Relay\BaseBundle\Service\DummyOrganizationProvider'
DBP\API\BaseBundle\Service\DummyOrganizationProvider: Dbp\Relay\BaseBundle\Service\DummyOrganizationProvider:
autowire: true autowire: true
autoconfigure: true autoconfigure: true
DBP\API\BaseBundle\Service\DummyPersonProvider: Dbp\Relay\BaseBundle\Service\DummyPersonProvider:
autowire: true autowire: true
autoconfigure: true autoconfigure: true
DBP\API\BaseBundle\API\PersonProviderInterface: Dbp\Relay\BaseBundle\API\PersonProviderInterface:
'@DBP\API\BaseBundle\Service\DummyPersonProvider' '@Dbp\Relay\BaseBundle\Service\DummyPersonProvider'
DBP\API\BaseBundle\DataProvider\: Dbp\Relay\BaseBundle\DataProvider\:
resource: '../../DataProvider' resource: '../../DataProvider'
autowire: true autowire: true
autoconfigure: true autoconfigure: true
DBP\API\BaseBundle\Serializer\PersonAttributeNormalizer: Dbp\Relay\BaseBundle\Serializer\PersonAttributeNormalizer:
autowire: true autowire: true
autoconfigure: true autoconfigure: true
# This alias exist so we can replace the service during tests # This alias exist so we can replace the service during tests
test.PersonProviderInterface: test.PersonProviderInterface:
alias: 'DBP\API\BaseBundle\API\PersonProviderInterface' alias: 'Dbp\Relay\BaseBundle\API\PersonProviderInterface'
public: true public: true
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
declare(strict_types=1); declare(strict_types=1);
namespace DBP\API\BaseBundle\Serializer; namespace Dbp\Relay\BaseBundle\Serializer;
use DBP\API\BaseBundle\Entity\Person; use Dbp\Relay\BaseBundle\Entity\Person;
use Symfony\Component\Security\Core\Security; use Symfony\Component\Security\Core\Security;
use Symfony\Component\Serializer\Normalizer\ContextAwareNormalizerInterface; use Symfony\Component\Serializer\Normalizer\ContextAwareNormalizerInterface;
use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface;
...@@ -30,7 +30,7 @@ class PersonAttributeNormalizer implements ContextAwareNormalizerInterface, Norm ...@@ -30,7 +30,7 @@ class PersonAttributeNormalizer implements ContextAwareNormalizerInterface, Norm
{ {
// set the group "Person:current-user" for the current user // set the group "Person:current-user" for the current user
if ($this->isCurrentUser($object)) { if ($this->isCurrentUser($object)) {
$context['groups'][] = 'Person:current-user'; $context['groups'][] = 'BasePerson:current-user';
} }
$context[self::ALREADY_CALLED] = true; $context[self::ALREADY_CALLED] = true;
......
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
declare(strict_types=1); declare(strict_types=1);
namespace DBP\API\BaseBundle\Service; namespace Dbp\Relay\BaseBundle\Service;
use DBP\API\BaseBundle\API\OrganizationProviderInterface; use Dbp\Relay\BaseBundle\API\OrganizationProviderInterface;
use DBP\API\BaseBundle\Entity\Organization; use Dbp\Relay\BaseBundle\Entity\Organization;
use DBP\API\BaseBundle\Entity\Person; use Dbp\Relay\BaseBundle\Entity\Person;
class DummyOrganizationProvider implements OrganizationProviderInterface class DummyOrganizationProvider implements OrganizationProviderInterface
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment