comparison tests/test-http.t @ 20291:7d589d923b8a

url: added authuri when login information is requested (issue3209) When users are using a revset they can get multiple password prompts. This prompts have no extra information about which password is being requested so I added the authuri to the prompt to make it recognizable. As in: $ hg log -r "outgoing('https://bitbucket.org/mg/test') - outgoing('https://bitbucket.org/nesneros/test')" http authorization required realm: Bitbucket.org HTTP user: interrupted! I changed it to describe the url when prompting for password. As in: $ hg log -r "outgoing('https://bitbucket.org/mg/test') - outgoing('https://bitbucket.org/nesneros/test')" http authorization required for https://bitbucket.org/mg/test realm: Bitbucket.org HTTP user: interrupted!
author Lucas Moscovicz <lmoscovicz@fb.com>
date Wed, 15 Jan 2014 16:46:20 -0800
parents 471f30d360ea
children c499fff76440
comparison
equal deleted inserted replaced
20290:50db996bccaf 20291:7d589d923b8a
154 > EOT 154 > EOT
155 $ hg --config extensions.x=userpass.py serve -p $HGPORT2 -d --pid-file=pid \ 155 $ hg --config extensions.x=userpass.py serve -p $HGPORT2 -d --pid-file=pid \
156 > --config server.preferuncompressed=True 156 > --config server.preferuncompressed=True
157 $ cat pid >> $DAEMON_PIDS 157 $ cat pid >> $DAEMON_PIDS
158 158
159 $ hg id http://localhost:$HGPORT2/ 159 $ cat << EOF > get_pass.py
160 abort: http authorization required 160 > import getpass
161 [255] 161 > def newgetpass(arg):
162 $ hg id http://user@localhost:$HGPORT2/ 162 > return "pass"
163 abort: http authorization required 163 > getpass.getpass = newgetpass
164 [255] 164 > EOF
165
166 $ hg id http://localhost:$HGPORT2/
167 abort: http authorization required for http://localhost:$HGPORT2/
168 [255]
169 $ hg id http://localhost:$HGPORT2/
170 abort: http authorization required for http://localhost:$HGPORT2/
171 [255]
172 $ hg id --config ui.interactive=true --config extensions.getpass=get_pass.py http://user@localhost:$HGPORT2/
173 http authorization required for http://localhost:$HGPORT2/
174 realm: mercurial
175 user: user
176 password: 5fed3813f7f5
165 $ hg id http://user:pass@localhost:$HGPORT2/ 177 $ hg id http://user:pass@localhost:$HGPORT2/
166 5fed3813f7f5 178 5fed3813f7f5
167 $ echo '[auth]' >> .hg/hgrc 179 $ echo '[auth]' >> .hg/hgrc
168 $ echo 'l.schemes=http' >> .hg/hgrc 180 $ echo 'l.schemes=http' >> .hg/hgrc
169 $ echo 'l.prefix=lo' >> .hg/hgrc 181 $ echo 'l.prefix=lo' >> .hg/hgrc
181 transferred * bytes in * seconds (*/sec) (glob) 193 transferred * bytes in * seconds (*/sec) (glob)
182 updating to branch default 194 updating to branch default
183 5 files updated, 0 files merged, 0 files removed, 0 files unresolved 195 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
184 196
185 $ hg id http://user2@localhost:$HGPORT2/ 197 $ hg id http://user2@localhost:$HGPORT2/
186 abort: http authorization required 198 abort: http authorization required for http://localhost:$HGPORT2/
187 [255] 199 [255]
188 $ hg id http://user:pass2@localhost:$HGPORT2/ 200 $ hg id http://user:pass2@localhost:$HGPORT2/
189 abort: HTTP Error 403: no 201 abort: HTTP Error 403: no
190 [255] 202 [255]
191 203