| 1: | <?php |
| 2: | |
| 3: | /* |
| 4: | * Library to use PortBilling events with PSR-14 event dispatch |
| 5: | */ |
| 6: | |
| 7: | namespace Porta\Psr14Event\Auth; |
| 8: | |
| 9: | use Porta\Psr14Event\Event; |
| 10: | use Porta\Psr14Event\EventException; |
| 11: | |
| 12: | /** |
| 13: | * Interface for ESPF call authentificator |
| 14: | * |
| 15: | * @api |
| 16: | * @package Auth |
| 17: | */ |
| 18: | interface AuthInterface |
| 19: | { |
| 20: | |
| 21: | /** |
| 22: | * Perform authentification |
| 23: | * |
| 24: | * The method takes Event, retrieves auth data and perform authentification. |
| 25: | * - In a case of success it returns the Event itself. |
| 26: | * - In a case of failure it will throw EventException with code 401 |
| 27: | * |
| 28: | * @param Event $event |
| 29: | * @return Event |
| 30: | * @throws EventException with code 401 in a case of failure |
| 31: | * @api |
| 32: | */ |
| 33: | public function authentificate(Event $event): Event; |
| 34: | } |
| 35: |