##// END OF EJS Templates
merge with security patches
Kevin Bullock -
r36898:8bba684e merge 4.5.2 stable
parent child Browse files
Show More
This diff has been collapsed as it changes many lines, (1502 lines changed) Show them Hide them
@@ -0,0 +1,1502 b''
1 #require killdaemons
2
3 $ cat > fakeremoteuser.py << EOF
4 > import os
5 > from mercurial.hgweb import hgweb_mod
6 > from mercurial import wireproto
7 > class testenvhgweb(hgweb_mod.hgweb):
8 > def __call__(self, env, respond):
9 > # Allow REMOTE_USER to define authenticated user.
10 > if r'REMOTE_USER' in os.environ:
11 > env[r'REMOTE_USER'] = os.environ[r'REMOTE_USER']
12 > # Allow REQUEST_METHOD to override HTTP method
13 > if r'REQUEST_METHOD' in os.environ:
14 > env[r'REQUEST_METHOD'] = os.environ[r'REQUEST_METHOD']
15 > return super(testenvhgweb, self).__call__(env, respond)
16 > hgweb_mod.hgweb = testenvhgweb
17 >
18 > @wireproto.wireprotocommand('customreadnoperm')
19 > def customread(repo, proto):
20 > return b'read-only command no defined permissions\n'
21 > @wireproto.wireprotocommand('customwritenoperm')
22 > def customwritenoperm(repo, proto):
23 > return b'write command no defined permissions\n'
24 > wireproto.permissions['customreadwithperm'] = 'pull'
25 > @wireproto.wireprotocommand('customreadwithperm')
26 > def customreadwithperm(repo, proto):
27 > return b'read-only command w/ defined permissions\n'
28 > wireproto.permissions['customwritewithperm'] = 'push'
29 > @wireproto.wireprotocommand('customwritewithperm')
30 > def customwritewithperm(repo, proto):
31 > return b'write command w/ defined permissions\n'
32 > EOF
33
34 $ cat >> $HGRCPATH << EOF
35 > [extensions]
36 > fakeremoteuser = $TESTTMP/fakeremoteuser.py
37 > strip =
38 > EOF
39
40 $ hg init test
41 $ cd test
42 $ echo a > a
43 $ hg ci -Ama
44 adding a
45 $ cd ..
46 $ hg clone test test2
47 updating to branch default
48 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
49 $ cd test2
50 $ echo a >> a
51 $ hg ci -mb
52 $ hg book bm -r 0
53 $ cd ../test
54
55 web.deny_read=* prevents access to wire protocol for all users
56
57 $ cat > .hg/hgrc <<EOF
58 > [web]
59 > deny_read = *
60 > EOF
61
62 $ hg serve -p $HGPORT -d --pid-file hg.pid
63 $ cat hg.pid > $DAEMON_PIDS
64
65 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=capabilities'
66 401 read not authorized
67
68 0
69 read not authorized
70 [1]
71
72 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=stream_out'
73 401 read not authorized
74
75 0
76 read not authorized
77 [1]
78
79 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=listkeys' --requestheader 'x-hgarg-1=namespace=phases'
80 401 read not authorized
81
82 0
83 read not authorized
84 [1]
85
86 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=batch' --requestheader 'x-hgarg-1=cmds=listkeys+namespace%3Dphases'
87 401 read not authorized
88
89 0
90 read not authorized
91 [1]
92
93 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customreadnoperm'
94 401 read not authorized
95
96 0
97 read not authorized
98 [1]
99
100 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customreadwithperm'
101 401 read not authorized
102
103 0
104 read not authorized
105 [1]
106
107 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritenoperm'
108 401 read not authorized
109
110 0
111 read not authorized
112 [1]
113
114 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritewithperm'
115 401 read not authorized
116
117 0
118 read not authorized
119 [1]
120
121 $ hg --cwd ../test2 pull http://localhost:$HGPORT/
122 pulling from http://localhost:$HGPORT/
123 abort: authorization failed
124 [255]
125
126 $ killdaemons.py
127
128 web.deny_read=* with REMOTE_USER set still locks out clients
129
130 $ REMOTE_USER=authed_user hg serve -p $HGPORT -d --pid-file hg.pid
131 $ cat hg.pid > $DAEMON_PIDS
132
133 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=capabilities'
134 401 read not authorized
135
136 0
137 read not authorized
138 [1]
139
140 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=stream_out'
141 401 read not authorized
142
143 0
144 read not authorized
145 [1]
146
147 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=batch' --requestheader 'x-hgarg-1=cmds=listkeys+namespace%3Dphases'
148 401 read not authorized
149
150 0
151 read not authorized
152 [1]
153
154 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customreadnoperm'
155 401 read not authorized
156
157 0
158 read not authorized
159 [1]
160
161 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customreadwithperm'
162 401 read not authorized
163
164 0
165 read not authorized
166 [1]
167
168 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritenoperm'
169 401 read not authorized
170
171 0
172 read not authorized
173 [1]
174
175 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritewithperm'
176 401 read not authorized
177
178 0
179 read not authorized
180 [1]
181
182 $ hg --cwd ../test2 pull http://localhost:$HGPORT/
183 pulling from http://localhost:$HGPORT/
184 abort: authorization failed
185 [255]
186
187 $ killdaemons.py
188
189 web.deny_read=<user> denies access to unauthenticated user
190
191 $ cat > .hg/hgrc <<EOF
192 > [web]
193 > deny_read = baduser1,baduser2
194 > EOF
195
196 $ hg serve -p $HGPORT -d --pid-file hg.pid
197 $ cat hg.pid > $DAEMON_PIDS
198
199 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=listkeys' --requestheader 'x-hgarg-1=namespace=phases'
200 401 read not authorized
201
202 0
203 read not authorized
204 [1]
205
206 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=batch' --requestheader 'x-hgarg-1=cmds=listkeys+namespace%3Dphases'
207 401 read not authorized
208
209 0
210 read not authorized
211 [1]
212
213 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customreadnoperm'
214 401 read not authorized
215
216 0
217 read not authorized
218 [1]
219
220 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customreadwithperm'
221 401 read not authorized
222
223 0
224 read not authorized
225 [1]
226
227 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritenoperm'
228 401 read not authorized
229
230 0
231 read not authorized
232 [1]
233
234 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritewithperm'
235 401 read not authorized
236
237 0
238 read not authorized
239 [1]
240
241 $ hg --cwd ../test2 pull http://localhost:$HGPORT/
242 pulling from http://localhost:$HGPORT/
243 abort: authorization failed
244 [255]
245
246 $ killdaemons.py
247
248 web.deny_read=<user> denies access to users in deny list
249
250 $ REMOTE_USER=baduser2 hg serve -p $HGPORT -d --pid-file hg.pid
251 $ cat hg.pid > $DAEMON_PIDS
252
253 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=listkeys' --requestheader 'x-hgarg-1=namespace=phases'
254 401 read not authorized
255
256 0
257 read not authorized
258 [1]
259
260 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=batch' --requestheader 'x-hgarg-1=cmds=listkeys+namespace%3Dphases'
261 401 read not authorized
262
263 0
264 read not authorized
265 [1]
266
267 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customreadnoperm'
268 401 read not authorized
269
270 0
271 read not authorized
272 [1]
273
274 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customreadwithperm'
275 401 read not authorized
276
277 0
278 read not authorized
279 [1]
280
281 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritenoperm'
282 401 read not authorized
283
284 0
285 read not authorized
286 [1]
287
288 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritewithperm'
289 401 read not authorized
290
291 0
292 read not authorized
293 [1]
294
295 $ hg --cwd ../test2 pull http://localhost:$HGPORT/
296 pulling from http://localhost:$HGPORT/
297 abort: authorization failed
298 [255]
299
300 $ killdaemons.py
301
302 web.deny_read=<user> allows access to authenticated users not in list
303
304 $ REMOTE_USER=gooduser hg serve -p $HGPORT -d --pid-file hg.pid
305 $ cat hg.pid > $DAEMON_PIDS
306
307 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=listkeys' --requestheader 'x-hgarg-1=namespace=phases'
308 200 Script output follows
309
310 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b 1
311 publishing True (no-eol)
312
313 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=batch' --requestheader 'x-hgarg-1=cmds=listkeys+namespace%3Dphases'
314 200 Script output follows
315
316 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b 1
317 publishing True (no-eol)
318
319 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customreadnoperm'
320 405 push requires POST request
321
322 0
323 push requires POST request
324 [1]
325
326 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customreadwithperm'
327 200 Script output follows
328
329 read-only command w/ defined permissions
330
331 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritenoperm'
332 405 push requires POST request
333
334 0
335 push requires POST request
336 [1]
337
338 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritewithperm'
339 405 push requires POST request
340
341 0
342 push requires POST request
343 [1]
344
345 $ hg --cwd ../test2 pull http://localhost:$HGPORT/
346 pulling from http://localhost:$HGPORT/
347 searching for changes
348 no changes found
349
350 $ killdaemons.py
351
352 web.allow_read=* allows reads for unauthenticated users
353
354 $ cat > .hg/hgrc <<EOF
355 > [web]
356 > allow_read = *
357 > EOF
358
359 $ hg serve -p $HGPORT -d --pid-file hg.pid
360 $ cat hg.pid > $DAEMON_PIDS
361
362 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=listkeys' --requestheader 'x-hgarg-1=namespace=phases'
363 200 Script output follows
364
365 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b 1
366 publishing True (no-eol)
367
368 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=batch' --requestheader 'x-hgarg-1=cmds=listkeys+namespace%3Dphases'
369 200 Script output follows
370
371 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b 1
372 publishing True (no-eol)
373
374 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customreadnoperm'
375 405 push requires POST request
376
377 0
378 push requires POST request
379 [1]
380
381 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customreadwithperm'
382 200 Script output follows
383
384 read-only command w/ defined permissions
385
386 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritenoperm'
387 405 push requires POST request
388
389 0
390 push requires POST request
391 [1]
392
393 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritewithperm'
394 405 push requires POST request
395
396 0
397 push requires POST request
398 [1]
399
400 $ hg --cwd ../test2 pull http://localhost:$HGPORT/
401 pulling from http://localhost:$HGPORT/
402 searching for changes
403 no changes found
404
405 $ killdaemons.py
406
407 web.allow_read=* allows read for authenticated user
408
409 $ REMOTE_USER=authed_user hg serve -p $HGPORT -d --pid-file hg.pid
410 $ cat hg.pid > $DAEMON_PIDS
411
412 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=listkeys' --requestheader 'x-hgarg-1=namespace=phases'
413 200 Script output follows
414
415 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b 1
416 publishing True (no-eol)
417
418 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=batch' --requestheader 'x-hgarg-1=cmds=listkeys+namespace%3Dphases'
419 200 Script output follows
420
421 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b 1
422 publishing True (no-eol)
423
424 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customreadnoperm'
425 405 push requires POST request
426
427 0
428 push requires POST request
429 [1]
430
431 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customreadwithperm'
432 200 Script output follows
433
434 read-only command w/ defined permissions
435
436 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritenoperm'
437 405 push requires POST request
438
439 0
440 push requires POST request
441 [1]
442
443 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritewithperm'
444 405 push requires POST request
445
446 0
447 push requires POST request
448 [1]
449
450 $ hg --cwd ../test2 pull http://localhost:$HGPORT/
451 pulling from http://localhost:$HGPORT/
452 searching for changes
453 no changes found
454
455 $ killdaemons.py
456
457 web.allow_read=<user> does not allow unauthenticated users to read
458
459 $ cat > .hg/hgrc <<EOF
460 > [web]
461 > allow_read = gooduser
462 > EOF
463
464 $ hg serve -p $HGPORT -d --pid-file hg.pid
465 $ cat hg.pid > $DAEMON_PIDS
466
467 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=listkeys' --requestheader 'x-hgarg-1=namespace=phases'
468 401 read not authorized
469
470 0
471 read not authorized
472 [1]
473
474 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=batch' --requestheader 'x-hgarg-1=cmds=listkeys+namespace%3Dphases'
475 401 read not authorized
476
477 0
478 read not authorized
479 [1]
480
481 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customreadnoperm'
482 401 read not authorized
483
484 0
485 read not authorized
486 [1]
487
488 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customreadwithperm'
489 401 read not authorized
490
491 0
492 read not authorized
493 [1]
494
495 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritenoperm'
496 401 read not authorized
497
498 0
499 read not authorized
500 [1]
501
502 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritewithperm'
503 401 read not authorized
504
505 0
506 read not authorized
507 [1]
508
509 $ hg --cwd ../test2 pull http://localhost:$HGPORT/
510 pulling from http://localhost:$HGPORT/
511 abort: authorization failed
512 [255]
513
514 $ killdaemons.py
515
516 web.allow_read=<user> does not allow user not in list to read
517
518 $ REMOTE_USER=baduser hg serve -p $HGPORT -d --pid-file hg.pid
519 $ cat hg.pid > $DAEMON_PIDS
520
521 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=listkeys' --requestheader 'x-hgarg-1=namespace=phases'
522 401 read not authorized
523
524 0
525 read not authorized
526 [1]
527
528 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=batch' --requestheader 'x-hgarg-1=cmds=listkeys+namespace%3Dphases'
529 401 read not authorized
530
531 0
532 read not authorized
533 [1]
534
535 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customreadnoperm'
536 401 read not authorized
537
538 0
539 read not authorized
540 [1]
541
542 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customreadwithperm'
543 401 read not authorized
544
545 0
546 read not authorized
547 [1]
548
549 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritenoperm'
550 401 read not authorized
551
552 0
553 read not authorized
554 [1]
555
556 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritewithperm'
557 401 read not authorized
558
559 0
560 read not authorized
561 [1]
562
563 $ hg --cwd ../test2 pull http://localhost:$HGPORT/
564 pulling from http://localhost:$HGPORT/
565 abort: authorization failed
566 [255]
567
568 $ killdaemons.py
569
570 web.allow_read=<user> allows read from user in list
571
572 $ REMOTE_USER=gooduser hg serve -p $HGPORT -d --pid-file hg.pid
573 $ cat hg.pid > $DAEMON_PIDS
574
575 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=listkeys' --requestheader 'x-hgarg-1=namespace=phases'
576 200 Script output follows
577
578 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b 1
579 publishing True (no-eol)
580
581 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=batch' --requestheader 'x-hgarg-1=cmds=listkeys+namespace%3Dphases'
582 200 Script output follows
583
584 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b 1
585 publishing True (no-eol)
586
587 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customreadnoperm'
588 405 push requires POST request
589
590 0
591 push requires POST request
592 [1]
593
594 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customreadwithperm'
595 200 Script output follows
596
597 read-only command w/ defined permissions
598
599 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritenoperm'
600 405 push requires POST request
601
602 0
603 push requires POST request
604 [1]
605
606 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritewithperm'
607 405 push requires POST request
608
609 0
610 push requires POST request
611 [1]
612
613 $ hg --cwd ../test2 pull http://localhost:$HGPORT/
614 pulling from http://localhost:$HGPORT/
615 searching for changes
616 no changes found
617
618 $ killdaemons.py
619
620 web.deny_read takes precedence over web.allow_read
621
622 $ cat > .hg/hgrc <<EOF
623 > [web]
624 > allow_read = baduser
625 > deny_read = baduser
626 > EOF
627
628 $ REMOTE_USER=baduser hg serve -p $HGPORT -d --pid-file hg.pid
629 $ cat hg.pid > $DAEMON_PIDS
630
631 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=listkeys' --requestheader 'x-hgarg-1=namespace=phases'
632 401 read not authorized
633
634 0
635 read not authorized
636 [1]
637
638 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=batch' --requestheader 'x-hgarg-1=cmds=listkeys+namespace%3Dphases'
639 401 read not authorized
640
641 0
642 read not authorized
643 [1]
644
645 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customreadnoperm'
646 401 read not authorized
647
648 0
649 read not authorized
650 [1]
651
652 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customreadwithperm'
653 401 read not authorized
654
655 0
656 read not authorized
657 [1]
658
659 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritenoperm'
660 401 read not authorized
661
662 0
663 read not authorized
664 [1]
665
666 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritewithperm'
667 401 read not authorized
668
669 0
670 read not authorized
671 [1]
672
673 $ hg --cwd ../test2 pull http://localhost:$HGPORT/
674 pulling from http://localhost:$HGPORT/
675 abort: authorization failed
676 [255]
677
678 $ killdaemons.py
679
680 web.allow-pull=false denies read access to repo
681
682 $ cat > .hg/hgrc <<EOF
683 > [web]
684 > allow-pull = false
685 > EOF
686
687 $ hg serve -p $HGPORT -d --pid-file hg.pid
688 $ cat hg.pid > $DAEMON_PIDS
689
690 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=capabilities'
691 401 pull not authorized
692
693 0
694 pull not authorized
695 [1]
696
697 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=listkeys' --requestheader 'x-hgarg-1=namespace=phases'
698 401 pull not authorized
699
700 0
701 pull not authorized
702 [1]
703
704 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=batch' --requestheader 'x-hgarg-1=cmds=listkeys+namespace%3Dphases'
705 401 pull not authorized
706
707 0
708 pull not authorized
709 [1]
710
711 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customreadnoperm'
712 405 push requires POST request
713
714 0
715 push requires POST request
716 [1]
717
718 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customreadwithperm'
719 401 pull not authorized
720
721 0
722 pull not authorized
723 [1]
724
725 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritenoperm'
726 405 push requires POST request
727
728 0
729 push requires POST request
730 [1]
731
732 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritewithperm'
733 405 push requires POST request
734
735 0
736 push requires POST request
737 [1]
738
739 $ hg --cwd ../test2 pull http://localhost:$HGPORT/
740 pulling from http://localhost:$HGPORT/
741 abort: authorization failed
742 [255]
743
744 $ killdaemons.py
745
746 Attempting a write command with HTTP GET fails
747
748 $ cat > .hg/hgrc <<EOF
749 > EOF
750
751 $ REQUEST_METHOD=GET hg serve -p $HGPORT -d --pid-file hg.pid
752 $ cat hg.pid > $DAEMON_PIDS
753
754 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=pushkey' --requestheader 'x-hgarg-1=namespace=bookmarks&key=bm&old=&new=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b'
755 405 push requires POST request
756
757 0
758 push requires POST request
759 [1]
760
761 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=batch' --requestheader 'x-hgarg-1=cmds=pushkey+namespace%3Dbookmarks%2Ckey%3Dbm%2Cold%3D%2Cnew%3Dcb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b'
762 405 push requires POST request
763
764 0
765 push requires POST request
766 [1]
767
768 $ hg bookmarks
769 no bookmarks set
770 $ hg bookmark -d bm
771 abort: bookmark 'bm' does not exist
772 [255]
773
774 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritenoperm'
775 405 push requires POST request
776
777 0
778 push requires POST request
779 [1]
780
781 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritewithperm'
782 405 push requires POST request
783
784 0
785 push requires POST request
786 [1]
787
788 $ killdaemons.py
789
790 Attempting a write command with an unknown HTTP verb fails
791
792 $ REQUEST_METHOD=someverb hg serve -p $HGPORT -d --pid-file hg.pid
793 $ cat hg.pid > $DAEMON_PIDS
794
795 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=pushkey' --requestheader 'x-hgarg-1=namespace=bookmarks&key=bm&old=&new=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b'
796 405 push requires POST request
797
798 0
799 push requires POST request
800 [1]
801
802 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=batch' --requestheader 'x-hgarg-1=cmds=pushkey+namespace%3Dbookmarks%2Ckey%3Dbm%2Cold%3D%2Cnew%3Dcb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b'
803 405 push requires POST request
804
805 0
806 push requires POST request
807 [1]
808
809 $ hg bookmarks
810 no bookmarks set
811 $ hg bookmark -d bm
812 abort: bookmark 'bm' does not exist
813 [255]
814
815 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritenoperm'
816 405 push requires POST request
817
818 0
819 push requires POST request
820 [1]
821
822 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritewithperm'
823 405 push requires POST request
824
825 0
826 push requires POST request
827 [1]
828
829 $ killdaemons.py
830
831 Pushing on a plaintext channel is disabled by default
832
833 $ cat > .hg/hgrc <<EOF
834 > EOF
835
836 $ REQUEST_METHOD=POST hg serve -p $HGPORT -d --pid-file hg.pid
837 $ cat hg.pid > $DAEMON_PIDS
838
839 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=pushkey' --requestheader 'x-hgarg-1=namespace=bookmarks&key=bm&old=&new=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b'
840 403 ssl required
841
842 0
843 ssl required
844 [1]
845
846 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=batch' --requestheader 'x-hgarg-1=cmds=pushkey+namespace%3Dbookmarks%2Ckey%3Dbm%2Cold%3D%2Cnew%3Dcb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b'
847 403 ssl required
848
849 0
850 ssl required
851 [1]
852
853 $ hg bookmarks
854 no bookmarks set
855
856 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritenoperm'
857 403 ssl required
858
859 0
860 ssl required
861 [1]
862
863 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritewithperm'
864 403 ssl required
865
866 0
867 ssl required
868 [1]
869
870 Reset server to remove REQUEST_METHOD hack to test hg client
871
872 $ killdaemons.py
873 $ hg serve -p $HGPORT -d --pid-file hg.pid
874 $ cat hg.pid > $DAEMON_PIDS
875
876 $ hg --cwd ../test2 push -B bm http://localhost:$HGPORT/
877 pushing to http://localhost:$HGPORT/
878 searching for changes
879 no changes found
880 abort: HTTP Error 403: ssl required
881 [255]
882
883 $ hg --cwd ../test2 push http://localhost:$HGPORT/
884 pushing to http://localhost:$HGPORT/
885 searching for changes
886 abort: HTTP Error 403: ssl required
887 [255]
888
889 $ killdaemons.py
890
891 web.deny_push=* denies pushing to unauthenticated users
892
893 $ cat > .hg/hgrc <<EOF
894 > [web]
895 > push_ssl = false
896 > deny_push = *
897 > EOF
898
899 $ REQUEST_METHOD=POST hg serve -p $HGPORT -d --pid-file hg.pid
900 $ cat hg.pid > $DAEMON_PIDS
901
902 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=pushkey' --requestheader 'x-hgarg-1=namespace=bookmarks&key=bm&old=&new=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b'
903 401 push not authorized
904
905 0
906 push not authorized
907 [1]
908
909 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=batch' --requestheader 'x-hgarg-1=cmds=pushkey+namespace%3Dbookmarks%2Ckey%3Dbm%2Cold%3D%2Cnew%3Dcb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b'
910 401 push not authorized
911
912 0
913 push not authorized
914 [1]
915
916 $ hg bookmarks
917 no bookmarks set
918
919 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritenoperm'
920 401 push not authorized
921
922 0
923 push not authorized
924 [1]
925
926 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritewithperm'
927 401 push not authorized
928
929 0
930 push not authorized
931 [1]
932
933 Reset server to remove REQUEST_METHOD hack to test hg client
934
935 $ killdaemons.py
936 $ hg serve -p $HGPORT -d --pid-file hg.pid
937 $ cat hg.pid > $DAEMON_PIDS
938
939 $ hg --cwd ../test2 push -B bm http://localhost:$HGPORT/
940 pushing to http://localhost:$HGPORT/
941 searching for changes
942 no changes found
943 abort: authorization failed
944 [255]
945
946 $ hg --cwd ../test2 push http://localhost:$HGPORT/
947 pushing to http://localhost:$HGPORT/
948 searching for changes
949 abort: authorization failed
950 [255]
951
952 $ killdaemons.py
953
954 web.deny_push=* denies pushing to authenticated users
955
956 $ REMOTE_USER=someuser REQUEST_METHOD=POST hg serve -p $HGPORT -d --pid-file hg.pid
957 $ cat hg.pid > $DAEMON_PIDS
958
959 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=pushkey' --requestheader 'x-hgarg-1=namespace=bookmarks&key=bm&old=&new=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b'
960 401 push not authorized
961
962 0
963 push not authorized
964 [1]
965
966 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=batch' --requestheader 'x-hgarg-1=cmds=pushkey+namespace%3Dbookmarks%2Ckey%3Dbm%2Cold%3D%2Cnew%3Dcb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b'
967 401 push not authorized
968
969 0
970 push not authorized
971 [1]
972
973 $ hg bookmarks
974 no bookmarks set
975
976 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritenoperm'
977 401 push not authorized
978
979 0
980 push not authorized
981 [1]
982
983 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritewithperm'
984 401 push not authorized
985
986 0
987 push not authorized
988 [1]
989
990 Reset server to remove REQUEST_METHOD hack to test hg client
991
992 $ killdaemons.py
993 $ REMOTE_USER=someuser hg serve -p $HGPORT -d --pid-file hg.pid
994 $ cat hg.pid > $DAEMON_PIDS
995
996 $ hg --cwd ../test2 push -B bm http://localhost:$HGPORT/
997 pushing to http://localhost:$HGPORT/
998 searching for changes
999 no changes found
1000 abort: authorization failed
1001 [255]
1002
1003 $ hg --cwd ../test2 push http://localhost:$HGPORT/
1004 pushing to http://localhost:$HGPORT/
1005 searching for changes
1006 abort: authorization failed
1007 [255]
1008
1009 $ killdaemons.py
1010
1011 web.deny_push=<user> denies pushing to user in list
1012
1013 $ cat > .hg/hgrc <<EOF
1014 > [web]
1015 > push_ssl = false
1016 > deny_push = baduser
1017 > EOF
1018
1019 $ REMOTE_USER=baduser REQUEST_METHOD=POST hg serve -p $HGPORT -d --pid-file hg.pid
1020 $ cat hg.pid > $DAEMON_PIDS
1021
1022 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=pushkey' --requestheader 'x-hgarg-1=namespace=bookmarks&key=bm&old=&new=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b'
1023 401 push not authorized
1024
1025 0
1026 push not authorized
1027 [1]
1028
1029 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=batch' --requestheader 'x-hgarg-1=cmds=pushkey+namespace%3Dbookmarks%2Ckey%3Dbm%2Cold%3D%2Cnew%3Dcb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b'
1030 401 push not authorized
1031
1032 0
1033 push not authorized
1034 [1]
1035
1036 $ hg bookmarks
1037 no bookmarks set
1038
1039 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritenoperm'
1040 401 push not authorized
1041
1042 0
1043 push not authorized
1044 [1]
1045
1046 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritewithperm'
1047 401 push not authorized
1048
1049 0
1050 push not authorized
1051 [1]
1052
1053 Reset server to remove REQUEST_METHOD hack to test hg client
1054
1055 $ killdaemons.py
1056 $ REMOTE_USER=baduser hg serve -p $HGPORT -d --pid-file hg.pid
1057 $ cat hg.pid > $DAEMON_PIDS
1058
1059 $ hg --cwd ../test2 push -B bm http://localhost:$HGPORT/
1060 pushing to http://localhost:$HGPORT/
1061 searching for changes
1062 no changes found
1063 abort: authorization failed
1064 [255]
1065
1066 $ hg --cwd ../test2 push http://localhost:$HGPORT/
1067 pushing to http://localhost:$HGPORT/
1068 searching for changes
1069 abort: authorization failed
1070 [255]
1071
1072 $ killdaemons.py
1073
1074 web.deny_push=<user> denies pushing to user not in list because allow-push isn't set
1075
1076 $ REMOTE_USER=gooduser REQUEST_METHOD=POST hg serve -p $HGPORT -d --pid-file hg.pid
1077 $ cat hg.pid > $DAEMON_PIDS
1078
1079 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=pushkey' --requestheader 'x-hgarg-1=namespace=bookmarks&key=bm&old=&new=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b'
1080 401 push not authorized
1081
1082 0
1083 push not authorized
1084 [1]
1085
1086 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=batch' --requestheader 'x-hgarg-1=cmds=pushkey+namespace%3Dbookmarks%2Ckey%3Dbm%2Cold%3D%2Cnew%3Dcb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b'
1087 401 push not authorized
1088
1089 0
1090 push not authorized
1091 [1]
1092
1093 $ hg bookmarks
1094 no bookmarks set
1095
1096 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritenoperm'
1097 401 push not authorized
1098
1099 0
1100 push not authorized
1101 [1]
1102
1103 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritewithperm'
1104 401 push not authorized
1105
1106 0
1107 push not authorized
1108 [1]
1109
1110 Reset server to remove REQUEST_METHOD hack to test hg client
1111
1112 $ killdaemons.py
1113 $ REMOTE_USER=gooduser hg serve -p $HGPORT -d --pid-file hg.pid
1114 $ cat hg.pid > $DAEMON_PIDS
1115
1116 $ hg --cwd ../test2 push -B bm http://localhost:$HGPORT/
1117 pushing to http://localhost:$HGPORT/
1118 searching for changes
1119 no changes found
1120 abort: authorization failed
1121 [255]
1122
1123 $ hg --cwd ../test2 push http://localhost:$HGPORT/
1124 pushing to http://localhost:$HGPORT/
1125 searching for changes
1126 abort: authorization failed
1127 [255]
1128
1129 $ killdaemons.py
1130
1131 web.allow-push=* allows pushes from unauthenticated users
1132
1133 $ cat > .hg/hgrc <<EOF
1134 > [web]
1135 > push_ssl = false
1136 > allow-push = *
1137 > EOF
1138
1139 $ REQUEST_METHOD=POST hg serve -p $HGPORT -d --pid-file hg.pid
1140 $ cat hg.pid > $DAEMON_PIDS
1141
1142 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=pushkey' --requestheader 'x-hgarg-1=namespace=bookmarks&key=bm&old=&new=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b'
1143 200 Script output follows
1144
1145 1
1146
1147 $ hg bookmarks
1148 bm 0:cb9a9f314b8b
1149 $ hg book -d bm
1150
1151 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritenoperm'
1152 200 Script output follows
1153
1154 write command no defined permissions
1155
1156 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritewithperm'
1157 200 Script output follows
1158
1159 write command w/ defined permissions
1160
1161 Reset server to remove REQUEST_METHOD hack to test hg client
1162
1163 $ killdaemons.py
1164 $ hg serve -p $HGPORT -d --pid-file hg.pid
1165 $ cat hg.pid > $DAEMON_PIDS
1166
1167 $ hg --cwd ../test2 push -B bm http://localhost:$HGPORT/
1168 pushing to http://localhost:$HGPORT/
1169 searching for changes
1170 no changes found
1171 exporting bookmark bm
1172 [1]
1173
1174 $ hg book -d bm
1175
1176 $ hg --cwd ../test2 push http://localhost:$HGPORT/
1177 pushing to http://localhost:$HGPORT/
1178 searching for changes
1179 remote: adding changesets
1180 remote: adding manifests
1181 remote: adding file changes
1182 remote: added 1 changesets with 1 changes to 1 files
1183
1184 $ hg strip -r 1:
1185 saved backup bundle to $TESTTMP/test/.hg/strip-backup/ba677d0156c1-eea704d7-backup.hg
1186
1187 $ killdaemons.py
1188
1189 web.allow-push=* allows pushes from authenticated users
1190
1191 $ REMOTE_USER=someuser REQUEST_METHOD=POST hg serve -p $HGPORT -d --pid-file hg.pid
1192 $ cat hg.pid > $DAEMON_PIDS
1193
1194 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=pushkey' --requestheader 'x-hgarg-1=namespace=bookmarks&key=bm&old=&new=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b'
1195 200 Script output follows
1196
1197 1
1198
1199 $ hg bookmarks
1200 bm 0:cb9a9f314b8b
1201 $ hg book -d bm
1202
1203 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritenoperm'
1204 200 Script output follows
1205
1206 write command no defined permissions
1207
1208 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritewithperm'
1209 200 Script output follows
1210
1211 write command w/ defined permissions
1212
1213 Reset server to remove REQUEST_METHOD hack to test hg client
1214
1215 $ killdaemons.py
1216 $ REMOTE_USER=someuser hg serve -p $HGPORT -d --pid-file hg.pid
1217 $ cat hg.pid > $DAEMON_PIDS
1218
1219 $ hg --cwd ../test2 push -B bm http://localhost:$HGPORT/
1220 pushing to http://localhost:$HGPORT/
1221 searching for changes
1222 no changes found
1223 exporting bookmark bm
1224 [1]
1225
1226 $ hg book -d bm
1227
1228 $ hg --cwd ../test2 push http://localhost:$HGPORT/
1229 pushing to http://localhost:$HGPORT/
1230 searching for changes
1231 remote: adding changesets
1232 remote: adding manifests
1233 remote: adding file changes
1234 remote: added 1 changesets with 1 changes to 1 files
1235
1236 $ hg strip -r 1:
1237 saved backup bundle to $TESTTMP/test/.hg/strip-backup/ba677d0156c1-eea704d7-backup.hg
1238
1239 $ killdaemons.py
1240
1241 web.allow-push=<user> denies push to user not in list
1242
1243 $ cat > .hg/hgrc <<EOF
1244 > [web]
1245 > push_ssl = false
1246 > allow-push = gooduser
1247 > EOF
1248
1249 $ REMOTE_USER=baduser REQUEST_METHOD=POST hg serve -p $HGPORT -d --pid-file hg.pid
1250 $ cat hg.pid > $DAEMON_PIDS
1251
1252 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=pushkey' --requestheader 'x-hgarg-1=namespace=bookmarks&key=bm&old=&new=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b'
1253 401 push not authorized
1254
1255 0
1256 push not authorized
1257 [1]
1258
1259 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=batch' --requestheader 'x-hgarg-1=cmds=pushkey+namespace%3Dbookmarks%2Ckey%3Dbm%2Cold%3D%2Cnew%3Dcb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b'
1260 401 push not authorized
1261
1262 0
1263 push not authorized
1264 [1]
1265
1266 $ hg bookmarks
1267 no bookmarks set
1268
1269 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritenoperm'
1270 401 push not authorized
1271
1272 0
1273 push not authorized
1274 [1]
1275
1276 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritewithperm'
1277 401 push not authorized
1278
1279 0
1280 push not authorized
1281 [1]
1282
1283 Reset server to remove REQUEST_METHOD hack to test hg client
1284
1285 $ killdaemons.py
1286 $ REMOTE_USER=baduser hg serve -p $HGPORT -d --pid-file hg.pid
1287 $ cat hg.pid > $DAEMON_PIDS
1288
1289 $ hg --cwd ../test2 push -B bm http://localhost:$HGPORT/
1290 pushing to http://localhost:$HGPORT/
1291 searching for changes
1292 no changes found
1293 abort: authorization failed
1294 [255]
1295
1296 $ hg --cwd ../test2 push http://localhost:$HGPORT/
1297 pushing to http://localhost:$HGPORT/
1298 searching for changes
1299 abort: authorization failed
1300 [255]
1301
1302 $ killdaemons.py
1303
1304 web.allow-push=<user> allows push from user in list
1305
1306 $ REMOTE_USER=gooduser REQUEST_METHOD=POST hg serve -p $HGPORT -d --pid-file hg.pid
1307 $ cat hg.pid > $DAEMON_PIDS
1308
1309 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=pushkey' --requestheader 'x-hgarg-1=namespace=bookmarks&key=bm&old=&new=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b'
1310 200 Script output follows
1311
1312 1
1313
1314 $ hg bookmarks
1315 bm 0:cb9a9f314b8b
1316 $ hg book -d bm
1317
1318 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=batch' --requestheader 'x-hgarg-1=cmds=pushkey+namespace%3Dbookmarks%2Ckey%3Dbm%2Cold%3D%2Cnew%3Dcb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b'
1319 200 Script output follows
1320
1321 1
1322
1323 $ hg bookmarks
1324 bm 0:cb9a9f314b8b
1325 $ hg book -d bm
1326
1327 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritenoperm'
1328 200 Script output follows
1329
1330 write command no defined permissions
1331
1332 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritewithperm'
1333 200 Script output follows
1334
1335 write command w/ defined permissions
1336
1337 Reset server to remove REQUEST_METHOD hack to test hg client
1338
1339 $ killdaemons.py
1340 $ REMOTE_USER=gooduser hg serve -p $HGPORT -d --pid-file hg.pid
1341 $ cat hg.pid > $DAEMON_PIDS
1342
1343 $ hg --cwd ../test2 push -B bm http://localhost:$HGPORT/
1344 pushing to http://localhost:$HGPORT/
1345 searching for changes
1346 no changes found
1347 exporting bookmark bm
1348 [1]
1349
1350 $ hg book -d bm
1351
1352 $ hg --cwd ../test2 push http://localhost:$HGPORT/
1353 pushing to http://localhost:$HGPORT/
1354 searching for changes
1355 remote: adding changesets
1356 remote: adding manifests
1357 remote: adding file changes
1358 remote: added 1 changesets with 1 changes to 1 files
1359
1360 $ hg strip -r 1:
1361 saved backup bundle to $TESTTMP/test/.hg/strip-backup/ba677d0156c1-eea704d7-backup.hg
1362
1363 $ killdaemons.py
1364
1365 web.deny_push takes precedence over web.allow_push
1366
1367 $ cat > .hg/hgrc <<EOF
1368 > [web]
1369 > push_ssl = false
1370 > allow-push = someuser
1371 > deny_push = someuser
1372 > EOF
1373
1374 $ REMOTE_USER=someuser REQUEST_METHOD=POST hg serve -p $HGPORT -d --pid-file hg.pid
1375 $ cat hg.pid > $DAEMON_PIDS
1376
1377 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=pushkey' --requestheader 'x-hgarg-1=namespace=bookmarks&key=bm&old=&new=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b'
1378 401 push not authorized
1379
1380 0
1381 push not authorized
1382 [1]
1383
1384 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=batch' --requestheader 'x-hgarg-1=cmds=pushkey+namespace%3Dbookmarks%2Ckey%3Dbm%2Cold%3D%2Cnew%3Dcb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b'
1385 401 push not authorized
1386
1387 0
1388 push not authorized
1389 [1]
1390
1391 $ hg bookmarks
1392 no bookmarks set
1393
1394 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritenoperm'
1395 401 push not authorized
1396
1397 0
1398 push not authorized
1399 [1]
1400
1401 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritewithperm'
1402 401 push not authorized
1403
1404 0
1405 push not authorized
1406 [1]
1407
1408 Reset server to remove REQUEST_METHOD hack to test hg client
1409
1410 $ killdaemons.py
1411 $ REMOTE_USER=someuser hg serve -p $HGPORT -d --pid-file hg.pid
1412 $ cat hg.pid > $DAEMON_PIDS
1413
1414 $ hg --cwd ../test2 push -B bm http://localhost:$HGPORT/
1415 pushing to http://localhost:$HGPORT/
1416 searching for changes
1417 no changes found
1418 abort: authorization failed
1419 [255]
1420
1421 $ hg --cwd ../test2 push http://localhost:$HGPORT/
1422 pushing to http://localhost:$HGPORT/
1423 searching for changes
1424 abort: authorization failed
1425 [255]
1426
1427 $ killdaemons.py
1428
1429 web.allow-push has no effect if web.deny_read is set
1430
1431 $ cat > .hg/hgrc <<EOF
1432 > [web]
1433 > push_ssl = false
1434 > allow-push = *
1435 > deny_read = *
1436 > EOF
1437
1438 $ REQUEST_METHOD=POST REMOTE_USER=someuser hg serve -p $HGPORT -d --pid-file hg.pid
1439 $ cat hg.pid > $DAEMON_PIDS
1440
1441 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=pushkey' --requestheader 'x-hgarg-1=namespace=bookmarks&key=bm&old=&new=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b'
1442 401 read not authorized
1443
1444 0
1445 read not authorized
1446 [1]
1447
1448 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=batch' --requestheader 'x-hgarg-1=cmds=pushkey+namespace%3Dbookmarks%2Ckey%3Dbm%2Cold%3D%2Cnew%3Dcb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b'
1449 401 read not authorized
1450
1451 0
1452 read not authorized
1453 [1]
1454
1455 $ hg bookmarks
1456 no bookmarks set
1457
1458 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customreadnoperm'
1459 401 read not authorized
1460
1461 0
1462 read not authorized
1463 [1]
1464
1465 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customreadwithperm'
1466 401 read not authorized
1467
1468 0
1469 read not authorized
1470 [1]
1471
1472 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritenoperm'
1473 401 read not authorized
1474
1475 0
1476 read not authorized
1477 [1]
1478
1479 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritewithperm'
1480 401 read not authorized
1481
1482 0
1483 read not authorized
1484 [1]
1485
1486 Reset server to remove REQUEST_METHOD hack to test hg client
1487
1488 $ killdaemons.py
1489 $ REMOTE_USER=someuser hg serve -p $HGPORT -d --pid-file hg.pid
1490 $ cat hg.pid > $DAEMON_PIDS
1491
1492 $ hg --cwd ../test2 push -B bm http://localhost:$HGPORT/
1493 pushing to http://localhost:$HGPORT/
1494 abort: authorization failed
1495 [255]
1496
1497 $ hg --cwd ../test2 push http://localhost:$HGPORT/
1498 pushing to http://localhost:$HGPORT/
1499 abort: authorization failed
1500 [255]
1501
1502 $ killdaemons.py
@@ -12,7 +12,6 b' from __future__ import absolute_import'
12 from mercurial.i18n import _
12 from mercurial.i18n import _
13
13
14 from mercurial.hgweb import (
14 from mercurial.hgweb import (
15 hgweb_mod,
16 webcommands,
15 webcommands,
17 )
16 )
18
17
@@ -175,9 +174,10 b' def uisetup(ui):'
175
174
176 # make putlfile behave the same as push and {get,stat}lfile behave
175 # make putlfile behave the same as push and {get,stat}lfile behave
177 # the same as pull w.r.t. permissions checks
176 # the same as pull w.r.t. permissions checks
178 hgweb_mod.perms['putlfile'] = 'push'
177 wireproto.permissions['putlfile'] = 'push'
179 hgweb_mod.perms['getlfile'] = 'pull'
178 wireproto.permissions['getlfile'] = 'pull'
180 hgweb_mod.perms['statlfile'] = 'pull'
179 wireproto.permissions['statlfile'] = 'pull'
180 wireproto.permissions['lheads'] = 'pull'
181
181
182 extensions.wrapfunction(webcommands, 'decodepath', overrides.decodepath)
182 extensions.wrapfunction(webcommands, 'decodepath', overrides.decodepath)
183
183
@@ -36,6 +36,7 b' from .. import ('
36 templater,
36 templater,
37 ui as uimod,
37 ui as uimod,
38 util,
38 util,
39 wireproto,
39 )
40 )
40
41
41 from . import (
42 from . import (
@@ -45,15 +46,8 b' from . import ('
45 wsgicgi,
46 wsgicgi,
46 )
47 )
47
48
48 perms = {
49 # Aliased for API compatibility.
49 'changegroup': 'pull',
50 perms = wireproto.permissions
50 'changegroupsubset': 'pull',
51 'getbundle': 'pull',
52 'stream_out': 'pull',
53 'listkeys': 'pull',
54 'unbundle': 'push',
55 'pushkey': 'push',
56 }
57
51
58 archivespecs = util.sortdict((
52 archivespecs = util.sortdict((
59 ('zip', ('application/zip', 'zip', '.zip', None)),
53 ('zip', ('application/zip', 'zip', '.zip', None)),
@@ -366,8 +360,13 b' class hgweb(object):'
366 try:
360 try:
367 if query:
361 if query:
368 raise ErrorResponse(HTTP_NOT_FOUND)
362 raise ErrorResponse(HTTP_NOT_FOUND)
369 if cmd in perms:
363
370 self.check_perm(rctx, req, perms[cmd])
364 req.checkperm = lambda op: self.check_perm(rctx, req, op)
365 # Assume commands with no defined permissions are writes /
366 # for pushes. This is the safest from a security perspective
367 # because it doesn't allow commands with undefined semantics
368 # from bypassing permissions checks.
369 req.checkperm(perms.get(cmd, 'push'))
371 return protocol.call(rctx.repo, req, cmd)
370 return protocol.call(rctx.repo, req, cmd)
372 except ErrorResponse as inst:
371 except ErrorResponse as inst:
373 # A client that sends unbundle without 100-continue will
372 # A client that sends unbundle without 100-continue will
@@ -52,6 +52,7 b' class webproto(wireproto.abstractserverp'
52 self.response = ''
52 self.response = ''
53 self.ui = ui
53 self.ui = ui
54 self.name = 'http'
54 self.name = 'http'
55 self.checkperm = req.checkperm
55
56
56 def getargs(self, args):
57 def getargs(self, args):
57 knownargs = self._args()
58 knownargs = self._args()
@@ -677,6 +677,11 b' def supportedcompengines(ui, proto, role'
677 # list of commands
677 # list of commands
678 commands = {}
678 commands = {}
679
679
680 # Maps wire protocol name to operation type. This is used for permissions
681 # checking. All defined @wireiprotocommand should have an entry in this
682 # dict.
683 permissions = {}
684
680 def wireprotocommand(name, args=''):
685 def wireprotocommand(name, args=''):
681 """decorator for wire protocol command"""
686 """decorator for wire protocol command"""
682 def register(func):
687 def register(func):
@@ -684,6 +689,8 b" def wireprotocommand(name, args=''):"
684 return func
689 return func
685 return register
690 return register
686
691
692 # TODO define a more appropriate permissions type to use for this.
693 permissions['batch'] = 'pull'
687 @wireprotocommand('batch', 'cmds *')
694 @wireprotocommand('batch', 'cmds *')
688 def batch(repo, proto, cmds, others):
695 def batch(repo, proto, cmds, others):
689 repo = repo.filtered("served")
696 repo = repo.filtered("served")
@@ -696,6 +703,17 b' def batch(repo, proto, cmds, others):'
696 n, v = a.split('=')
703 n, v = a.split('=')
697 vals[unescapearg(n)] = unescapearg(v)
704 vals[unescapearg(n)] = unescapearg(v)
698 func, spec = commands[op]
705 func, spec = commands[op]
706
707 # If the protocol supports permissions checking, perform that
708 # checking on each batched command.
709 # TODO formalize permission checking as part of protocol interface.
710 if util.safehasattr(proto, 'checkperm'):
711 # Assume commands with no defined permissions are writes / for
712 # pushes. This is the safest from a security perspective because
713 # it doesn't allow commands with undefined semantics from
714 # bypassing permissions checks.
715 proto.checkperm(permissions.get(op, 'push'))
716
699 if spec:
717 if spec:
700 keys = spec.split()
718 keys = spec.split()
701 data = {}
719 data = {}
@@ -716,6 +734,7 b' def batch(repo, proto, cmds, others):'
716 res.append(escapearg(result))
734 res.append(escapearg(result))
717 return ';'.join(res)
735 return ';'.join(res)
718
736
737 permissions['between'] = 'pull'
719 @wireprotocommand('between', 'pairs')
738 @wireprotocommand('between', 'pairs')
720 def between(repo, proto, pairs):
739 def between(repo, proto, pairs):
721 pairs = [decodelist(p, '-') for p in pairs.split(" ")]
740 pairs = [decodelist(p, '-') for p in pairs.split(" ")]
@@ -724,6 +743,7 b' def between(repo, proto, pairs):'
724 r.append(encodelist(b) + "\n")
743 r.append(encodelist(b) + "\n")
725 return "".join(r)
744 return "".join(r)
726
745
746 permissions['branchmap'] = 'pull'
727 @wireprotocommand('branchmap')
747 @wireprotocommand('branchmap')
728 def branchmap(repo, proto):
748 def branchmap(repo, proto):
729 branchmap = repo.branchmap()
749 branchmap = repo.branchmap()
@@ -734,6 +754,7 b' def branchmap(repo, proto):'
734 heads.append('%s %s' % (branchname, branchnodes))
754 heads.append('%s %s' % (branchname, branchnodes))
735 return '\n'.join(heads)
755 return '\n'.join(heads)
736
756
757 permissions['branches'] = 'pull'
737 @wireprotocommand('branches', 'nodes')
758 @wireprotocommand('branches', 'nodes')
738 def branches(repo, proto, nodes):
759 def branches(repo, proto, nodes):
739 nodes = decodelist(nodes)
760 nodes = decodelist(nodes)
@@ -742,6 +763,7 b' def branches(repo, proto, nodes):'
742 r.append(encodelist(b) + "\n")
763 r.append(encodelist(b) + "\n")
743 return "".join(r)
764 return "".join(r)
744
765
766 permissions['clonebundles'] = 'pull'
745 @wireprotocommand('clonebundles', '')
767 @wireprotocommand('clonebundles', '')
746 def clonebundles(repo, proto):
768 def clonebundles(repo, proto):
747 """Server command for returning info for available bundles to seed clones.
769 """Server command for returning info for available bundles to seed clones.
@@ -804,10 +826,12 b' def _capabilities(repo, proto):'
804
826
805 # If you are writing an extension and consider wrapping this function. Wrap
827 # If you are writing an extension and consider wrapping this function. Wrap
806 # `_capabilities` instead.
828 # `_capabilities` instead.
829 permissions['capabilities'] = 'pull'
807 @wireprotocommand('capabilities')
830 @wireprotocommand('capabilities')
808 def capabilities(repo, proto):
831 def capabilities(repo, proto):
809 return ' '.join(_capabilities(repo, proto))
832 return ' '.join(_capabilities(repo, proto))
810
833
834 permissions['changegroup'] = 'pull'
811 @wireprotocommand('changegroup', 'roots')
835 @wireprotocommand('changegroup', 'roots')
812 def changegroup(repo, proto, roots):
836 def changegroup(repo, proto, roots):
813 nodes = decodelist(roots)
837 nodes = decodelist(roots)
@@ -817,6 +841,7 b' def changegroup(repo, proto, roots):'
817 gen = iter(lambda: cg.read(32768), '')
841 gen = iter(lambda: cg.read(32768), '')
818 return streamres(gen=gen)
842 return streamres(gen=gen)
819
843
844 permissions['changegroupsubset'] = 'pull'
820 @wireprotocommand('changegroupsubset', 'bases heads')
845 @wireprotocommand('changegroupsubset', 'bases heads')
821 def changegroupsubset(repo, proto, bases, heads):
846 def changegroupsubset(repo, proto, bases, heads):
822 bases = decodelist(bases)
847 bases = decodelist(bases)
@@ -827,12 +852,14 b' def changegroupsubset(repo, proto, bases'
827 gen = iter(lambda: cg.read(32768), '')
852 gen = iter(lambda: cg.read(32768), '')
828 return streamres(gen=gen)
853 return streamres(gen=gen)
829
854
855 permissions['debugwireargs'] = 'pull'
830 @wireprotocommand('debugwireargs', 'one two *')
856 @wireprotocommand('debugwireargs', 'one two *')
831 def debugwireargs(repo, proto, one, two, others):
857 def debugwireargs(repo, proto, one, two, others):
832 # only accept optional args from the known set
858 # only accept optional args from the known set
833 opts = options('debugwireargs', ['three', 'four'], others)
859 opts = options('debugwireargs', ['three', 'four'], others)
834 return repo.debugwireargs(one, two, **pycompat.strkwargs(opts))
860 return repo.debugwireargs(one, two, **pycompat.strkwargs(opts))
835
861
862 permissions['getbundle'] = 'pull'
836 @wireprotocommand('getbundle', '*')
863 @wireprotocommand('getbundle', '*')
837 def getbundle(repo, proto, others):
864 def getbundle(repo, proto, others):
838 opts = options('getbundle', gboptsmap.keys(), others)
865 opts = options('getbundle', gboptsmap.keys(), others)
@@ -899,11 +926,13 b' def getbundle(repo, proto, others):'
899
926
900 return streamres(gen=chunks, prefer_uncompressed=not prefercompressed)
927 return streamres(gen=chunks, prefer_uncompressed=not prefercompressed)
901
928
929 permissions['heads'] = 'pull'
902 @wireprotocommand('heads')
930 @wireprotocommand('heads')
903 def heads(repo, proto):
931 def heads(repo, proto):
904 h = repo.heads()
932 h = repo.heads()
905 return encodelist(h) + "\n"
933 return encodelist(h) + "\n"
906
934
935 permissions['hello'] = 'pull'
907 @wireprotocommand('hello')
936 @wireprotocommand('hello')
908 def hello(repo, proto):
937 def hello(repo, proto):
909 '''the hello command returns a set of lines describing various
938 '''the hello command returns a set of lines describing various
@@ -915,11 +944,13 b' def hello(repo, proto):'
915 '''
944 '''
916 return "capabilities: %s\n" % (capabilities(repo, proto))
945 return "capabilities: %s\n" % (capabilities(repo, proto))
917
946
947 permissions['listkeys'] = 'pull'
918 @wireprotocommand('listkeys', 'namespace')
948 @wireprotocommand('listkeys', 'namespace')
919 def listkeys(repo, proto, namespace):
949 def listkeys(repo, proto, namespace):
920 d = repo.listkeys(encoding.tolocal(namespace)).items()
950 d = repo.listkeys(encoding.tolocal(namespace)).items()
921 return pushkeymod.encodekeys(d)
951 return pushkeymod.encodekeys(d)
922
952
953 permissions['lookup'] = 'pull'
923 @wireprotocommand('lookup', 'key')
954 @wireprotocommand('lookup', 'key')
924 def lookup(repo, proto, key):
955 def lookup(repo, proto, key):
925 try:
956 try:
@@ -932,10 +963,12 b' def lookup(repo, proto, key):'
932 success = 0
963 success = 0
933 return "%d %s\n" % (success, r)
964 return "%d %s\n" % (success, r)
934
965
966 permissions['known'] = 'pull'
935 @wireprotocommand('known', 'nodes *')
967 @wireprotocommand('known', 'nodes *')
936 def known(repo, proto, nodes, others):
968 def known(repo, proto, nodes, others):
937 return ''.join(b and "1" or "0" for b in repo.known(decodelist(nodes)))
969 return ''.join(b and "1" or "0" for b in repo.known(decodelist(nodes)))
938
970
971 permissions['pushkey'] = 'push'
939 @wireprotocommand('pushkey', 'namespace key old new')
972 @wireprotocommand('pushkey', 'namespace key old new')
940 def pushkey(repo, proto, namespace, key, old, new):
973 def pushkey(repo, proto, namespace, key, old, new):
941 # compatibility with pre-1.8 clients which were accidentally
974 # compatibility with pre-1.8 clients which were accidentally
@@ -968,6 +1001,7 b' def pushkey(repo, proto, namespace, key,'
968 encoding.tolocal(old), new)
1001 encoding.tolocal(old), new)
969 return '%s\n' % int(r)
1002 return '%s\n' % int(r)
970
1003
1004 permissions['stream_out'] = 'pull'
971 @wireprotocommand('stream_out')
1005 @wireprotocommand('stream_out')
972 def stream(repo, proto):
1006 def stream(repo, proto):
973 '''If the server supports streaming clone, it advertises the "stream"
1007 '''If the server supports streaming clone, it advertises the "stream"
@@ -976,6 +1010,7 b' def stream(repo, proto):'
976 '''
1010 '''
977 return streamres_legacy(streamclone.generatev1wireproto(repo))
1011 return streamres_legacy(streamclone.generatev1wireproto(repo))
978
1012
1013 permissions['unbundle'] = 'push'
979 @wireprotocommand('unbundle', 'heads')
1014 @wireprotocommand('unbundle', 'heads')
980 def unbundle(repo, proto, heads):
1015 def unbundle(repo, proto, heads):
981 their_heads = decodelist(heads)
1016 their_heads = decodelist(heads)
@@ -259,60 +259,52 b' test http authentication'
259 $ hg rollback -q
259 $ hg rollback -q
260
260
261 $ sed 's/.*] "/"/' < ../access.log
261 $ sed 's/.*] "/"/' < ../access.log
262 "GET /?cmd=capabilities HTTP/1.1" 200 -
262 "GET /?cmd=capabilities HTTP/1.1" 401 -
263 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
263 "GET /?cmd=capabilities HTTP/1.1" 401 -
264 "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
264 "GET /?cmd=capabilities HTTP/1.1" 401 -
265 "GET /?cmd=capabilities HTTP/1.1" 200 -
265 "GET /?cmd=capabilities HTTP/1.1" 200 -
266 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
266 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
267 "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
267 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
268 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
269 "GET /?cmd=capabilities HTTP/1.1" 401 -
268 "GET /?cmd=capabilities HTTP/1.1" 200 -
270 "GET /?cmd=capabilities HTTP/1.1" 200 -
269 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
271 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
270 "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
271 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
272 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
273 "GET /?cmd=capabilities HTTP/1.1" 200 -
274 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
275 "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
276 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
272 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
277 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
273 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
274 "GET /?cmd=capabilities HTTP/1.1" 401 -
278 "GET /?cmd=capabilities HTTP/1.1" 200 -
275 "GET /?cmd=capabilities HTTP/1.1" 200 -
279 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
276 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
280 "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
281 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
277 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
282 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
278 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
279 "GET /?cmd=capabilities HTTP/1.1" 401 -
283 "GET /?cmd=capabilities HTTP/1.1" 200 -
280 "GET /?cmd=capabilities HTTP/1.1" 200 -
284 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
281 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
285 "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
286 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
282 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
287 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
283 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
284 "GET /?cmd=capabilities HTTP/1.1" 401 -
288 "GET /?cmd=capabilities HTTP/1.1" 200 -
285 "GET /?cmd=capabilities HTTP/1.1" 200 -
289 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
286 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
290 "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
291 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
287 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
292 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
288 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
289 "GET /?cmd=capabilities HTTP/1.1" 401 -
293 "GET /?cmd=capabilities HTTP/1.1" 200 -
290 "GET /?cmd=capabilities HTTP/1.1" 200 -
294 "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
291 "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
295 "GET /?cmd=stream_out HTTP/1.1" 401 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
296 "GET /?cmd=stream_out HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
292 "GET /?cmd=stream_out HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
297 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
293 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
298 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D5fed3813f7f5e1824344fdc9cf8f63bb662c292d x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
294 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D5fed3813f7f5e1824344fdc9cf8f63bb662c292d x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
299 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
295 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
296 "GET /?cmd=capabilities HTTP/1.1" 401 -
300 "GET /?cmd=capabilities HTTP/1.1" 200 -
297 "GET /?cmd=capabilities HTTP/1.1" 200 -
301 "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
302 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
298 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
303 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
299 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
304 "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:common=0000000000000000000000000000000000000000&heads=5fed3813f7f5e1824344fdc9cf8f63bb662c292d x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
300 "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:common=0000000000000000000000000000000000000000&heads=5fed3813f7f5e1824344fdc9cf8f63bb662c292d x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
305 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
301 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
306 "GET /?cmd=capabilities HTTP/1.1" 200 -
302 "GET /?cmd=capabilities HTTP/1.1" 401 -
307 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
303 "GET /?cmd=capabilities HTTP/1.1" 401 -
308 "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
304 "GET /?cmd=capabilities HTTP/1.1" 403 -
309 "GET /?cmd=capabilities HTTP/1.1" 200 -
305 "GET /?cmd=capabilities HTTP/1.1" 401 -
310 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
311 "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
312 "GET /?cmd=listkeys HTTP/1.1" 403 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
313 "GET /?cmd=capabilities HTTP/1.1" 200 -
306 "GET /?cmd=capabilities HTTP/1.1" 200 -
314 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D7f4e523d01f2cc3765ac8934da3d14db775ff872 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
307 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D7f4e523d01f2cc3765ac8934da3d14db775ff872 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
315 "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
316 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
308 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
317 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
309 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
318 "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
310 "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
@@ -254,6 +254,7 b' test http authentication'
254 http auth: user user, password ****
254 http auth: user user, password ****
255 sending capabilities command
255 sending capabilities command
256 devel-peer-request: GET http://localhost:$HGPORT2/?cmd=capabilities
256 devel-peer-request: GET http://localhost:$HGPORT2/?cmd=capabilities
257 http auth: user user, password ****
257 devel-peer-request: finished in *.???? seconds (200) (glob)
258 devel-peer-request: finished in *.???? seconds (200) (glob)
258 query 1; heads
259 query 1; heads
259 sending batch command
260 sending batch command
@@ -270,7 +271,6 b' test http authentication'
270 devel-peer-request: Vary X-HgArg-1,X-HgProto-1
271 devel-peer-request: Vary X-HgArg-1,X-HgProto-1
271 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$
272 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$
272 devel-peer-request: 16 bytes of commands arguments in headers
273 devel-peer-request: 16 bytes of commands arguments in headers
273 http auth: user user, password ****
274 devel-peer-request: finished in *.???? seconds (200) (glob)
274 devel-peer-request: finished in *.???? seconds (200) (glob)
275 received listkey for "phases": 58 bytes
275 received listkey for "phases": 58 bytes
276 checking for updated bookmarks
276 checking for updated bookmarks
@@ -340,57 +340,49 b' test http authentication'
340 $ hg rollback -q
340 $ hg rollback -q
341
341
342 $ sed 's/.*] "/"/' < ../access.log
342 $ sed 's/.*] "/"/' < ../access.log
343 "GET /?cmd=capabilities HTTP/1.1" 200 -
343 "GET /?cmd=capabilities HTTP/1.1" 401 -
344 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
344 "GET /?cmd=capabilities HTTP/1.1" 401 -
345 "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
345 "GET /?cmd=capabilities HTTP/1.1" 401 -
346 "GET /?cmd=capabilities HTTP/1.1" 200 -
346 "GET /?cmd=capabilities HTTP/1.1" 200 -
347 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
347 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
348 "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
348 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
349 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
350 "GET /?cmd=capabilities HTTP/1.1" 401 -
349 "GET /?cmd=capabilities HTTP/1.1" 200 -
351 "GET /?cmd=capabilities HTTP/1.1" 200 -
350 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
352 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
351 "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
352 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
353 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
354 "GET /?cmd=capabilities HTTP/1.1" 200 -
355 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
356 "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
357 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
353 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
358 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
354 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
355 "GET /?cmd=capabilities HTTP/1.1" 401 -
359 "GET /?cmd=capabilities HTTP/1.1" 200 -
356 "GET /?cmd=capabilities HTTP/1.1" 200 -
360 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
357 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
361 "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
362 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
358 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
363 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
359 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
360 "GET /?cmd=capabilities HTTP/1.1" 401 -
364 "GET /?cmd=capabilities HTTP/1.1" 200 -
361 "GET /?cmd=capabilities HTTP/1.1" 200 -
365 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
362 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
366 "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
367 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
363 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
368 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
364 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
365 "GET /?cmd=capabilities HTTP/1.1" 401 -
369 "GET /?cmd=capabilities HTTP/1.1" 200 -
366 "GET /?cmd=capabilities HTTP/1.1" 200 -
370 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
367 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
371 "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
372 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
368 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
373 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
369 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
370 "GET /?cmd=capabilities HTTP/1.1" 401 -
374 "GET /?cmd=capabilities HTTP/1.1" 200 -
371 "GET /?cmd=capabilities HTTP/1.1" 200 -
375 "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
372 "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
376 "GET /?cmd=stream_out HTTP/1.1" 401 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
377 "GET /?cmd=stream_out HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
373 "GET /?cmd=stream_out HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
378 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D5fed3813f7f5e1824344fdc9cf8f63bb662c292d x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
374 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D5fed3813f7f5e1824344fdc9cf8f63bb662c292d x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
379 "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=0&common=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&heads=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
375 "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=0&common=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&heads=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
376 "GET /?cmd=capabilities HTTP/1.1" 401 -
380 "GET /?cmd=capabilities HTTP/1.1" 200 -
377 "GET /?cmd=capabilities HTTP/1.1" 200 -
381 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
378 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
382 "GET /?cmd=getbundle HTTP/1.1" 401 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
383 "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
379 "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
384 "GET /?cmd=capabilities HTTP/1.1" 200 -
380 "GET /?cmd=capabilities HTTP/1.1" 401 -
385 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
381 "GET /?cmd=capabilities HTTP/1.1" 401 -
386 "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
382 "GET /?cmd=capabilities HTTP/1.1" 403 -
387 "GET /?cmd=capabilities HTTP/1.1" 200 -
383 "GET /?cmd=capabilities HTTP/1.1" 401 -
388 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
389 "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
390 "GET /?cmd=listkeys HTTP/1.1" 403 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
391 "GET /?cmd=capabilities HTTP/1.1" 200 -
384 "GET /?cmd=capabilities HTTP/1.1" 200 -
392 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D7f4e523d01f2cc3765ac8934da3d14db775ff872 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
385 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D7f4e523d01f2cc3765ac8934da3d14db775ff872 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
393 "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
394 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
386 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
395 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
387 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
396 "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
388 "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
@@ -398,9 +390,9 b' test http authentication'
398 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
390 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
399 "POST /?cmd=unbundle HTTP/1.1" 200 - x-hgarg-1:heads=666f726365* (glob)
391 "POST /?cmd=unbundle HTTP/1.1" 200 - x-hgarg-1:heads=666f726365* (glob)
400 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
392 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
393 "GET /?cmd=capabilities HTTP/1.1" 401 -
401 "GET /?cmd=capabilities HTTP/1.1" 200 -
394 "GET /?cmd=capabilities HTTP/1.1" 200 -
402 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D7f4e523d01f2cc3765ac8934da3d14db775ff872 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
395 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D7f4e523d01f2cc3765ac8934da3d14db775ff872 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
403 "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
404 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
396 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
405 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
397 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
406 "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
398 "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
@@ -434,11 +434,11 b' a large file from the server rather than'
434 > EOF
434 > EOF
435 $ hg clone --config ui.interactive=true --config extensions.getpass=get_pass.py \
435 $ hg clone --config ui.interactive=true --config extensions.getpass=get_pass.py \
436 > http://user@localhost:$HGPORT credentialclone
436 > http://user@localhost:$HGPORT credentialclone
437 requesting all changes
438 http authorization required for http://localhost:$HGPORT/
437 http authorization required for http://localhost:$HGPORT/
439 realm: mercurial
438 realm: mercurial
440 user: user
439 user: user
441 password: adding changesets
440 password: requesting all changes
441 adding changesets
442 adding manifests
442 adding manifests
443 adding file changes
443 adding file changes
444 added 1 changesets with 1 changes to 1 files
444 added 1 changesets with 1 changes to 1 files
@@ -50,7 +50,6 b' expect error, cloning not allowed'
50 $ hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log
50 $ hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log
51 $ cat hg.pid >> $DAEMON_PIDS
51 $ cat hg.pid >> $DAEMON_PIDS
52 $ hg clone http://localhost:$HGPORT/ test4 # bundle2+
52 $ hg clone http://localhost:$HGPORT/ test4 # bundle2+
53 requesting all changes
54 abort: authorization failed
53 abort: authorization failed
55 [255]
54 [255]
56 $ hg clone http://localhost:$HGPORT/ test4 --config devel.legacy.exchange=bundle1
55 $ hg clone http://localhost:$HGPORT/ test4 --config devel.legacy.exchange=bundle1
@@ -74,7 +73,6 b' expect error, pulling not allowed'
74
73
75 $ req
74 $ req
76 pulling from http://localhost:$HGPORT/
75 pulling from http://localhost:$HGPORT/
77 searching for changes
78 abort: authorization failed
76 abort: authorization failed
79 % serve errors
77 % serve errors
80
78
@@ -307,28 +307,6 b' Make phases updates work'
307 $ hg --config extensions.strip= strip -r 1:
307 $ hg --config extensions.strip= strip -r 1:
308 saved backup bundle to $TESTTMP/test/.hg/strip-backup/ba677d0156c1-eea704d7-backup.hg
308 saved backup bundle to $TESTTMP/test/.hg/strip-backup/ba677d0156c1-eea704d7-backup.hg
309
309
310 expect authorization error: all users denied
311
312 $ echo '[web]' > .hg/hgrc
313 $ echo 'push_ssl = false' >> .hg/hgrc
314 $ echo 'deny_push = *' >> .hg/hgrc
315 $ req
316 pushing to http://localhost:$HGPORT/
317 searching for changes
318 abort: authorization failed
319 % serve errors
320 [255]
321
322 expect authorization error: some users denied, users must be authenticated
323
324 $ echo 'deny_push = unperson' >> .hg/hgrc
325 $ req
326 pushing to http://localhost:$HGPORT/
327 searching for changes
328 abort: authorization failed
329 % serve errors
330 [255]
331
332 #if bundle2
310 #if bundle2
333
311
334 $ cat > .hg/hgrc <<EOF
312 $ cat > .hg/hgrc <<EOF
General Comments 0
You need to be logged in to leave comments. Login now