PHP 클래스 Thruway\Authentication\AuthenticationManager

상속: extends Thruway\Module\RouterModuleClient, implements Thruway\Module\RealmModuleInterface
파일 보기 프로젝트 열기: voryx/thruway

공개 메소드들

메소드 설명
__construct ( ) Constructor
getAuthMethods ( ) : array Get list supported authentication methods
getReady ( ) : boolean Get ready flag
getSubscribedEvents ( ) : array Listen for Router events
getSubscribedRealmEvents ( ) : array Listen for Realm events
handleAuthenticateMessage ( Realm $realm, Session $session, Thruway\Message\AuthenticateMessage $msg ) Handle Authenticate message
handleHelloMessage ( Realm $realm, Session $session, Thruway\Message\HelloMessage $msg ) Handle HelloMessage
handleMessageEvent ( MessageEvent $event )
handleNewRealm ( NewRealmEvent $event )
initModule ( Thruway\Peer\RouterInterface $router, React\EventLoop\LoopInterface $loop ) Gets called when the module is initialized in the router
onSessionClose ( Session $session ) This allows the AuthenticationManager to clean out auth methods that were registered by sessions that are dieing. Otherwise the method could be hijacked by another client in the thruway.auth realm.
onSessionStart ( ClientSession $session, Thruway\Transport\TransportProviderInterface $transport ) Handles session started
readyToAuthenticate ( ) : boolean Check ready to authenticate
registerAuthMethod ( array $args, array $kwargs, array $details ) : array This is called via a WAMP RPC URI. It is registered as thruway.auth.registermethod it takes arguments in an array - ["methodName", ["realm1", "realm2", "*"],
setReady ( boolean $ready ) Set ready flag

비공개 메소드들

메소드 설명
abortSessionUsingResponse ( Session $session, $response ) : boolean Send an abort message to the session if the Authenticator sent a FAILURE response Returns true if the abort was sent, false otherwise
onAuthenticateHandler ( $authMethod, $authMethodInfo, Realm $realm, Session $session, Thruway\Message\AuthenticateMessage $msg ) Call the handler that was registered to handle the Authenticate Message
onHelloAuthHandler ( $authMethod, $authMethodInfo, Realm $realm, Session $session, Thruway\Message\HelloMessage $msg ) Call the RPC URI that has been registered to handle Authentication Hello Messages
processMessage ( Realm $realm, Session $session, Thruway\Message\Message $msg ) Handles all messages for authentication (Hello and Authenticate) This is called by the Realm to handle authentication
realmHasAuthProvider ( string $realmName ) : boolean Checks to see if a realm has a registered auth provider

메소드 상세

__construct() 공개 메소드

Constructor
public __construct ( )

getAuthMethods() 공개 메소드

Get list supported authentication methods
public getAuthMethods ( ) : array
리턴 array

getReady() 공개 메소드

Get ready flag
public getReady ( ) : boolean
리턴 boolean

getSubscribedEvents() 공개 정적인 메소드

Listen for Router events
public static getSubscribedEvents ( ) : array
리턴 array

getSubscribedRealmEvents() 공개 메소드

Listen for Realm events
public getSubscribedRealmEvents ( ) : array
리턴 array

handleAuthenticateMessage() 공개 메소드

Handle Authenticate message
public handleAuthenticateMessage ( Realm $realm, Session $session, Thruway\Message\AuthenticateMessage $msg )
$realm Thruway\Realm
$session Thruway\Session
$msg Thruway\Message\AuthenticateMessage

handleHelloMessage() 공개 메소드

Handle HelloMessage
public handleHelloMessage ( Realm $realm, Session $session, Thruway\Message\HelloMessage $msg )
$realm Thruway\Realm
$session Thruway\Session
$msg Thruway\Message\HelloMessage

handleMessageEvent() 공개 메소드

public handleMessageEvent ( MessageEvent $event )
$event Thruway\Event\MessageEvent

handleNewRealm() 공개 메소드

public handleNewRealm ( NewRealmEvent $event )
$event Thruway\Event\NewRealmEvent

initModule() 공개 메소드

Gets called when the module is initialized in the router
public initModule ( Thruway\Peer\RouterInterface $router, React\EventLoop\LoopInterface $loop )
$router Thruway\Peer\RouterInterface
$loop React\EventLoop\LoopInterface

onSessionClose() 공개 메소드

This allows the AuthenticationManager to clean out auth methods that were registered by sessions that are dieing. Otherwise the method could be hijacked by another client in the thruway.auth realm.
public onSessionClose ( Session $session )
$session Thruway\Session

onSessionStart() 공개 메소드

Handles session started
public onSessionStart ( ClientSession $session, Thruway\Transport\TransportProviderInterface $transport )
$session Thruway\ClientSession
$transport Thruway\Transport\TransportProviderInterface

readyToAuthenticate() 공개 메소드

Check ready to authenticate
public readyToAuthenticate ( ) : boolean
리턴 boolean

registerAuthMethod() 공개 메소드

This is called via a WAMP RPC URI. It is registered as thruway.auth.registermethod it takes arguments in an array - ["methodName", ["realm1", "realm2", "*"],
public registerAuthMethod ( array $args, array $kwargs, array $details ) : array
$args array
$kwargs array
$details array
리턴 array

setReady() 공개 메소드

Set ready flag
public setReady ( boolean $ready )
$ready boolean