diff options
author | Andy Wingo <wingo@pobox.com> | 2011-01-10 08:20:29 -0800 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2011-01-10 09:31:29 -0800 |
commit | ecfb7167cbc239a4b4f11cb8287e8116c2760cff (patch) | |
tree | c6eff829dfa7e61ce5c0bdd288535e5358120177 /test-suite/tests/web-http.test | |
parent | 94f16a5b8f51af91e273f9886e8ffa54eb3bd9c0 (diff) | |
download | guile-ecfb7167cbc239a4b4f11cb8287e8116c2760cff.tar.gz |
parse credentials and challenges
* module/web/http.scm (parse-credentials, validate-credentials)
(write-credentials, parse-challenge, parse-challenges)
(validate-challenges, write-challenge, write-challenges)
(declare-credentials-header!, declare-challenge-list-header!): New
helpers.
("Authorization", "Proxy-Authorization"): Parse out credentials.
("Proxy-Authenticate", "WWW-Authenticate"): Parse out challenges.
Diffstat (limited to 'test-suite/tests/web-http.test')
-rw-r--r-- | test-suite/tests/web-http.test | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/test-suite/tests/web-http.test b/test-suite/tests/web-http.test index ecefe7c00..c191c6eab 100644 --- a/test-suite/tests/web-http.test +++ b/test-suite/tests/web-http.test @@ -149,7 +149,10 @@ '((1000 . "da") (800 . "en-gb") (700 . "en"))) ;; Allow nonstandard .2 to mean 0.2 (pass-if-parse accept-language "en-gb;q=.2" '((200 . "en-gb"))) - (pass-if-parse authorization "foo" "foo") + (pass-if-parse authorization "Basic foooo" '(basic . "foooo")) + (pass-if-parse authorization "Digest foooo" '(digest foooo)) + (pass-if-parse authorization "Digest foo=bar,baz=qux" + '(digest (foo . "bar") (baz . "qux"))) (pass-if-parse expect "100-continue, foo" '((100-continue) (foo))) (pass-if-parse from "foo@bar" "foo@bar") (pass-if-parse host "qux" '("qux" . #f)) @@ -172,7 +175,10 @@ "~a, ~d ~b ~Y ~H:~M:~S ~z")) (pass-if-parse max-forwards "10" 10) (pass-if-parse max-forwards "00" 0) - (pass-if-parse proxy-authorization "foo" "foo") + (pass-if-parse proxy-authorization "Basic foooo" '(basic . "foooo")) + (pass-if-parse proxy-authorization "Digest foooo" '(digest foooo)) + (pass-if-parse proxy-authorization "Digest foo=bar,baz=qux" + '(digest (foo . "bar") (baz . "qux"))) (pass-if-parse range "bytes=10-20" '(bytes (10 . 20))) (pass-if-parse range "bytes=10-" '(bytes (10 . #f))) (pass-if-parse range "bytes=-20" '(bytes (#f . 20))) @@ -193,7 +199,8 @@ (pass-if-parse etag "W/\"foo\"" '("foo" . #f)) (pass-if-parse location "http://other-place" (build-uri 'http #:host "other-place")) - (pass-if-parse proxy-authenticate "ho-hum" "ho-hum") + (pass-if-parse proxy-authenticate "Basic realm=\"guile\"" + '((basic (realm . "guile")))) (pass-if-parse retry-after "Tue, 15 Nov 1994 08:12:31 GMT" (string->date "Tue, 15 Nov 1994 08:12:31 +0000" "~a, ~d ~b ~Y ~H:~M:~S ~z")) @@ -201,4 +208,5 @@ (pass-if-parse server "guile!" "guile!") (pass-if-parse vary "*" '*) (pass-if-parse vary "foo, bar" '(foo bar)) - (pass-if-parse www-authenticate "secret" "secret")) + (pass-if-parse www-authenticate "Basic realm=\"guile\"" + '((basic (realm . "guile"))))) |