quickjs-tart

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

test2024 (4157B)


      1 <testcase>
      2 <info>
      3 <keywords>
      4 HTTP
      5 HTTP GET
      6 HTTP Basic auth
      7 HTTP Digest auth
      8 </keywords>
      9 </info>
     10 # Server-side
     11 <reply>
     12 
     13 <!-- Alternate the order that Basic and Digest headers appear in responses to
     14 ensure that the order doesn't matter. -->
     15 
     16 <!-- First request has Basic auth, wrong password -->
     17 <data100>
     18 HTTP/1.1 401 Sorry wrong password
     19 Server: Microsoft-IIS/5.0
     20 Content-Type: text/html; charset=iso-8859-1
     21 Content-Length: 29
     22 WWW-Authenticate: Digest realm="testrealm", nonce="1"
     23 WWW-Authenticate: Basic realm="testrealm"
     24 
     25 This is a bad password page!
     26 </data100>
     27 
     28 <!-- Second request has Digest auth, right password -->
     29 <data1200>
     30 HTTP/1.1 200 Things are fine in server land
     31 Server: Microsoft-IIS/5.0
     32 Content-Type: text/html; charset=iso-8859-1
     33 Content-Length: 32
     34 
     35 Finally, this is the real page!
     36 </data1200>
     37 
     38 <!-- Third request has Basic auth, wrong password -->
     39 <data300>
     40 HTTP/1.1 401 Sorry wrong password (2)
     41 Server: Microsoft-IIS/5.0
     42 Content-Type: text/html; charset=iso-8859-1
     43 Content-Length: 29
     44 WWW-Authenticate: Digest realm="testrealm", nonce="2"
     45 WWW-Authenticate: Basic realm="testrealm"
     46 
     47 This is a bad password page!
     48 </data300>
     49 
     50 <!-- Fourth request has Digest auth, wrong password -->
     51 <data1400>
     52 HTTP/1.1 401 Sorry wrong password (3)
     53 Server: Microsoft-IIS/5.0
     54 Content-Type: text/html; charset=iso-8859-1
     55 Content-Length: 29
     56 WWW-Authenticate: Digest realm="testrealm", nonce="3"
     57 WWW-Authenticate: Basic realm="testrealm"
     58 
     59 This is a bad password page!
     60 </data1400>
     61 
     62 <!-- Fifth request has Digest auth, right password -->
     63 <data1500>
     64 HTTP/1.1 200 Things are fine in server land (2)
     65 Server: Microsoft-IIS/5.0
     66 Content-Type: text/html; charset=iso-8859-1
     67 Content-Length: 32
     68 
     69 Finally, this is the real page!
     70 </data1500>
     71 
     72 <datacheck>
     73 HTTP/1.1 401 Sorry wrong password
     74 Server: Microsoft-IIS/5.0
     75 Content-Type: text/html; charset=iso-8859-1
     76 Content-Length: 29
     77 WWW-Authenticate: Digest realm="testrealm", nonce="1"
     78 WWW-Authenticate: Basic realm="testrealm"
     79 
     80 This is a bad password page!
     81 HTTP/1.1 200 Things are fine in server land
     82 Server: Microsoft-IIS/5.0
     83 Content-Type: text/html; charset=iso-8859-1
     84 Content-Length: 32
     85 
     86 Finally, this is the real page!
     87 HTTP/1.1 401 Sorry wrong password (2)
     88 Server: Microsoft-IIS/5.0
     89 Content-Type: text/html; charset=iso-8859-1
     90 Content-Length: 29
     91 WWW-Authenticate: Digest realm="testrealm", nonce="2"
     92 WWW-Authenticate: Basic realm="testrealm"
     93 
     94 This is a bad password page!
     95 HTTP/1.1 401 Sorry wrong password (3)
     96 Server: Microsoft-IIS/5.0
     97 Content-Type: text/html; charset=iso-8859-1
     98 Content-Length: 29
     99 WWW-Authenticate: Digest realm="testrealm", nonce="3"
    100 WWW-Authenticate: Basic realm="testrealm"
    101 
    102 This is a bad password page!
    103 HTTP/1.1 200 Things are fine in server land (2)
    104 Server: Microsoft-IIS/5.0
    105 Content-Type: text/html; charset=iso-8859-1
    106 Content-Length: 32
    107 
    108 Finally, this is the real page!
    109 </datacheck>
    110 
    111 </reply>
    112 
    113 # Client-side
    114 <client>
    115 <server>
    116 http
    117 </server>
    118 <features>
    119 !SSPI
    120 crypto
    121 digest
    122 </features>
    123 <tool>
    124 lib2023
    125 </tool>
    126 
    127 <name>
    128 HTTP authorization retry (Basic switching to Digest)
    129 </name>
    130 <command>
    131 http://%HOSTIP:%HTTPPORT/%TESTNUMBER basic digest
    132 </command>
    133 </client>
    134 
    135 # Verify data after the test has been "shot"
    136 <verify>
    137 <protocol>
    138 GET /%TESTNUMBER0100 HTTP/1.1
    139 Host: %HOSTIP:%HTTPPORT
    140 Authorization: Basic %b64[testuser:wrongpass]b64%
    141 Accept: */*
    142 
    143 GET /%TESTNUMBER0200 HTTP/1.1
    144 Host: %HOSTIP:%HTTPPORT
    145 Authorization: Digest username="testuser", realm="testrealm", nonce="1", uri="/%TESTNUMBER0200", response="ed646c565f79e2dd9fa37cb5a621213c"
    146 Accept: */*
    147 
    148 GET /%TESTNUMBER0300 HTTP/1.1
    149 Host: %HOSTIP:%HTTPPORT
    150 Authorization: Basic %b64[testuser:wrongpass]b64%
    151 Accept: */*
    152 
    153 GET /%TESTNUMBER0400 HTTP/1.1
    154 Host: %HOSTIP:%HTTPPORT
    155 Authorization: Digest username="testuser", realm="testrealm", nonce="2", uri="/%TESTNUMBER0400", response="9741ced8caacc6124770187b36f007c5"
    156 Accept: */*
    157 
    158 GET /%TESTNUMBER0500 HTTP/1.1
    159 Host: %HOSTIP:%HTTPPORT
    160 Authorization: Digest username="testuser", realm="testrealm", nonce="3", uri="/%TESTNUMBER0500", response="5bc77ec8c2d443b27a1b55f1fd8fbb13"
    161 Accept: */*
    162 
    163 </protocol>
    164 </verify>
    165 </testcase>