PHP 클래스 Bolt\AccessControl\AccessChecker

저자: Gawain Lynch ([email protected])
파일 보기 프로젝트 열기: bolt/bolt 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$cookieOptions array
$dispatcher Symfony\Component\EventDispatcher\EventDispatcherInterface
$flashLogger Bolt\Logger\FlashLoggerInterface
$permissions Bolt\AccessControl\Permissions
$randomGenerator Bolt\Security\Random\Generator
$requestStack Symfony\Component\HttpFoundation\RequestStack
$session Symfony\Component\HttpFoundation\Session\SessionInterface
$systemLogger Psr\Log\LoggerInterface
$validSession boolean

공개 메소드들

메소드 설명
__construct ( Bolt\Storage\EntityManagerInterface $em, Symfony\Component\HttpFoundation\RequestStack $requestStack, Symfony\Component\HttpFoundation\Session\SessionInterface $session, Symfony\Component\EventDispatcher\EventDispatcherInterface $dispatcher, Bolt\Logger\FlashLoggerInterface $flashLogger, Psr\Log\LoggerInterface $systemLogger, Bolt\AccessControl\Permissions $permissions, Generator $randomGenerator, array $cookieOptions ) Constructor.
getActiveSessions ( ) : array Lookup active sessions.
isValidSession ( string $authCookie ) : boolean We will not allow tampering with sessions, so we make sure the current session is still valid for the device on which it was created, and that the username, and IP address, are still the same.
revokeSession ( ) : boolean Log out the currently logged in user.

보호된 메소드들

메소드 설명
checkSessionDatabase ( string $authCookie ) : boolean Check the user authentication cookie against what is stored in the database.
checkSessionKeys ( Token $sessionAuth ) : boolean Check the session is still valid for the device on which it was created, and. i.e. the username, IP address, and (if configured) the browser agent values are all still the same.
checkSessionStored ( Token $sessionAuth ) : boolean Check the stored session, if we're past expiry then return false regardless and force a check/update from the database authentication record.
getAuthToken ( string $username, string $salt ) : string | boolean Get a MD5 hash key to identify the session with. This is calculated from a name, a salt, and optionally the remote IP address, broswer's agent string and the user's HTTP hostname.
getClientHost ( ) : string Return the user's host name.
getClientIp ( ) : string Return the user's IP address.
getClientUserAgent ( ) : string Return the user's browser User Agent.
getRepositoryAuthtoken ( ) : Bolt\Storage\Repository\AuthtokenRepository
getRepositoryUsers ( ) : UsersRepository

메소드 상세

__construct() 공개 메소드

Constructor.
public __construct ( Bolt\Storage\EntityManagerInterface $em, Symfony\Component\HttpFoundation\RequestStack $requestStack, Symfony\Component\HttpFoundation\Session\SessionInterface $session, Symfony\Component\EventDispatcher\EventDispatcherInterface $dispatcher, Bolt\Logger\FlashLoggerInterface $flashLogger, Psr\Log\LoggerInterface $systemLogger, Bolt\AccessControl\Permissions $permissions, Generator $randomGenerator, array $cookieOptions )
$em Bolt\Storage\EntityManagerInterface
$requestStack Symfony\Component\HttpFoundation\RequestStack
$session Symfony\Component\HttpFoundation\Session\SessionInterface
$dispatcher Symfony\Component\EventDispatcher\EventDispatcherInterface
$flashLogger Bolt\Logger\FlashLoggerInterface
$systemLogger Psr\Log\LoggerInterface
$permissions Bolt\AccessControl\Permissions
$randomGenerator Bolt\Security\Random\Generator
$cookieOptions array

checkSessionDatabase() 보호된 메소드

Check the user authentication cookie against what is stored in the database.
protected checkSessionDatabase ( string $authCookie ) : boolean
$authCookie string
리턴 boolean

checkSessionKeys() 보호된 메소드

