unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Jarno Malmari <jarno@malmari.fi>
To: larsi@gnus.org
Cc: emacs-devel@gnu.org
Subject: [PATCH 1/3] Revert parts of url-auth test
Date: Thu,  8 Sep 2016 22:51:24 +0300	[thread overview]
Message-ID: <1473364286-2650-2-git-send-email-jarno@malmari.fi> (raw)
In-Reply-To: <1473364286-2650-1-git-send-email-jarno@malmari.fi>

This reverts some parts of commit f7b0ca9dfabc16cb286265de44a3fbfc3b5e73fa
that introduced QOP and digest test before their implementation.
---
 test/lisp/url/url-auth-tests.el | 37 +++++--------------------------------
 1 file changed, 5 insertions(+), 32 deletions(-)

diff --git a/test/lisp/url/url-auth-tests.el b/test/lisp/url/url-auth-tests.el
index bc30f35..a80349d 100644
--- a/test/lisp/url/url-auth-tests.el
+++ b/test/lisp/url/url-auth-tests.el
@@ -36,18 +36,6 @@ url-auth-test-challenges
 ;; Set explicitly for easier modification for re-runs.
 (setq url-auth-test-challenges
       (list
-       (list :qop "auth"
-             :nonce "uBr3+qkQBybTr/dKWkmpUqVO7SaEwWYzyTKO7g==$"
-             :uri "/random/path"
-             :method "GET"
-             :realm "Some test realm"
-             :cnonce "YWU4NDcxYWMxMDAxMjlkMjAwMDE4MjI5MDAwMGY4NGQ="
-             :nc "00000001"
-             :username "jytky"
-             :password "xi5Ac2HEfKt1lKKO05DCSqsK0u7hqqtsT"
-             :expected-ha1 "af521db3a83abd91262fead04fa31892"
-             :expected-ha2 "e490a6a147c79404b365d1f6059ddda5"
-             :expected-response "ecb6396e93b9e09e31f19264cfd8f854")
        (list :nonce "a1be8a3065e00c5bf190ad499299aea5"
              :opaque "d7c2a27230fc8c74bb6e06be8c9cd189"
              :realm "The Test Realm"
@@ -183,15 +171,9 @@ url-auth-test-challenges
         (should-not auth)))))
 
 (ert-deftest url-auth-test-digest-auth ()
-  "Check common authorization string contents.
-Challenges with qop are not checked for response since a unique
-cnonce is used for generating them which is not mocked by the
-test and cannot be passed by arguments to `url-digest-auth'."
+  "Check common authorization string contents."
   (dolist (challenge url-auth-test-challenges)
-    (let* ((attrs (append
-                   (list (cons "nonce" (plist-get challenge :nonce)))
-                   (if (plist-get challenge :qop)
-                       (list (cons "qop" (plist-get challenge :qop))))))
+    (let* ((attrs (list (cons "nonce" (plist-get challenge :nonce))))
            (url (concat "http://example.org" (plist-get challenge :uri)))
            url-digest-auth-storage
            auth)
@@ -212,24 +194,15 @@ url-auth-test-challenges
                                   (plist-get challenge :realm) attrs))
       (should auth)
       (should (string-prefix-p "Digest " auth))
+      (should (string-match ".*response=\"\\(.*?\\)\".*" auth))
+      (should (string= (match-string 1 auth)
+                       (plist-get challenge :expected-response)))
       (should (string-match ".*username=\"\\(.*?\\)\".*" auth))
       (should (string= (match-string 1 auth)
                        (plist-get challenge :username)))
       (should (string-match ".*realm=\"\\(.*?\\)\".*" auth))
       (should (string= (match-string 1 auth)
                        (plist-get challenge :realm)))
-
-      (if (plist-member challenge :qop)
-          (progn
-            ;; We don't know these, just check that they exists.
-            (should (string-match-p ".*response=\".*?\".*" auth))
-            ;; url-digest-auth doesn't return these AFAICS.
-;;;            (should (string-match-p ".*nc=\".*?\".*" auth))
-;;;            (should (string-match-p ".*cnonce=\".*?\".*" auth))
-            )
-        (should (string-match ".*response=\"\\(.*?\\)\".*" auth))
-        (should (string= (match-string 1 auth)
-                         (plist-get challenge :expected-response))))
       )))
 
 (ert-deftest url-auth-test-digest-auth-opaque ()
-- 
2.7.0.25.gfc10eb5




  reply	other threads:[~2016-09-08 19:51 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-09 12:25 url-digest-auth QOP implementation Jarno Malmari
2015-05-10 17:10 ` Lars Magne Ingebrigtsen
2015-05-11 19:17   ` Patches for qop=auth implementation for url-digest-auth Jarno Malmari
2015-05-11 19:17     ` [PATCH 1/3] Test for url-auth Jarno Malmari
2015-05-11 19:17     ` [PATCH 2/3] Refactor digest authentication in url-auth Jarno Malmari
2015-05-11 19:17     ` [PATCH 3/3] Initial implementation for HTTP Digest qop for url Jarno Malmari
2015-05-18 15:47     ` Patches for qop=auth implementation for url-digest-auth Lars Magne Ingebrigtsen
2015-05-26 17:13       ` Jarno Malmari
2015-08-08  8:14       ` Jarno Malmari
2015-08-30 11:52         ` Lars Magne Ingebrigtsen
2015-08-30 16:17           ` [PATCH 1/3] Test for url-auth Jarno Malmari
2015-08-30 16:17             ` [PATCH 2/3] Refactor digest authentication in url-auth Jarno Malmari
2015-08-30 16:17             ` [PATCH 3/3] Initial implementation for HTTP Digest qop for url Jarno Malmari
2016-02-07  5:35             ` [PATCH 1/3] Test for url-auth Lars Ingebrigtsen
2016-02-07 15:57               ` Eli Zaretskii
2016-02-08  4:57             ` Lars Ingebrigtsen
2016-02-08  5:29               ` Lars Ingebrigtsen
2016-09-08 19:51                 ` Jarno Malmari
2016-09-08 19:51                   ` Jarno Malmari [this message]
2016-09-08 19:51                   ` [PATCH 2/3] Refactor digest authentication in url-auth Jarno Malmari
2016-09-08 19:51                   ` [PATCH 3/3] Initial implementation for HTTP Digest qop for url Jarno Malmari
2016-11-12 22:03                   ` [PATCH 1/3] Test for url-auth Jarno Malmari
2016-11-12 22:03                     ` [PATCH 1/2] Refactor digest authentication in url-auth Jarno Malmari
2016-11-12 22:03                     ` [PATCH 2/2] Initial implementation for HTTP Digest qop for url Jarno Malmari
2016-11-13 11:36                     ` [PATCH 1/3] Test for url-auth Jarno Malmari
2016-11-13 11:36                       ` [PATCH 1/2] Refactor digest authentication in url-auth Jarno Malmari
2016-11-13 15:53                         ` Eli Zaretskii
2016-11-13 21:57                           ` Jarno Malmari
2016-11-14  3:42                             ` Eli Zaretskii
2016-11-14  4:34                               ` Yuri Khan
2016-11-14 15:28                                 ` Eli Zaretskii
2017-02-14 21:12                                 ` Jarno Malmari
2017-02-14 21:12                                   ` [PATCH 1/2] " Jarno Malmari
2017-02-14 21:12                                   ` [PATCH 2/2] Initial implementation for HTTP Digest qop for url Jarno Malmari
2017-02-18 11:11                                   ` Refactor digest authentication in url-auth Eli Zaretskii
2017-02-25  8:54                                     ` Eli Zaretskii
2017-03-05 15:54                                       ` Jarno Malmari
2017-03-05 16:06                                         ` Eli Zaretskii
2017-03-11 10:08                                         ` Eli Zaretskii
2017-03-25 16:08                                           ` Eli Zaretskii
2017-03-27 19:47                                           ` Jarno Malmari
2017-03-27 19:47                                             ` [PATCH 1/2] " Jarno Malmari
2017-03-27 19:47                                             ` [PATCH 2/2] Initial implementation for HTTP Digest qop for url Jarno Malmari
2017-04-01  6:24                                             ` Refactor digest authentication in url-auth Eli Zaretskii
2016-11-13 11:36                       ` [PATCH 2/2] Initial implementation for HTTP Digest qop for url Jarno Malmari

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1473364286-2650-2-git-send-email-jarno@malmari.fi \
    --to=jarno@malmari.fi \
    --cc=emacs-devel@gnu.org \
    --cc=larsi@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).