/** * Each chain needs to fill this function with it's own actions. * This function contains the functionality of each chain. * * @param ConfigInterface $pConfig The configuration which is used to make the request. * @param InternalFactory $pInternalFactory The factory which is responsible for the internal object creation. * @return bool|stdClass true if the request has been processed, false otherwise */ protected function process(ConfigInterface $pConfig, InternalFactory $pInternalFactory) { if ($pConfig->getAuthenticationMethod() === Authenticate::AUTH_METHOD_HEADER_TOKEN) { return true; } return false; }
/** * Creates the Client object if not done before. * * @param array $pConfigurationOptions The configuration which is used to create a correct client object. * @return Client Returns the Client object. */ public function getHttpClientObject($pConfigurationOptions = array()) { if (is_null($this->_client)) { $this->_client = new Client($this->_config->getRestAPIUrl() === '' ?: $this->_config->getRestAPIUrl(), $pConfigurationOptions); } return $this->_client; }
/** * Each chain needs to fill this function with it's own actions. * This function contains the functionality of each chain. * * @param ConfigInterface $pConfig The configuration which is used to make the request. * @param InternalFactory $pInternalFactory The factory which is responsible for the internal object creation. * @return bool|stdClass true if the request has been processed, false otherwise */ protected function process(ConfigInterface $pConfig, InternalFactory $pInternalFactory) { if ($pConfig->getAuthenticationMethod() !== Authenticate::AUTH_METHOD_TOKEN) { return false; } $token = $pConfig->getAuthenticationCredentials(); return json_decode($pInternalFactory->getGuzzleFactory()->getGuzzleHandler()->get('token/' . $token)->getBody()); }
/** * Each chain needs to fill this function with it's own actions. * This function contains the functionality of each chain. * * @param ConfigInterface $pConfig The configuration which is used to make the request. * @param InternalFactory $pInternalFactory The factory which is responsible for the internal object creation. * @return bool|stdClass true if the request has been processed, false otherwise */ protected function process(ConfigInterface $pConfig, InternalFactory $pInternalFactory) { if ($pConfig->getAuthenticationMethod() !== Authenticate::AUTH_METHOD_USER_CREDENTIALS) { return false; } $userCredentials = $pConfig->getAuthenticationCredentials(); $userSession = $pConfig->getSession(); $response = json_decode($pInternalFactory->getGuzzleFactory()->getGuzzleHandler()->get('user/logout/' . $userCredentials['username'] . '/' . $userSession)->getBody()); return $response; }