should prompt for usernames during HTTP Basic/Digest auth

Bug #256612 reported by Mark Hammond
128
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
High
Jelmer Vernooij

Bug Description

if there is no username in the URL and the remote server sends a 401, bzr currently just prints the error it received back. It would be nice if it could prompt the user for a username rather than printing the (confusing) error message.

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

svn+ is just a workaround to bypass the standard http implementation in bzr. Bzr's standard http implementation should handle the 401 response properly and prompt for a password, so reassigning this to bzr.

Revision history for this message
epg (epg) wrote : Re: [Bug 256612] Re: 401 (unauthorized) response forces 'svn+' prefix

Jelmer Vernooij <email address hidden> writes:

> svn+ is just a workaround to bypass the standard http implementation in
> bzr. Bzr's standard http implementation should handle the 401 response
> properly and prompt for a password, so reassigning this to bzr.

I doubt bzr is going to look for the svn cached username/password
in, nor write the password it got into that cache. If so, having
bzr handle this itself is not good.

Thanks.

--
Eric Gillespie <*> <email address hidden>

Revision history for this message
Jelmer Vernooij (jelmer) wrote : Re: should handle 401 (unauthorized) response

http:// is handled by bzr itself, so this can only be handled in bzr itself.

bzr-svn can expose the credentials in the subversion cache to bzr and likewise, bzr can expose the credentials entered on the command-line to bzr-svn.

Jelmer Vernooij (jelmer)
Changed in bzr:
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Should we perhaps increase the severity of this bug? There are 8 dupes reported already.

Revision history for this message
Vincent Ladeuil (vila) wrote :

While the number of dupes can be seen as a launchpad bug, it is indeed a sign that we should fix it rather sooner than later.

As discussed on IRC with jelmer, the solution seems to be that bzr should access the svn credentials and be able to give them back to bzr-svn so that it fails (more gracefully) when probing the server and let bzr-svn probe successfully.

For now, bzr-svn can't probe because the bzr probe aborts.

Work has begin at lp:~bzr/bzr/pluggable-credential-stores. The idea is to allow bzr-svn to plug a credential store enabling bzr to access svn credentials.

Changed in bzr:
assignee: nobody → vila
importance: Medium → High
Revision history for this message
Grant Rettke (grettke) wrote :

I encountered this bug today and found the solution to be prepending svn+ to the url.

However, since you still won't be able to commit without credentials, won't this only be a solution for reading the repo and not committing to it?

Anyway, when I try to commit I get the error:

C:\temp\test-repo\trunk>bzr commit -m "Testing bzr svn integration"
The svn+ syntax is deprecated, use https://extranet.spiderlogic.com/svn/htdp/cla
ss-001/grant/trunk instead.
Committing to: svn+https://extranet.spiderlogic.com/svn/htdp/class-001/grant/tru
nk
modified study-hours.txt
bzr: ERROR: exceptions.ValueError: invalid property value 'branch-nick' for None

Traceback (most recent call last):
  File "bzrlib\commands.pyo", line 893, in run_bzr_catch_errors
  File "bzrlib\commands.pyo", line 839, in run_bzr
  File "bzrlib\commands.pyo", line 539, in run_argv_aliases
  File "bzrlib\builtins.pyo", line 2431, in run
  File "bzrlib\decorators.pyo", line 192, in write_locked
  File "bzrlib\workingtree_4.pyo", line 237, in commit
  File "bzrlib\decorators.pyo", line 192, in write_locked
  File "bzrlib\mutabletree.pyo", line 201, in commit
  File "bzrlib\commit.pyo", line 385, in commit
  File "bzrlib\repository.pyo", line 132, in commit
  File "bzrlib\revision.pyo", line 57, in __init__
  File "bzrlib\revision.pyo", line 89, in _check_properties
ValueError: invalid property value 'branch-nick' for None

bzr 1.9 on python 2.5.2 (win32)
arguments: ['bzr', 'commit', '-m', 'Testing bzr svn integration']
encoding: 'cp1252', fsenc: 'mbcs', lang: None
plugins:
  bzrtools C:\Programs\Bazaar\plugins\bzrtools [1.9.1]
  launchpad C:\Programs\Bazaar\plugins\launchpad [unknown]
  qbzr C:\Programs\Bazaar\plugins\qbzr [0.9.5]
  svn C:\Programs\Bazaar\plugins\svn [0.4.14]
*** Bazaar has encountered an internal error.
    Please report a bug at https://bugs.launchpad.net/bzr/+filebug
    including this traceback, and a description of what you
    were doing when the error occurred.

Revision history for this message
Matt Russell (matt-horizon5) wrote :

Just to add another vote for fixing this asap, this bug is really important to me, since I was hoping to switch from git, but cannot without https auth cred.

Revision history for this message
Matt Russell (matt-horizon5) wrote :

sorry comment was out of line, i should of taken time to see that it's marked as high priority and triaged already.
i'd take it back if I could! (perhaps a delete/undo comment feature would be good in launchpad?)

sorry guys!

Revision history for this message
Vincent Ladeuil (vila) wrote :

Changing status to 'in progress' as it better reflects the actual state of affairs. There is progress, even if too slow for everybody taste, sorry for that.

Jelmer, I think bzr now provides enough support for bzr-svn to provide the credentials to bzr, is there something I can do to help here ?

The bug is still open as I want to have a working svn solution for it and also reports a more user-friendly error (along the lines of: connection error, check your credentials instead of the 401 unexpected error).

Changed in bzr:
status: Triaged → In Progress
Jelmer Vernooij (jelmer)
description: updated
Revision history for this message
Grant Rettke (grettke) wrote :

Is bzr going to rely on cached SVN credentials here?

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

only if configured explicitly to do so

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

landed in bzr.dev

Changed in bzr:
assignee: Vincent Ladeuil (vila) → Jelmer Vernooij (jelmer)
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.