quickjs-tart

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

test2027 (6093B)


      1 <testcase>
      2 <info>
      3 <keywords>
      4 HTTP
      5 HTTP GET
      6 HTTP Digest auth
      7 </keywords>
      8 </info>
      9 # Server-side
     10 <reply>
     11 
     12 <!--
     13 
     14  Explanation for the duplicate 400 requests:
     15 
     16  libcurl doesn't detect that a given Digest password is wrong already on the
     17  first 401 response (as the data400 gives). libcurl will instead consider the
     18  new response just as a duplicate and it sends another and detects the auth
     19  problem on the second 401 response!
     20 
     21 -->
     22 
     23 <!-- First request has Digest auth, wrong password -->
     24 <data100>
     25 HTTP/1.1 401 Need Digest auth
     26 Server: Microsoft-IIS/5.0
     27 Content-Type: text/html; charset=iso-8859-1
     28 Content-Length: 27
     29 WWW-Authenticate: Digest realm="testrealm", nonce="1"
     30 
     31 This is not the real page!
     32 </data100>
     33 
     34 <data1100>
     35 HTTP/1.1 401 Sorry wrong password
     36 Server: Microsoft-IIS/5.0
     37 Content-Type: text/html; charset=iso-8859-1
     38 Content-Length: 29
     39 WWW-Authenticate: Digest realm="testrealm", nonce="2"
     40 
     41 This is a bad password page!
     42 </data1100>
     43 
     44 <!-- Second request has Digest auth, right password -->
     45 <data200>
     46 HTTP/1.1 401 Need Digest auth (2)
     47 Server: Microsoft-IIS/5.0
     48 Content-Type: text/html; charset=iso-8859-1
     49 Content-Length: 27
     50 WWW-Authenticate: Digest realm="testrealm", nonce="3"
     51 
     52 This is not the real page!
     53 </data200>
     54 
     55 <data1200>
     56 HTTP/1.1 200 Things are fine in server land
     57 Server: Microsoft-IIS/5.0
     58 Content-Type: text/html; charset=iso-8859-1
     59 Content-Length: 32
     60 
     61 Finally, this is the real page!
     62 </data1200>
     63 
     64 <!-- Third request has Digest auth, wrong password -->
     65 <data300>
     66 HTTP/1.1 401 Need Digest auth (3)
     67 Server: Microsoft-IIS/5.0
     68 Content-Type: text/html; charset=iso-8859-1
     69 Content-Length: 27
     70 WWW-Authenticate: Digest realm="testrealm", nonce="4"
     71 
     72 This is not the real page!
     73 </data300>
     74 
     75 <data1300>
     76 HTTP/1.1 401 Sorry wrong password (2)
     77 Server: Microsoft-IIS/5.0
     78 Content-Type: text/html; charset=iso-8859-1
     79 Content-Length: 29
     80 WWW-Authenticate: Digest realm="testrealm", nonce="5"
     81 
     82 This is a bad password page!
     83 </data1300>
     84 
     85 <!-- Fourth request has Digest auth, wrong password -->
     86 <data400>
     87 HTTP/1.1 401 Need Digest auth (4)
     88 Server: Microsoft-IIS/5.0
     89 Content-Type: text/html; charset=iso-8859-1
     90 Content-Length: 27
     91 WWW-Authenticate: Digest realm="testrealm", nonce="6"
     92 
     93 This is not the real page!
     94 </data400>
     95 
     96 <data1400>
     97 HTTP/1.1 401 Sorry wrong password (3)
     98 Server: Microsoft-IIS/5.0
     99 Content-Type: text/html; charset=iso-8859-1
    100 Content-Length: 29
    101 WWW-Authenticate: Digest realm="testrealm", nonce="7"
    102 
    103 This is a bad password page!
    104 </data1400>
    105 
    106 <!-- Fifth request has Digest auth, right password -->
    107 <data1500>
    108 HTTP/1.1 200 Things are fine in server land (2)
    109 Server: Microsoft-IIS/5.0
    110 Content-Type: text/html; charset=iso-8859-1
    111 Content-Length: 32
    112 
    113 Finally, this is the real page!
    114 </data1500>
    115 
    116 <datacheck>
    117 HTTP/1.1 401 Need Digest auth
    118 Server: Microsoft-IIS/5.0
    119 Content-Type: text/html; charset=iso-8859-1
    120 Content-Length: 27
    121 WWW-Authenticate: Digest realm="testrealm", nonce="1"
    122 
    123 HTTP/1.1 401 Sorry wrong password
    124 Server: Microsoft-IIS/5.0
    125 Content-Type: text/html; charset=iso-8859-1
    126 Content-Length: 29
    127 WWW-Authenticate: Digest realm="testrealm", nonce="2"
    128 
    129 This is a bad password page!
    130 HTTP/1.1 200 Things are fine in server land
    131 Server: Microsoft-IIS/5.0
    132 Content-Type: text/html; charset=iso-8859-1
    133 Content-Length: 32
    134 
    135 Finally, this is the real page!
    136 HTTP/1.1 401 Need Digest auth (3)
    137 Server: Microsoft-IIS/5.0
    138 Content-Type: text/html; charset=iso-8859-1
    139 Content-Length: 27
    140 WWW-Authenticate: Digest realm="testrealm", nonce="4"
    141 
    142 HTTP/1.1 401 Sorry wrong password (2)
    143 Server: Microsoft-IIS/5.0
    144 Content-Type: text/html; charset=iso-8859-1
    145 Content-Length: 29
    146 WWW-Authenticate: Digest realm="testrealm", nonce="5"
    147 
    148 This is a bad password page!
    149 HTTP/1.1 401 Sorry wrong password (3)
    150 Server: Microsoft-IIS/5.0
    151 Content-Type: text/html; charset=iso-8859-1
    152 Content-Length: 29
    153 WWW-Authenticate: Digest realm="testrealm", nonce="7"
    154 
    155 HTTP/1.1 401 Sorry wrong password (3)
    156 Server: Microsoft-IIS/5.0
    157 Content-Type: text/html; charset=iso-8859-1
    158 Content-Length: 29
    159 WWW-Authenticate: Digest realm="testrealm", nonce="7"
    160 
    161 This is a bad password page!
    162 HTTP/1.1 200 Things are fine in server land (2)
    163 Server: Microsoft-IIS/5.0
    164 Content-Type: text/html; charset=iso-8859-1
    165 Content-Length: 32
    166 
    167 Finally, this is the real page!
    168 </datacheck>
    169 
    170 </reply>
    171 
    172 # Client-side
    173 <client>
    174 <server>
    175 http
    176 </server>
    177 <features>
    178 !SSPI
    179 crypto
    180 digest
    181 </features>
    182 <tool>
    183 lib2023
    184 </tool>
    185 
    186 <name>
    187 HTTP authorization retry (Digest)
    188 </name>
    189 <command>
    190 http://%HOSTIP:%HTTPPORT/%TESTNUMBER digest digest
    191 </command>
    192 </client>
    193 
    194 # Verify data after the test has been "shot"
    195 <verify>
    196 <protocol>
    197 GET /%TESTNUMBER0100 HTTP/1.1
    198 Host: %HOSTIP:%HTTPPORT
    199 Accept: */*
    200 
    201 GET /%TESTNUMBER0100 HTTP/1.1
    202 Host: %HOSTIP:%HTTPPORT
    203 Authorization: Digest username="testuser", realm="testrealm", nonce="1", uri="/%TESTNUMBER0100", response="f7fd60eefaff5225971bf9b3d80d6ba6"
    204 Accept: */*
    205 
    206 GET /%TESTNUMBER0200 HTTP/1.1
    207 Host: %HOSTIP:%HTTPPORT
    208 Authorization: Digest username="testuser", realm="testrealm", nonce="2", uri="/%TESTNUMBER0200", response="785ca3ef511999f7e9c178195f5b388c"
    209 Accept: */*
    210 
    211 GET /%TESTNUMBER0300 HTTP/1.1
    212 Host: %HOSTIP:%HTTPPORT
    213 Accept: */*
    214 
    215 GET /%TESTNUMBER0300 HTTP/1.1
    216 Host: %HOSTIP:%HTTPPORT
    217 Authorization: Digest username="testuser", realm="testrealm", nonce="4", uri="/%TESTNUMBER0300", response="4c735d2360fd6848e7cb32a11ae3612b"
    218 Accept: */*
    219 
    220 GET /%TESTNUMBER0400 HTTP/1.1
    221 Host: %HOSTIP:%HTTPPORT
    222 Authorization: Digest username="testuser", realm="testrealm", nonce="5", uri="/%TESTNUMBER0400", response="f5906785511fb60a2af8b1cd53008ead"
    223 Accept: */*
    224 
    225 GET /%TESTNUMBER0400 HTTP/1.1
    226 Host: %HOSTIP:%HTTPPORT
    227 Authorization: Digest username="testuser", realm="testrealm", nonce="5", uri="/%TESTNUMBER0400", response="f5906785511fb60a2af8b1cd53008ead"
    228 Accept: */*
    229 
    230 GET /%TESTNUMBER0500 HTTP/1.1
    231 Host: %HOSTIP:%HTTPPORT
    232 Authorization: Digest username="testuser", realm="testrealm", nonce="7", uri="/%TESTNUMBER0500", response="8ef4d935fd964a46c3965c0863b52cf1"
    233 Accept: */*
    234 
    235 </protocol>
    236 </verify>
    237 </testcase>