lib: Move UserBackendInterface::authenticate() to new interface Authenticatable
refs #9660
This commit is contained in:
parent
2a4e614b5e
commit
4d44a0625c
|
@ -0,0 +1,21 @@
|
|||
<?php
|
||||
/* Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */
|
||||
|
||||
namespace Icinga\Authentication;
|
||||
|
||||
use Icinga\User;
|
||||
|
||||
interface Authenticatable
|
||||
{
|
||||
/**
|
||||
* Authenticate a user
|
||||
*
|
||||
* @param User $user
|
||||
* @param string $password
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* @throws \Icinga\Exception\AuthenticationException If authentication errors
|
||||
*/
|
||||
public function authenticate(User $user, $password);
|
||||
}
|
|
@ -3,13 +3,13 @@
|
|||
|
||||
namespace Icinga\Authentication\User;
|
||||
|
||||
use Icinga\Exception\AuthenticationException;
|
||||
use Icinga\Authentication\Authenticatable;
|
||||
use Icinga\User;
|
||||
|
||||
/**
|
||||
* Interface for user backends
|
||||
*/
|
||||
interface UserBackendInterface
|
||||
interface UserBackendInterface extends Authenticatable
|
||||
{
|
||||
/**
|
||||
* Set this backend's name
|
||||
|
@ -26,16 +26,4 @@ interface UserBackendInterface
|
|||
* @return string
|
||||
*/
|
||||
public function getName();
|
||||
|
||||
/**
|
||||
* Authenticate the given user
|
||||
*
|
||||
* @param User $user
|
||||
* @param string $password
|
||||
*
|
||||
* @return bool True on success, false on failure
|
||||
*
|
||||
* @throws AuthenticationException In case authentication is not possible due to an error
|
||||
*/
|
||||
public function authenticate(User $user, $password);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue