PHP Class Thruway\Authentication\AuthenticationManager

Inheritance: extends Thruway\Module\RouterModuleClient, implements Thruway\Module\RealmModuleInterface
Afficher le fichier Open project: voryx/thruway

Méthodes publiques

Méthode Description
__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

Private Methods

Méthode Description
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

Method Details

__construct() public méthode

Constructor
public __construct ( )

getAuthMethods() public méthode

Get list supported authentication methods
public getAuthMethods ( ) : array
Résultat array

getReady() public méthode

Get ready flag
public getReady ( ) : boolean
Résultat boolean

getSubscribedEvents() public static méthode

Listen for Router events
public static getSubscribedEvents ( ) : array
Résultat array

getSubscribedRealmEvents() public méthode

Listen for Realm events
public getSubscribedRealmEvents ( ) : array
Résultat array

handleAuthenticateMessage() public méthode

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

handleHelloMessage() public méthode

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

handleMessageEvent() public méthode

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

handleNewRealm() public méthode

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

initModule() public méthode

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() public méthode

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() public méthode

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

readyToAuthenticate() public méthode

Check ready to authenticate
public readyToAuthenticate ( ) : boolean
Résultat boolean

registerAuthMethod() public méthode

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
Résultat array

setReady() public méthode

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