Germania KG · Authentication
This package was destilled from legacy code!
You better do not want it to use this in production.
, (*1)
Installation
$ composer require germania-kg/authentication
Overview
AuthUserInterface
namespace Germania\Authentication;
// Setter and Getter for User ID.
public function getId();
public function setId( $id );
AuthUserMiddleware
Constructor accepts:, (*2)
-
AuthUserInterface instance
-
Aura\Session\SegmentInterface instance.
- User ID session field name
- Optional: PSR-3 Logger
Middleware does:, (*3)
- Stores the user with a
user attribute in the Psr\Http\Message\ServerRequestInterface request object. It will be available within the $next middleware.
- After running
$next middleware, stores the User ID with the SegmentInterface instance, if the user attribute still is AuthUserInterface instance.
LoginController
TBD., (*4)
LogoutController
TBD., (*5)
Development
$ git clone git@github.com:GermaniaKG/Authentication.git germania-authentication
$ cd germania-authentication
$ composer install
Unit tests
Either copy phpunit.xml.dist to phpunit.xml and adapt to your needs, or leave as is.
Run PhpUnit like this:, (*6)
$ vendor/bin/phpunit