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