mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-25 00:53:48 +00:00
Dav: add some documentation on classes
This commit is contained in:
@@ -11,6 +11,9 @@ declare(strict_types=1);
|
||||
|
||||
namespace Chill\DocStoreBundle\Security\Authorization;
|
||||
|
||||
/**
|
||||
* Role to edit or see the stored object content.
|
||||
*/
|
||||
enum StoredObjectRoleEnum: string
|
||||
{
|
||||
case SEE = 'SEE';
|
||||
|
@@ -16,6 +16,11 @@ use Chill\DocStoreBundle\Security\Guard\DavTokenAuthenticationEventSubscriber;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
|
||||
use Symfony\Component\Security\Core\Authorization\Voter\Voter;
|
||||
|
||||
/**
|
||||
* Voter for the content of a stored object.
|
||||
*
|
||||
* This is in use to allow or disallow the edition of the stored object's content.
|
||||
*/
|
||||
class StoredObjectVoter extends Voter
|
||||
{
|
||||
protected function supports($attribute, $subject): bool
|
||||
|
@@ -15,6 +15,14 @@ use Lexik\Bundle\JWTAuthenticationBundle\TokenExtractor\TokenExtractorInterface;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
/**
|
||||
* Extract the JWT Token from the segment of the dav endpoints.
|
||||
*
|
||||
* A segment is a separation inside the string, using the character "/".
|
||||
*
|
||||
* For recognizing the JWT, the first segment must be "dav", and the second one must be
|
||||
* the JWT endpoint.
|
||||
*/
|
||||
final readonly class DavOnUrlTokenExtractor implements TokenExtractorInterface
|
||||
{
|
||||
public function __construct(
|
||||
|
@@ -16,6 +16,9 @@ use Lexik\Bundle\JWTAuthenticationBundle\Event\JWTAuthenticatedEvent;
|
||||
use Lexik\Bundle\JWTAuthenticationBundle\Events;
|
||||
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
||||
|
||||
/**
|
||||
* Store some data from the JWT's payload inside the token's attributes.
|
||||
*/
|
||||
class DavTokenAuthenticationEventSubscriber implements EventSubscriberInterface
|
||||
{
|
||||
final public const STORED_OBJECT = 'stored_object';
|
||||
|
@@ -18,6 +18,9 @@ use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInt
|
||||
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
/**
|
||||
* Alter the base JWTTokenAuthenticator to add the special extractor for dav url endpoints.
|
||||
*/
|
||||
class JWTOnDavUrlAuthenticator extends JWTTokenAuthenticator
|
||||
{
|
||||
public function __construct(
|
||||
|
Reference in New Issue
Block a user