docs: add inline documentation where missing

This commit is contained in:
Björn Fromme
2026-03-16 12:01:09 +01:00
parent 2fe9185a6f
commit ea1ce4a029
18 changed files with 150 additions and 0 deletions
+9
View File
@@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace App\Security;
use App\BusProNet\ApiClient;
@@ -22,6 +24,13 @@ use Symfony\Component\Security\Http\Authenticator\Passport\SelfValidatingPasspor
use Symfony\Component\Security\Http\EntryPoint\AuthenticationEntryPointInterface;
use Symfony\Component\Security\Http\Util\TargetPathTrait;
/**
* Authenticates users against the BPN API.
*
* Validates credentials via BPN's getPersonalData endpoint, creates or updates
* local User entities, and retrieves CRM attributes (roles, hotel codes) for
* authorization. Passwords are stored encrypted with RSA for subsequent API calls.
*/
class BpnAuthenticator extends AbstractLoginFormAuthenticator implements AuthenticationEntryPointInterface
{
use TargetPathTrait;
+9
View File
@@ -1,10 +1,19 @@
<?php
declare(strict_types=1);
namespace App\Security;
use Spatie\Crypto\Rsa\PrivateKey;
use Spatie\Crypto\Rsa\PublicKey;
/**
* RSA encryption/decryption utilities for secure credential storage.
*
* Uses asymmetric encryption to store BPN API passwords securely. Private key
* encrypts data for storage, public key decrypts for API calls. Also provides
* signing/verification for message integrity.
*/
class Crypt
{
public function __construct(private readonly string $path)
+9
View File
@@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace App\Security\Voter;
use App\BusProNet\Model\Booking;
@@ -7,6 +9,13 @@ use App\Entity\User;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Core\Authorization\Voter\Voter;
/**
* Determines access permissions for booking operations.
*
* Enforces ownership check via personId matching. VIEW access requires ownership,
* EDIT access additionally requires the booking to be in an editable state
* (determined by booking.isEditable()).
*/
class BookingVoter extends Voter
{
public const VIEW = 'VIEW';