sapling/mercurial
Patrick Mezard 8028e79c02 hgweb: do not ignore [auth] if url has a username (issue2822)
The [auth] section was ignored when handling URLs like:

  http://user@example.com/foo

Instead, we look in [auth] for an entry matching the URL and supplied user
name. Entries without username can match URL with a username. Prefix length
ties are resolved in favor of entries matching the username. With:

  foo.prefix = http://example.org
  foo.username = user
  foo.password = password
  bar.prefix = http://example.org/bar

and the input URL:

  http://user@example.org/bar

the 'bar' entry will be selected because of prefix length, therefore prompting
for a password. This behaviour ensure that entries selection is consistent when
looking for credentials or for certificates, and that certificates can be
picked even if their entries do no define usernames while the URL does.
Additionally, entries without a username matched against a username are
returned as if they did have requested username set to avoid prompting again
for a username if the password is not set.

v2: reparse the URL in readauthforuri() to handle HTTP and HTTPS similarly.
v3: allow unset usernames to match URL usernames to pick certificates. Resolve
prefix length ties in favor of entries with usernames.
2011-08-01 23:58:50 +02:00
..
help hgweb: do not ignore [auth] if url has a username (issue2822) 2011-08-01 23:58:50 +02:00
hgweb hgweb: handle 'baseurl' configurations with leading slash (issue2934) 2011-08-01 09:48:10 +02:00
httpclient httpclient: import ca33b88d143c from py-nonblocking-http (issue2932) 2011-07-29 12:46:45 -05:00
pure pure parsers: properly detect corrupt index files 2011-05-24 13:30:10 -05:00
templates web: Output a correct date in short format (issue2902) 2011-07-15 10:18:24 +02:00
__init__.py Add back links from file revisions to changeset revisions 2005-05-03 13:16:10 -08:00
ancestor.py check-code: flag 0/1 used as constant Boolean expression 2011-06-01 12:38:46 +02:00
archival.py move opener from util to scmutil 2011-04-20 19:54:57 +02:00
base85.c backout of e4cb9628354c 2011-01-27 11:15:08 +01:00
bdiff.c bdiff.c: rename all variables which hold a hash value to "hash" 2011-03-23 02:33:24 +01:00
bookmarks.py bookmarks: recognize the current bookmark when the local encoding isn't UTF-8 2011-06-08 21:25:18 +08:00
bundlerepo.py check-code: flag 0/1 used as constant Boolean expression 2011-06-01 12:38:46 +02:00
byterange.py classes: fix class style problems found by 06e968819ac9 2011-06-29 15:00:00 +02:00
changegroup.py check-code: flag 0/1 used as constant Boolean expression 2011-06-01 12:38:46 +02:00
changelog.py hidden: Add a hiddenrevs attributes to changelog. 2011-06-16 01:57:53 +02:00
cmdutil.py scmutil: switch match users to supplying contexts 2011-06-18 16:52:51 -05:00
commands.py revert: restore check for uncommitted merge (issue2915) (BC) 2011-07-21 15:39:37 -05:00
commandserver.py cmdserver: take repo.baseui as our ui 2011-07-14 11:46:15 +03:00
config.py config.sortdict: override clear method 2011-06-20 10:51:37 +02:00
context.py match: allow passing a context object to match core 2011-06-18 16:52:51 -05:00
copies.py check-code: flag 0/1 used as constant Boolean expression 2011-06-01 12:38:46 +02:00
dagparser.py cleanup: use x in (a, b) instead of x == a or x == b 2010-09-23 00:02:31 -05:00
dagutil.py dagutil: fix missing import of i18n._ 2011-06-15 17:04:06 -03:00
demandimport.py demandimport: change default for level from None to -1 2010-12-01 21:46:08 +01:00
diffhelpers.c backout of e4cb9628354c 2011-01-27 11:15:08 +01:00
dirstate.py dirstate: rename forget to drop 2011-05-26 17:15:35 -05:00
discovery.py prepush: show details about new remote heads with --verbose 2011-06-03 13:10:22 +02:00
dispatch.py dispatch: make sure global options on the command line take precedence 2011-07-30 21:04:14 +03:00
encoding.py encoding: add an encoding-aware lower function 2011-04-30 10:57:13 -05:00
error.py error: Add a hint argument to RepoError 2011-06-25 02:30:17 +02:00
extensions.py extensions: make disabled()/disabledext() load prebuilt index if available 2011-06-04 20:19:30 +09:00
fancyopts.py help: show value requirement and multiple occurrence of options 2010-06-06 17:25:00 +09:00
filelog.py filelog: add file function to open other filelogs 2011-05-10 17:38:58 +02:00
filemerge.py filemerge: use ui out descriptor when calling util.system 2011-06-24 17:04:37 +03:00
fileset.py fileset: fix typo in binary() doc 2011-07-04 14:36:16 +03:00
graphmod.py graphmod: correctly emit nodes with more than 2 predecessors 2011-05-01 15:51:46 +02:00
hbisect.py hbisect: use real Booleans instead of 0/1 2011-05-06 10:02:46 +02:00
help.py fileset: add a help topic 2011-06-18 16:53:49 -05:00
hg.py util: rename the util.localpath that uses url to urllocalpath (issue2875) 2011-07-01 17:37:09 +02:00
hook.py hook: be prepared for __stdout/err__ not having fileno() 2011-07-30 23:41:10 +03:00
httpconnection.py hgweb: do not ignore [auth] if url has a username (issue2822) 2011-08-01 23:58:50 +02:00
httprepo.py http2: send an extra header to signal a non-broken client 2011-07-27 18:35:35 -05:00
i18n.py HGPLAIN: allow exceptions to plain mode, like i18n, via HGPLAINEXCEPT 2011-01-05 00:18:36 +11:00
ignore.py remove unnecessary list comprehensions 2011-02-03 10:31:17 +01:00
keepalive.py classes: fix class style problems found by 06e968819ac9 2011-06-29 15:00:00 +02:00
localrepo.py subrepo: use working copy of .hgsub to filter status (issue2901) 2011-07-13 17:41:49 -05:00
lock.py check-code: flag 0/1 used as constant Boolean expression 2011-06-01 12:38:46 +02:00
lsprof.py lsprof: remove #!-line from non-executable script 2010-10-25 23:46:26 +02:00
lsprofcalltree.py drop unused imports 2009-05-14 15:35:46 +02:00
mail.py rename util.find_exe to findexe 2011-05-08 20:35:46 +02:00
manifest.py manifest: use "\0" instead of "\000" 2011-06-16 08:49:26 +02:00
match.py match: fix bug caused by refactoring in fb457d08da0b 2011-06-23 14:40:57 +02:00
mdiff.py mdiff: carriage return (\r) is also ignorable whitespace 2010-10-19 03:55:06 +02:00
merge.py i18n: use UTF-8 string to lower filename for case collision check 2011-07-28 14:36:07 +09:00
minirst.py minirst: read test input from stdin 2011-05-26 10:46:34 +02:00
mpatch.c backout of e4cb9628354c 2011-01-27 11:15:08 +01:00
node.py Update license to GPLv2+ 2010-01-19 22:20:08 -06:00
osutil.c osutil: replace #import with #include, and add a check for it 2011-03-23 23:05:32 +01:00
parser.py parsers: fix localization markup of parser errors 2011-06-21 00:17:52 +02:00
parsers.c backout of e4cb9628354c 2011-01-27 11:15:08 +01:00
patch.py patch: fix parsing patch files containing CRs not followed by LFs 2011-07-04 19:53:39 -03:00
posix.py rename util.is_exec to isexec 2011-05-08 20:45:47 +02:00
pushkey.py bookmarks: move pushkey functions into core 2011-02-10 13:46:27 -06:00
py3kcompat.py py3kcompat: added fake ord implementation for py3k 2010-08-07 16:38:38 -03:00
repair.py remove unused imports and variables 2011-04-30 13:59:14 +02:00
repo.py Make sure bundlerepo doesn't leak temp files (issue2491) 2011-02-12 10:58:11 +01:00
revlog.py check-code: catch misspellings of descendant 2011-06-07 17:02:54 -05:00
revset.py revsets: actually catch type error on tip^p1(tip) (issue2884) 2011-07-12 12:35:03 -05:00
scmutil.py i18n: use UTF-8 string to lower filename for case collision check 2011-07-28 14:36:07 +09:00
setdiscovery.py setdiscovery: return anyincoming=False when remote's only head is nullid 2011-07-27 18:32:54 -04:00
similar.py fix coding style 2010-05-02 00:48:33 +02:00
simplemerge.py check-code: catch misspellings of descendant 2011-06-07 17:02:54 -05:00
sshrepo.py sshrepo: fix addchangegroup's signature 2011-06-06 21:02:48 +02:00
sshserver.py ui: use I/O descriptors internally 2011-06-08 01:39:20 +03:00
sslutil.py sslutil: make messages for Python without certificate handling more helpful 2011-06-18 01:08:54 +02:00
statichttprepo.py statichttprepo: use in-place difference for shorter line 2011-06-03 20:08:26 +02:00
store.py store: change names to comply with project coding standards 2011-05-08 23:27:48 +02:00
strutil.py Update license to GPLv2+ 2010-01-19 22:20:08 -06:00
subrepo.py subrepo: handle adding svn subrepo with a svn:external file in it (issue2931) 2011-07-28 13:28:32 -04:00
tags.py tags: don't allow environment errors to be raised from _writetagscache 2011-06-16 15:26:17 -05:00
templatefilters.py help: consolidate topic hooks in help.py 2011-05-13 12:57:27 -05:00
templatekw.py patch: restore the previous output of 'diff --stat' 2011-05-26 22:51:02 +08:00
templater.py prevent transient leaks of file handle by using new helper functions 2011-05-02 10:11:18 +02:00
transaction.py transaction: use posixfile and unlink from util 2011-02-15 14:41:49 +01:00
treediscovery.py treediscovery: always return all remote heads 2011-06-20 14:11:01 +02:00
ui.py ui: call write() so the prompt string goes through subclassed implementation 2011-08-01 19:53:00 +03:00
url.py hgweb: do not ignore [auth] if url has a username (issue2822) 2011-08-01 23:58:50 +02:00
util.h backout of e4cb9628354c 2011-01-27 11:15:08 +01:00
util.py url: store and assume the query part of an url is in escaped form (issue2921) 2011-07-31 21:00:44 +02:00
verify.py verify: filter messages about missing null manifests (issue2900) 2011-07-13 16:28:46 -05:00
win32.py win32.py: add argtypes and restype 2011-05-15 21:33:51 +02:00
windows.py win32: assign winstdout to sys.__stdout__ as well (issue2888) 2011-07-16 15:24:28 +03:00
wireproto.py wireproto: make a number of commands batchable 2011-06-14 22:56:20 +02:00