[Pkg-owncloud-commits] [php-sabredav] 32/45: Renamed the requireAuth method in auth backends to 'challenge'.

David Prévot taffit at moszumanska.debian.org
Sat Jan 10 14:20:34 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository php-sabredav.

commit 1fc2bd0f7bceb7d0307e77161c99d24227131b4d
Author: Evert Pot <me at evertpot.com>
Date:   Mon Jan 5 20:09:46 2015 -0500

    Renamed the requireAuth method in auth backends to 'challenge'.
    
    This is a much better name. Sorry alpha testers.
    
    cc @hywan.
---
 ChangeLog.md                                        | 7 +++++++
 lib/DAV/Auth/Backend/AbstractBasic.php              | 4 +++-
 lib/DAV/Auth/Backend/AbstractDigest.php             | 4 +++-
 lib/DAV/Auth/Backend/Apache.php                     | 4 +++-
 lib/DAV/Auth/Backend/BackendInterface.php           | 4 +++-
 lib/DAV/Auth/Plugin.php                             | 2 +-
 tests/Sabre/DAV/Auth/Backend/AbstractBasicTest.php  | 2 +-
 tests/Sabre/DAV/Auth/Backend/AbstractDigestTest.php | 2 +-
 tests/Sabre/DAV/Auth/Backend/ApacheTest.php         | 2 +-
 tests/Sabre/DAV/Auth/Backend/Mock.php               | 2 +-
 10 files changed, 24 insertions(+), 9 deletions(-)

diff --git a/ChangeLog.md b/ChangeLog.md
index 2731c16..b053cfe 100644
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -1,6 +1,13 @@
 ChangeLog
 =========
 
+2.2.0-alpha2 (2015-??-??)
+-------------------------
+
+* Renamed `Sabre\DAV\Auth\Backend\BackendInterface::requireAuth` to
+  `challenge`, which is a more correct and better sounding name.
+
+
 2.2.0-alpha1 (2014-12-10)
 -------------------------
 