Check the session is still valid for the device on which it was created, and. i.e. the username, IP address, and (if configured) the browser agent values are all still the same.
protected checkSessionKeys ( Token $sessionAuth ) : boolean
$sessionAuth Bolt\AccessControl\Token\Token
리턴 boolean

checkSessionStored() 보호된 메소드

Check the stored session, if we're past expiry then return false regardless and force a check/update from the database authentication record.
protected checkSessionStored ( Token $sessionAuth ) : boolean
$sessionAuth Bolt\AccessControl\Token\Token
리턴 boolean

getActiveSessions() 공개 메소드

Lookup active sessions.
public getActiveSessions ( ) : array
리턴 array

getAuthToken() 보호된 메소드

Get a MD5 hash key to identify the session with. This is calculated from a name, a salt, and optionally the remote IP address, broswer's agent string and the user's HTTP hostname.
protected getAuthToken ( string $username, string $salt ) : string | boolean
$username string
$salt string
리턴 string | boolean

getClientHost() 보호된 메소드

Return the user's host name.
protected getClientHost ( ) : string
리턴 string

getClientIp() 보호된 메소드

Return the user's IP address.
protected getClientIp ( ) : string
리턴 string

getClientUserAgent() 보호된 메소드

Return the user's browser User Agent.
protected getClientUserAgent ( ) : string
리턴 string

getRepositoryAuthtoken() 보호된 메소드

protected getRepositoryAuthtoken ( ) : Bolt\Storage\Repository\AuthtokenRepository
리턴 Bolt\Storage\Repository\AuthtokenRepository

getRepositoryUsers() 보호된 메소드

protected getRepositoryUsers ( ) : UsersRepository
리턴 Bolt\Storage\Repository\UsersRepository

isValidSession() 공개 메소드

1. If user has a valid session and it is fresh, check against cookie: - If NOT a match refuse - If a match accept 2. If user has a valid session and it is stale (>10 minutes), check the database records again: - If disabled refuse - If enabled - If NOT a match refuse - If a match accept - Update session data 3. If user has no session check authtoken table entry (closed broswer): - If passed validity date refuse - If within validity date, hash username and IP against salt and compare to database: - If NOT a match refuse - If a match accept
public isValidSession ( string $authCookie ) : boolean
$authCookie string
리턴 boolean

revokeSession() 공개 메소드

Log out the currently logged in user.
public revokeSession ( ) : boolean
리턴 boolean

프로퍼티 상세

$cookieOptions 보호되어 있는 프로퍼티

protected array $cookieOptions
리턴 array

$dispatcher 보호되어 있는 프로퍼티

protected EventDispatcherInterface,Symfony\Component\EventDispatcher $dispatcher
리턴 Symfony\Component\EventDispatcher\EventDispatcherInterface

$flashLogger 보호되어 있는 프로퍼티

protected FlashLoggerInterface,Bolt\Logger $flashLogger
리턴 Bolt\Logger\FlashLoggerInterface

$permissions 보호되어 있는 프로퍼티

protected Permissions,Bolt\AccessControl $permissions
리턴 Bolt\AccessControl\Permissions

$randomGenerator 보호되어 있는 프로퍼티

protected Generator,Bolt\Security\Random $randomGenerator
리턴 Bolt\Security\Random\Generator

$requestStack 보호되어 있는 프로퍼티

protected RequestStack,Symfony\Component\HttpFoundation $requestStack
리턴 Symfony\Component\HttpFoundation\RequestStack

$session 보호되어 있는 프로퍼티

protected SessionInterface,Symfony\Component\HttpFoundation\Session $session
리턴 Symfony\Component\HttpFoundation\Session\SessionInterface

$systemLogger 보호되어 있는 프로퍼티

protected LoggerInterface,Psr\Log $systemLogger
리턴 Psr\Log\LoggerInterface

$validSession 보호되어 있는 프로퍼티

protected bool $validSession
리턴 boolean