Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'zf2/master' into feature/doc
Browse files Browse the repository at this point in the history
  • Loading branch information
ezimuel committed Jul 11, 2012
14 parents ad280cb + b0d3db4 + 9b28224 + 49a871c + 4145ab4 + ff8e603 + abd0527 + 06375a2 + 53fdaa9 + 80ccc9b + fa80520 + 4009aca + 9dc2f89 + 20317fc commit da6fd5b
Show file tree
Hide file tree
Showing 37 changed files with 215 additions and 653 deletions.
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zendframework/zend-authentication",
"description": "Zend\\Authentication component",
"description": "provides an API for authentication and includes concrete authentication adapters for common use case scenarios",
"license": "BSD-3-Clause",
"keywords": [
"zf2",
Expand All @@ -9,11 +9,11 @@
"homepage": "https://github.com/zendframework/zend-authentication",
"autoload": {
"psr-4": {
"Zend\\Authentication\\": "src/"
"Zend\\Authentication": "src/"
}
},
"require": {
"php": ">=5.3.23",
"php": ">=5.3.3",
"zendframework/zend-stdlib": "self.version"
},
"require-dev": {
Expand Down
23 changes: 5 additions & 18 deletions src/Adapter/AdapterInterface.php
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@
<?php
/**
* Zend Framework
* Zend Framework (http://framework.zend.com/)
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Authentication
* @subpackage Adapter
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Authentication
*/

namespace Zend\Authentication\Adapter;
Expand All @@ -25,8 +14,6 @@
* @category Zend
* @package Zend_Authentication
* @subpackage Adapter
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
interface AdapterInterface
{
Expand Down
23 changes: 5 additions & 18 deletions src/Adapter/DbTable.php
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@
<?php
/**
* Zend Framework
* Zend Framework (http://framework.zend.com/)
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Authentication
* @subpackage Adapter
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Authentication
*/

namespace Zend\Authentication\Adapter;
Expand All @@ -31,8 +20,6 @@
* @category Zend
* @package Zend_Authentication
* @subpackage Adapter
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class DbTable implements AdapterInterface
{
Expand Down
23 changes: 5 additions & 18 deletions src/Adapter/Digest.php
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@
<?php
/**
* Zend Framework
* Zend Framework (http://framework.zend.com/)
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Authentication
* @subpackage Adapter
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Authentication
*/

namespace Zend\Authentication\Adapter;
Expand All @@ -27,8 +16,6 @@
* @category Zend
* @package Zend_Authentication
* @subpackage Adapter
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Digest implements AdapterInterface
{
Expand Down
25 changes: 6 additions & 19 deletions src/Adapter/Exception/ExceptionInterface.php
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@
<?php
/**
* Zend Framework
* Zend Framework (http://framework.zend.com/)
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Authentication
* @subpackage Adapter_Exception
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Authentication
*/

namespace Zend\Authentication\Adapter\Exception;
Expand All @@ -27,8 +16,6 @@
* @category Zend
* @package Zend_Authentication
* @subpackage Adapter_Exception
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
interface ExceptionInterface extends Exception
{}
{}
8 changes: 8 additions & 0 deletions src/Adapter/Exception/InvalidArgumentException.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Authentication
*/

namespace Zend\Authentication\Adapter\Exception;

Expand Down
23 changes: 5 additions & 18 deletions src/Adapter/Exception/RuntimeException.php
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@
<?php
/**
* Zend Framework
* Zend Framework (http://framework.zend.com/)
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Authentication
* @subpackage Adapter
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Authentication
*/

namespace Zend\Authentication\Adapter\Exception;
Expand All @@ -27,8 +16,6 @@
* @category Zend
* @package Zend_Authentication
* @subpackage Adapter
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class RuntimeException extends Exception\RuntimeException implements
ExceptionInterface
Expand Down
23 changes: 5 additions & 18 deletions src/Adapter/Exception/UnexpectedValueException.php
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@
<?php
/**
* Zend Framework
* Zend Framework (http://framework.zend.com/)
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Authentication
* @subpackage Adapter
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Authentication
*/

namespace Zend\Authentication\Adapter\Exception;
Expand All @@ -27,8 +16,6 @@
* @category Zend
* @package Zend_Authentication
* @subpackage Adapter
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class UnexpectedValueException extends Exception\UnexpectedValueException implements
ExceptionInterface
Expand Down
38 changes: 15 additions & 23 deletions src/Adapter/Http.php
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@
<?php
/**
* Zend Framework
* Zend Framework (http://framework.zend.com/)
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Authentication
* @subpackage Adapter_HTTP
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Authentication
*/

namespace Zend\Authentication\Adapter;
Expand All @@ -34,8 +23,6 @@
* @category Zend
* @package Zend_Authentication
* @subpackage Adapter_Http
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @todo Support auth-int
* @todo Track nonces, nonce-count, opaque for replay protection and stale support
* @todo Support Authentication-Info header
Expand Down Expand Up @@ -496,14 +483,19 @@ protected function _basicAuth($header)
return $this->_challengeClient();
}

$password = $this->_basicResolver->resolve($creds[0], $this->_realm);
if ($password &&
$this->_secureStringCompare($password, $creds[1])) {
$result = $this->_basicResolver->resolve($creds[0], $this->_realm, $creds[1]);

if ($result
&& !is_array($result)
&& $this->_secureStringCompare($result, $creds[1])
) {
$identity = array('username'=>$creds[0], 'realm'=>$this->_realm);
return new Authentication\Result(Authentication\Result::SUCCESS, $identity);
} else {
return $this->_challengeClient();
} elseif (is_array($result)) {
return new Authentication\Result(Authentication\Result::SUCCESS, $result);
}

return $this->_challengeClient();
}

/**
Expand Down
25 changes: 6 additions & 19 deletions src/Adapter/Http/Exception/ExceptionInterface.php
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@
<?php
/**
* Zend Framework
* Zend Framework (http://framework.zend.com/)
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Authentication
* @subpackage Adapter_HTTP_Exception
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Authentication
*/

namespace Zend\Authentication\Adapter\Http\Exception;
Expand All @@ -29,8 +18,6 @@
* @category Zend
* @package Zend_Authentication
* @subpackage Adapter_Http_Exception
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
interface ExceptionInterface extends Exception
{}
{}
Loading

0 comments on commit da6fd5b

Please sign in to comment.