quickjs-tart

quickjs-based runtime for wallet-core logic
Log | Files | Refs | README | LICENSE

test153 (4261B)


      1 <testcase>
      2 <info>
      3 <keywords>
      4 HTTP
      5 HTTP GET
      6 HTTP Digest auth
      7 </keywords>
      8 </info>
      9 
     10 # Server-side
     11 <reply>
     12 # First reply back and ask for Digest auth
     13 <data1>
     14 HTTP/1.1 401 Authorization Required swsclose
     15 Server: Apache/1.3.27 (Darwin) PHP/4.1.2
     16 WWW-Authenticate: Digest realm="testrealm", nonce="1053604145"
     17 Content-Type: text/html; charset=iso-8859-1
     18 Content-Length: 26
     19 
     20 This is not the real page
     21 </data1>
     22 
     23 # second reply back
     24 <data2>
     25 HTTP/1.1 401 Authorization Required swsclose
     26 Server: Apache/1.3.27 (Darwin) PHP/4.1.2
     27 WWW-Authenticate: Digest realm="testrealm", nonce="1053604145"
     28 Content-Type: text/html; charset=iso-8859-1
     29 Content-Length: 26
     30 
     31 This is not the real page
     32 </data2>
     33 
     34 # This is supposed to be returned when the server gets a
     35 # Authorization: Digest line passed-in from the client
     36 <data1001>
     37 HTTP/1.1 200 OK
     38 Server: Apache/1.3.27 (Darwin) PHP/4.1.2
     39 Content-Type: text/html; charset=iso-8859-1
     40 Content-Length: 23
     41 
     42 This IS the real page!
     43 </data1001>
     44 
     45 #
     46 # This is the second request, and this sends back a response saying that
     47 # the request contained stale data. We want an update. Set swsbounce to
     48 # bounce on to data1003 on the second request.
     49 <data1002>
     50 HTTP/1.1 401 Authorization re-negotiation please swsbounce
     51 Server: Apache/1.3.27 (Darwin) PHP/4.1.2
     52 WWW-Authenticate: Digest realm="testrealm", algorithm=MD5, nonce="999999", stale=true, qop="auth"
     53 Content-Type: text/html; charset=iso-8859-1
     54 Content-Length: 26
     55 
     56 This is not the real page
     57 </data1002>
     58 
     59 # The second request to the 1002 section will bounce this one back instead
     60 # thanks to the swsbounce keyword up there
     61 <data1003>
     62 HTTP/1.1 200 OK
     63 Server: Apache/1.3.27 (Darwin) PHP/4.1.2
     64 Content-Type: text/html; charset=iso-8859-1
     65 Content-Length: 30
     66 
     67 This IS the second real page!
     68 </data1003>
     69 </reply>
     70 
     71 # Client-side
     72 <client>
     73 <server>
     74 http
     75 </server>
     76 <features>
     77 !SSPI
     78 crypto
     79 digest
     80 </features>
     81 <name>
     82 HTTP with Digest authorization with stale=true
     83 </name>
     84 <command>
     85 http://%HOSTIP:%HTTPPORT/%TESTNUMBER0001 -u testuser:testpass --digest http://%HOSTIP:%HTTPPORT/%TESTNUMBER0002
     86 </command>
     87 </client>
     88 
     89 # Verify data after the test has been "shot"
     90 <verify>
     91 <strip>
     92 ^Authorization.*cnonce
     93 </strip>
     94 <protocol>
     95 GET /%TESTNUMBER0001 HTTP/1.1
     96 Host: %HOSTIP:%HTTPPORT
     97 User-Agent: curl/%VERSION
     98 Accept: */*
     99 
    100 GET /%TESTNUMBER0001 HTTP/1.1
    101 Host: %HOSTIP:%HTTPPORT
    102 Authorization: Digest username="testuser", realm="testrealm", nonce="1053604145", uri="/%TESTNUMBER0001", response="f4f83139396995bac665f24a1f1055c7"
    103 User-Agent: curl/%VERSION
    104 Accept: */*
    105 
    106 GET /%TESTNUMBER0002 HTTP/1.1
    107 Host: %HOSTIP:%HTTPPORT
    108 User-Agent: curl/%VERSION
    109 Accept: */*
    110 
    111 GET /%TESTNUMBER0002 HTTP/1.1
    112 Host: %HOSTIP:%HTTPPORT
    113 Authorization: Digest username="testuser", realm="testrealm", nonce="1053604145", uri="/%TESTNUMBER0002", response="f84511b014fdd0ba6494f42871079c32"
    114 User-Agent: curl/%VERSION
    115 Accept: */*
    116 
    117 GET /%TESTNUMBER0002 HTTP/1.1
    118 Host: %HOSTIP:%HTTPPORT
    119 Authorization: Digest username="testuser", realm="testrealm", nonce="999999", uri="/%TESTNUMBER0002", cnonce="MTA4MzIy", nc="00000001", qop="auth", response="25291c357671604a16c0242f56721c07", algorithm=MD5
    120 User-Agent: curl/%VERSION
    121 Accept: */*
    122 
    123 </protocol>
    124 <stdout>
    125 HTTP/1.1 401 Authorization Required swsclose
    126 Server: Apache/1.3.27 (Darwin) PHP/4.1.2
    127 WWW-Authenticate: Digest realm="testrealm", nonce="1053604145"
    128 Content-Type: text/html; charset=iso-8859-1
    129 Content-Length: 26
    130 
    131 HTTP/1.1 200 OK
    132 Server: Apache/1.3.27 (Darwin) PHP/4.1.2
    133 Content-Type: text/html; charset=iso-8859-1
    134 Content-Length: 23
    135 
    136 This IS the real page!
    137 HTTP/1.1 401 Authorization Required swsclose
    138 Server: Apache/1.3.27 (Darwin) PHP/4.1.2
    139 WWW-Authenticate: Digest realm="testrealm", nonce="1053604145"
    140 Content-Type: text/html; charset=iso-8859-1
    141 Content-Length: 26
    142 
    143 HTTP/1.1 401 Authorization re-negotiation please swsbounce
    144 Server: Apache/1.3.27 (Darwin) PHP/4.1.2
    145 WWW-Authenticate: Digest realm="testrealm", algorithm=MD5, nonce="999999", stale=true, qop="auth"
    146 Content-Type: text/html; charset=iso-8859-1
    147 Content-Length: 26
    148 
    149 HTTP/1.1 200 OK
    150 Server: Apache/1.3.27 (Darwin) PHP/4.1.2
    151 Content-Type: text/html; charset=iso-8859-1
    152 Content-Length: 30
    153 
    154 This IS the second real page!
    155 </stdout>
    156 </verify>
    157 </testcase>