xf.li | 6c8fc1e | 2023-08-12 00:11:09 -0700 | [diff] [blame^] | 1 | <testcase> |
| 2 | <info> |
| 3 | <keywords> |
| 4 | HTTP |
| 5 | HTTP PUT |
| 6 | HTTP Digest auth |
| 7 | --anyauth |
| 8 | </keywords> |
| 9 | </info> |
| 10 | |
| 11 | # Server-side |
| 12 | <reply> |
| 13 | <servercmd> |
| 14 | auth_required |
| 15 | </servercmd> |
| 16 | <data> |
| 17 | HTTP/1.1 401 Authorization Required swsclose
|
| 18 | Server: Apache/1.3.27 (Darwin) PHP/4.1.2
|
| 19 | WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
|
| 20 | WWW-Authenticate: Basic realm="gimme all yer s3cr3ts"
|
| 21 | WWW-Authenticate: Digest realm="gimme all yer s3cr3ts", nonce="11223344"
|
| 22 | Content-Type: text/html; charset=iso-8859-1
|
| 23 | Connection: close
|
| 24 |
|
| 25 | This is not the real page |
| 26 | </data> |
| 27 | |
| 28 | # This is supposed to be returned when the server gets a |
| 29 | # Authorization: Digest line passed-in from the client |
| 30 | <data1000> |
| 31 | HTTP/1.1 200 OK swsclose
|
| 32 | Server: Apache/1.3.27 (Darwin) PHP/4.1.2
|
| 33 | Content-Type: text/html; charset=iso-8859-1
|
| 34 | Content-Length: 23
|
| 35 | Connection: close
|
| 36 |
|
| 37 | This IS the real page! |
| 38 | </data1000> |
| 39 | |
| 40 | <datacheck> |
| 41 | HTTP/1.1 401 Authorization Required swsclose
|
| 42 | Server: Apache/1.3.27 (Darwin) PHP/4.1.2
|
| 43 | WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
|
| 44 | WWW-Authenticate: Basic realm="gimme all yer s3cr3ts"
|
| 45 | WWW-Authenticate: Digest realm="gimme all yer s3cr3ts", nonce="11223344"
|
| 46 | Content-Type: text/html; charset=iso-8859-1
|
| 47 | Connection: close
|
| 48 |
|
| 49 | HTTP/1.1 200 OK swsclose
|
| 50 | Server: Apache/1.3.27 (Darwin) PHP/4.1.2
|
| 51 | Content-Type: text/html; charset=iso-8859-1
|
| 52 | Content-Length: 23
|
| 53 | Connection: close
|
| 54 |
|
| 55 | This IS the real page! |
| 56 | </datacheck> |
| 57 | |
| 58 | </reply> |
| 59 | |
| 60 | # Client-side |
| 61 | <client> |
| 62 | <server> |
| 63 | http |
| 64 | </server> |
| 65 | <features> |
| 66 | !SSPI |
| 67 | crypto |
| 68 | </features> |
| 69 | <name> |
| 70 | HTTP PUT with --anyauth authorization (picking Digest) |
| 71 | </name> |
| 72 | <command> |
| 73 | http://%HOSTIP:%HTTPPORT/%TESTNUMBER -T log/put%TESTNUMBER -u testuser:testpass --anyauth |
| 74 | </command> |
| 75 | <file name="log/put%TESTNUMBER"> |
| 76 | This is data we upload with PUT |
| 77 | a second line |
| 78 | line three |
| 79 | four is the number of lines |
| 80 | </file> |
| 81 | </client> |
| 82 | |
| 83 | # Verify data after the test has been "shot" |
| 84 | <verify> |
| 85 | <protocol> |
| 86 | PUT /%TESTNUMBER HTTP/1.1
|
| 87 | Host: %HOSTIP:%HTTPPORT
|
| 88 | User-Agent: curl/%VERSION
|
| 89 | Accept: */*
|
| 90 | Content-Length: 85
|
| 91 | Expect: 100-continue
|
| 92 |
|
| 93 | PUT /%TESTNUMBER HTTP/1.1
|
| 94 | Host: %HOSTIP:%HTTPPORT
|
| 95 | Authorization: Digest username="testuser", realm="gimme all yer s3cr3ts", nonce="11223344", uri="/%TESTNUMBER", response="b71551e12d1c456e47d8388ecb2edeca"
|
| 96 | User-Agent: curl/%VERSION
|
| 97 | Accept: */*
|
| 98 | Content-Length: 85
|
| 99 | Expect: 100-continue
|
| 100 |
|
| 101 | This is data we upload with PUT |
| 102 | a second line |
| 103 | line three |
| 104 | four is the number of lines |
| 105 | </protocol> |
| 106 | </verify> |
| 107 | </testcase> |