Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 3 |
|
0.00% |
0 / 3 |
CRAP | |
0.00% |
0 / 1 |
| tao_models_classes_oauth_Service | |
0.00% |
0 / 3 |
|
0.00% |
0 / 3 |
12 | |
0.00% |
0 / 1 |
| sign | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| validate | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getService | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * This program is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU General Public License |
| 6 | * as published by the Free Software Foundation; under version 2 |
| 7 | * of the License (non-upgradable). |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU General Public License |
| 15 | * along with this program; if not, write to the Free Software |
| 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 17 | * |
| 18 | * Copyright (c) 2013 (original work) (update and modification) Open Assessment Technologies SA |
| 19 | * (under the project TAO-PRODUCT); |
| 20 | */ |
| 21 | |
| 22 | use oat\oatbox\service\ServiceManager; |
| 23 | use oat\tao\model\oauth\OauthService; |
| 24 | |
| 25 | /** |
| 26 | * Oauth Services based on the TAO DataStore implementation |
| 27 | * |
| 28 | * @access public |
| 29 | * @author Joel Bout, <joel@taotesting.com> |
| 30 | * @deprecated |
| 31 | */ |
| 32 | class tao_models_classes_oauth_Service implements common_http_SignatureService |
| 33 | { |
| 34 | /** |
| 35 | * Adds a signature to the request |
| 36 | * |
| 37 | * @access public |
| 38 | * @author Joel Bout, <joel@taotesting.com> |
| 39 | * @param $authorizationHeader Move the signature parameters into the Authorization header of the request |
| 40 | */ |
| 41 | public function sign( |
| 42 | common_http_Request $request, |
| 43 | common_http_Credentials $credentials, |
| 44 | $authorizationHeader = false |
| 45 | ) { |
| 46 | return $this->getService()->sign($request, $credentials, $authorizationHeader); |
| 47 | } |
| 48 | |
| 49 | /** |
| 50 | * Validates the signature of the current request |
| 51 | * |
| 52 | * @access protected |
| 53 | * @author Joel Bout, <joel@taotesting.com> |
| 54 | * @param common_http_Request request |
| 55 | * @throws common_Exception exception thrown if validation fails |
| 56 | */ |
| 57 | public function validate(common_http_Request $request, common_http_Credentials $credentials = null) |
| 58 | { |
| 59 | return $this->getService()->validate($request, $credentials); |
| 60 | } |
| 61 | |
| 62 | /** |
| 63 | * @return OauthService |
| 64 | */ |
| 65 | private function getService() |
| 66 | { |
| 67 | return ServiceManager::getServiceManager()->get(OauthService::SERVICE_ID); |
| 68 | } |
| 69 | } |