diff --git a/lib/DAV/Auth/Backend/AbstractBasic.php b/lib/DAV/Auth/Backend/AbstractBasic.php
index ada393d..1f600ba 100644
--- a/lib/DAV/Auth/Backend/AbstractBasic.php
+++ b/lib/DAV/Auth/Backend/AbstractBasic.php
@@ -127,9 +127,11 @@ abstract class AbstractBasic implements BackendInterface {
      * append your own WWW-Authenticate header instead of overwriting the
      * existing one.
      *
+     * @param RequestInterface $request
+     * @param ResponseInterface $request
      * @return void
      */
-    function requireAuth(RequestInterface $request, ResponseInterface $response) {
+    function challenge(RequestInterface $request, ResponseInterface $response) {
 
         $auth = new HTTP\Auth\Basic(
             $this->realm,
diff --git a/lib/DAV/Auth/Backend/AbstractDigest.php b/lib/DAV/Auth/Backend/AbstractDigest.php
index af0b813..6b283a2 100644
--- a/lib/DAV/Auth/Backend/AbstractDigest.php
+++ b/lib/DAV/Auth/Backend/AbstractDigest.php
@@ -144,9 +144,11 @@ abstract class AbstractDigest implements BackendInterface {
      * append your own WWW-Authenticate header instead of overwriting the
      * existing one.
      *
+     * @param RequestInterface $request
+     * @param ResponseInterface $request
      * @return void
      */
-    function requireAuth(RequestInterface $request, ResponseInterface $response) {
+    function challenge(RequestInterface $request, ResponseInterface $response) {
 
         $auth = new HTTP\Auth\Digest(
             $this->realm,
diff --git a/lib/DAV/Auth/Backend/Apache.php b/lib/DAV/Auth/Backend/Apache.php
index 4f9da00..b3d5c5f 100644
--- a/lib/DAV/Auth/Backend/Apache.php
+++ b/lib/DAV/Auth/Backend/Apache.php
@@ -87,9 +87,11 @@ class Apache implements BackendInterface {
      * append your own WWW-Authenticate header instead of overwriting the
      * existing one.
      *
+     * @param RequestInterface $request
+     * @param ResponseInterface $request
      * @return void
      */
-    function requireAuth(RequestInterface $request, ResponseInterface $response) {
+    function challenge(RequestInterface $request, ResponseInterface $response) {
 
     }
 
diff --git a/lib/DAV/Auth/Backend/BackendInterface.php b/lib/DAV/Auth/Backend/BackendInterface.php
index 87b3d7f..22d44d4 100644
--- a/lib/DAV/Auth/Backend/BackendInterface.php
+++ b/lib/DAV/Auth/Backend/BackendInterface.php
@@ -62,9 +62,11 @@ interface BackendInterface {
      * append your own WWW-Authenticate header instead of overwriting the
      * existing one.
      *
+     * @param RequestInterface $request
+     * @param ResponseInterface $request
      * @return void
      */
-    function requireAuth(RequestInterface $request, ResponseInterface $response);
+    function challenge(RequestInterface $request, ResponseInterface $response);
 
 }
 
diff --git a/lib/DAV/Auth/Plugin.php b/lib/DAV/Auth/Plugin.php
index 7cdee27..6744576 100644
--- a/lib/DAV/Auth/Plugin.php
+++ b/lib/DAV/Auth/Plugin.php
@@ -168,7 +168,7 @@ class Plugin extends ServerPlugin {
         $this->currentPrincipal = null;
 
         foreach($this->backends as $backend) {
-            $backend->requireAuth($request, $response);
+            $backend->challenge($request, $response);
         }
         throw new NotAuthenticated(implode(', ', $reasons));
 
diff --git a/tests/Sabre/DAV/Auth/Backend/AbstractBasicTest.php b/tests/Sabre/DAV/Auth/Backend/AbstractBasicTest.php
index 23461b3..e92aa4b 100644
--- a/tests/Sabre/DAV/Auth/Backend/AbstractBasicTest.php
+++ b/tests/Sabre/DAV/Auth/Backend/AbstractBasicTest.php
@@ -61,7 +61,7 @@ class AbstractBasicTest extends \PHPUnit_Framework_TestCase {
 
         $backend = new AbstractBasicMock();
         $backend->setRealm('writing unittests on a saturday night');
-        $backend->requireAuth($request, $response);
+        $backend->challenge($request, $response);
 
         $this->assertEquals(
             'Basic realm="writing unittests on a saturday night"',
diff --git a/tests/Sabre/DAV/Auth/Backend/AbstractDigestTest.php b/tests/Sabre/DAV/Auth/Backend/AbstractDigestTest.php
index 790a9b5..247befa 100644
--- a/tests/Sabre/DAV/Auth/Backend/AbstractDigestTest.php
+++ b/tests/Sabre/DAV/Auth/Backend/AbstractDigestTest.php
@@ -116,7 +116,7 @@ class AbstractDigestTest extends \PHPUnit_Framework_TestCase {
 
         $backend = new AbstractDigestMock();
         $backend->setRealm('writing unittests on a saturday night');
-        $backend->requireAuth($request, $response);
+        $backend->challenge($request, $response);
 
         $this->assertStringStartsWith(
             'Digest realm="writing unittests on a saturday night"',
diff --git a/tests/Sabre/DAV/Auth/Backend/ApacheTest.php b/tests/Sabre/DAV/Auth/Backend/ApacheTest.php
index 234cc94..697b593 100644
--- a/tests/Sabre/DAV/Auth/Backend/ApacheTest.php
+++ b/tests/Sabre/DAV/Auth/Backend/ApacheTest.php
@@ -62,7 +62,7 @@ class ApacheTest extends \PHPUnit_Framework_TestCase {
         $response = new HTTP\Response();
 
         $backend = new Apache();
-        $backend->requireAuth($request, $response);
+        $backend->challenge($request, $response);
 
         $this->assertNull(
             $response->getHeader('WWW-Authenticate')
diff --git a/tests/Sabre/DAV/Auth/Backend/Mock.php b/tests/Sabre/DAV/Auth/Backend/Mock.php
index a103b83..a782cb7 100644
--- a/tests/Sabre/DAV/Auth/Backend/Mock.php
+++ b/tests/Sabre/DAV/Auth/Backend/Mock.php
@@ -80,7 +80,7 @@ class Mock implements BackendInterface {
      *
      * @return void
      */
-    function requireAuth(RequestInterface $request, ResponseInterface $response) {
+    function challenge(RequestInterface $request, ResponseInterface $response) {
 
     }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/php-sabredav.git



More information about the Pkg-owncloud-commits mailing list