This file contains 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
<?php | |
class SwaggerDecorator implements NormalizerInterface | |
{ | |
private $decorated; | |
public function __construct(NormalizerInterface $decorated) | |
{ | |
$this->decorated = $decorated; | |
} |
This file contains 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
<?php | |
class OwnerExtension implements QueryCollectionExtensionInterface | |
{ | |
private $tokenStorage; | |
public function __construct(TokenStorageInterface $tokenStorage) | |
{ | |
$this->tokenStorage = $tokenStorage; |
This file contains 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
<?php | |
/** | |
* @ApiResource( | |
* ... | |
* itemOperations={ | |
* "get" = { object.user == user" }, | |
* "put" = { object.user == user" } | |
* }, | |
* ) |
This file contains 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
/** | |
* @ApiResource( | |
* normalizationContext={"groups"={"subjectList"}}, | |
* denormalizationContext={"groups"={"subjectCreate"}}, | |
* itemOperations={"get","put"}, | |
* attributes={"access_control"="is_granted('ROLE_USER')"} | |
* ) | |
* | |
* @ORM\Entity | |
*/ |
This file contains 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
<?php | |
namespace App\EventSubscriber; | |
use ApiPlatform\Core\EventListener\EventPriorities; | |
use App\Entity\User; | |
use Symfony\Component\EventDispatcher\EventSubscriberInterface; | |
use Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent; | |
use Symfony\Component\HttpKernel\KernelEvents; | |
use Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface; |
This file contains 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
<?php | |
// ... | |
class User implements UserInterface | |
{ | |
// ... | |
public $roles = ['ROLE_USER']; | |
/** | |
* ... | |
* @Assert\Length(min="8", max="255", groups={"userCreate", "userChangePassword"}) |
This file contains 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
encoders: | |
App\Entity\User: | |
algorithm: 'argon2i' | |
memory_cost: 1024 | |
time_cost: 2 | |
threads: 2 |
This file contains 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
login: | |
path: /login |
This file contains 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
... | |
firewalls: | |
login: | |
pattern: ^/login | |
stateless: true | |
anonymous: true | |
provider: db_provider | |
json_login: | |
check_path: /login |
This file contains 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
security: | |
providers: | |
db_provider: | |
entity: | |
class: App\Entity\User | |
property: email |
NewerOlder