/** * Resets the managed objects */ public function reassignRequest() { $request = $this->dispatcher->getRequest(); if ($this->authenticationProvider) { $this->authenticationProvider->setRequest($request); } if ($this->accessController) { $this->accessController->setRequest($request); } }
/** * Returns the Authentication Provider * * @return \Cundd\Rest\Authentication\AuthenticationProviderInterface */ public function getAuthenticationProvider() { if (!$this->authenticationProvider) { list($vendor, $extension, ) = Utility::getClassNamePartsForPath($this->getRequest()->path()); // Check if an extension provides a Authentication Provider $authenticationProviderClass = 'Tx_' . $extension . '_Rest_AuthenticationProvider'; if (!class_exists($authenticationProviderClass)) { $authenticationProviderClass = ($vendor ? $vendor . '\\' : '') . $extension . '\\Rest\\AuthenticationProvider'; } // Use the found Authentication Provider if (class_exists($authenticationProviderClass)) { $this->authenticationProvider = $this->get($authenticationProviderClass); } else { // Use the default Authentication Provider $this->authenticationProvider = $this->get('Cundd\\Rest\\Authentication\\AuthenticationProviderCollection', array($this->get('Cundd\\Rest\\Authentication\\BasicAuthenticationProvider'), $this->get('Cundd\\Rest\\Authentication\\CredentialsAuthenticationProvider'))); } $this->authenticationProvider->setRequest($this->getRequest()); } return $this->authenticationProvider; }