You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Karl Fogel <kf...@newton.ch.collab.net> on 2002/10/04 22:20:02 UTC

Re: non-interactive user authentication

Jeff Putsch <pu...@mxim.com> writes:
> I appreciate the fact the subversion allows both HTTP style (in the URL) and
> --username/--password style authentication. Unfortunately if either
> authentication fails subversion falls back to prompting the user
> for username and/or password. 
> 
> I am trying to write a specialized wrapper around subversion and 
> would prefer to have subversion never fall back to interactive queries.
> 
> Is there a way to prevent it from doing that?

Not yet, but it would be pretty easy to add a --non-interactive long
option (it could also be a ~/.subversion/config option, though that's
less important than having it available via the command line for
scripts).

My gosh, this is so easy, I think I'll just do it now.

-K


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: non-interactive user authentication

Posted by Peter Davis <pe...@pdavis.cx>.
Remember that this all could apply to other commands as well (see the thread 
about 'svn sync').  If svn decides to only prompt if authentication was not 
explicitely provided on the command line, then what about other commands that 
don't have any other way to turn off interactive mode?  What about 
alternative auth methods that don't use a user/pass scheme?

Keeping in mind the potential for other commands, I see three viable options:

(1) allow a --non-interactive switch

(2) commands are not interactive by default, and provide a --interactive (-i) 
switch

(3) all commands are not interactive, period.  Provide a p4-style interactive 
shell as an alternative.

The third option is too restrictive for a user-interface client, even if it is 
command line.  So that leaves #1 and #2.

Taking into account user friendlyness, that pretty much leaves #1.  With the 
potential for other interactive commands, it's too messy to have some complex 
heuristic determine whether enough information has been supplied explicitely 
on the command line to turn off interactive mode.

Why not just have --non-interactive as a global option, make authentication 
the first user of that option, and expect that future (non-)interactive 
commands will come around (and they will)?


> Before I revert the change, let's all decide here what the behavior of
> the ... options should be.

-- 
Peter Davis

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: non-interactive user authentication

Posted by Robert Schiele <rs...@uni-mannheim.de>.
On Mon, Oct 07, 2002 at 12:33:49AM -0500, Karl Fogel wrote:
> If you do
> 
>    $ svn --username=foo --password=bar
> 
> and the values are wrong (i.e., they do not successfully
> authenticate), should Subversion prompt, or should it just fail right
> away?
> 
> IMHO the latter, but this is largely a matter of behaving the way most
> other programs do, so I'd like to hear from others who may have more
> experience with authenticating clients.

I would also expect it to fail in that situation.

Robert

-- 
Robert Schiele			Tel.: +49-621-181-2517
Dipl.-Wirtsch.informatiker	mailto:rschiele@uni-mannheim.de

Re: non-interactive user authentication

Posted by Rafael Garcia-Suarez <ra...@hexaflux.com>.
Peter Schuller <pe...@infidyne.com> wrote:
> 
> Another issie is if the username and password on the server has become
> invalid since the last time you used the repository. Will svn prompt or
> fail?

Currently it prompts for an username/password. It also updates
the cached auth tokens. That's convenient.

Perhaps should it only prompt when stdin is not a tty ?

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: non-interactive user authentication

Posted by Paul Lussier <pl...@lanminds.com>.
In a message dated: Mon, 07 Oct 2002 12:32:24 PDT
Colin Putney said:

>We'd need the identity option for two reasons:
>
>1) Suppose you want to use an alternate identity? Ssh has the -i 
>option, but how do we know what to pass to it, if the user can't 
>specify an identity file?

Using rsync as an example:

	rsync -e ssh user@server:/some/path/copied/from /path/copied/to

In this case, rsync doesn't care whether the user invoking the 
command is the same as 'user@server', and it doesn't care how ssh 
authenticates.  The user in question may have used rsa or dsa, ssh 
figures all that out. 

So, how would you explicitly specify an alternate identity file to 
rsync over ssh, since rsync doesn't really provide a mechanism for 
passing ssh options to it?

I would provide a simple interface to something like ssh.  Let the 
user then configure ssh however they want.  Every authentication 
mechanism is going to have a "normal usage" and then some way to 
tweak it to the nth degree.  If you allow everything with all 
permutations, you'll quickly get bogged down in code that ultimately 
doesn't have anything to do with your intended goal;  to provide a 
killer revision control system.

(Just my $.000002 :)

>2) Under the "explicitly-specified" rule I proposed, script-writers 
>need a way to suppress interactive-resolution of failed authentication. 
>They'd use the --identity option to do that.

I would just opt to never prompt if the tokens were 
passed on the command line.  If the authentication fails, send the 
user an error stating that.  Adding all these options to "work 
around" things ends up muddying up the waters and leads to a lot of 
code to then maintain.  

As a user, I'd rather be told my authentication didn't work, than to 
be continually prompted for something which is never going to work, 
since the root cause is that my credentials are invalid.

>Please understand, I'm not proposing a scheme for ssh-based 
>authentication. I was just using that to illustrate how the 
>interactivity rule I proposed generalizes to other (hypothetical) 
>authentication schemes.

Understood, and "same here" :)

(although, looking through some of the Apach modules, there exist a 
couple (mod_auth_any and mod_auth_external) which look like they 
could be subverted for use with ssh if someone with the proper skills 
(i.e. not me) were a little creative).

>Consider that any authentication scheme should be able to draw 
>authentication information from three sources:
>
>1) Default values from a cache, a configuration, the user's 
>environment, etc.
>
>2) Values explicitly specified on the command line.
>
>3) Value obtained by prompting the user.
>
>The rule I propose specifies how to handle failure depending on where 
>the authentication came from.
>
>
>Colin Putney
>Whistler.com
>

-- 

Seeya,
Paul
--
	It may look like I'm just sitting here doing nothing,
   but I'm really actively waiting for all my problems to go away.

	 If you're not having fun, you're not doing it right!



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: non-interactive user authentication

Posted by Colin Putney <cp...@whistler.net>.
On Monday, October 7, 2002, at 11:26  AM, Paul Lussier wrote:

> In a message dated: Mon, 07 Oct 2002 11:19:49 PDT
> Colin Putney said:
>
>> So, for example, if we supported ssh key exchange, we'd need an 
>> --rsa-identity
>> option. No big deal.
>
> Why would you need this option?  If you support an ssh key exchange,
> wouldn't you delegate that to ssh and let ssh worry about the key
> exchange, since it already knows about the rsa identity?  For that
> matter, what if the person isn't using rsa, but opted to use dsa
> instead?

We'd need the identity option for two reasons:

1) Suppose you want to use an alternate identity? Ssh has the -i 
option, but how do we know what to pass to it, if the user can't 
specify an identity file?

2) Under the "explicitly-specified" rule I proposed, script-writers 
need a way to suppress interactive-resolution of failed authentication. 
They'd use the --identity option to do that.

Please understand, I'm not proposing a scheme for ssh-based 
authentication. I was just using that to illustrate how the 
interactivity rule I proposed generalizes to other (hypothetical) 
authentication schemes.

Consider that any authentication scheme should be able to draw 
authentication information from three sources:

1) Default values from a cache, a configuration, the user's 
environment, etc.

2) Values explicitly specified on the command line.

3) Value obtained by prompting the user.

The rule I propose specifies how to handle failure depending on where 
the authentication came from.


Colin Putney
Whistler.com


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: non-interactive user authentication

Posted by Paul Lussier <pl...@lanminds.com>.
In a message dated: Mon, 07 Oct 2002 11:19:49 PDT
Colin Putney said:

>So, for example, if we supported ssh key exchange, we'd need an --rsa-identity 
>option. No big deal.

Why would you need this option?  If you support an ssh key exchange, 
wouldn't you delegate that to ssh and let ssh worry about the key 
exchange, since it already knows about the rsa identity?  For that 
matter, what if the person isn't using rsa, but opted to use dsa 
instead?

-- 

Seeya,
Paul
--
	It may look like I'm just sitting here doing nothing,
   but I'm really actively waiting for all my problems to go away.

	 If you're not having fun, you're not doing it right!



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: non-interactive user authentication

Posted by Paul Lussier <pl...@lanminds.com>.
In a message dated: 07 Oct 2002 14:07:35 CDT
Karl Fogel said:

>There's still the question of how to behave when updating a working
>copy that has auth info which is no longer valid on the server.

In general, wouldn't you expect a failure message stating that the 
authentication failed rather than a prompt?

If the auth info on the server is for some reason invalid, then why 
would prompting help?  For instance, if an htpasswd file got replaced 
and the username/password in the script were no longer in it, or the 
password changed, isn't it safer to assume that the user in question 
is probably not aware of such a change, and therefore, doesn't have 
the correct auth tokens to pass?

In this case, the user needs to see the system/repository administrator 
to determine what the problem is.  Continuing to prompt isn't going 
to help anyone.

>Let me expand this to the general problem:
>
>Subversion has some commands that, in some circumstances, can prompt
>the user for information.  Any script that runs such commands may need
>a `--non-interactive' option to suppress the prompting, because the
>script can't always control whether or not the prompt-causing
>circumstances will arise.
>
>We can get rid of the option, but only if we also *never* prompt as a
>default fallback behavior.
>
>Do we want that?

I think it's the safer way to go.  If the user can't be 
authenticated, exit with an error stating that the authentication 
failed.  At least now they know *something*.  Continuing to prompt 
just gets them frustrated, since they feel they passed the correct 
info the first time.
-- 

Seeya,
Paul
--
	It may look like I'm just sitting here doing nothing,
   but I'm really actively waiting for all my problems to go away.

	 If you're not having fun, you're not doing it right!



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: non-interactive user authentication

Posted by Colin Putney <cp...@whistler.net>.
On Monday, October 7, 2002, at 12:41  PM, Karl Fogel wrote:

> Colin Putney <cp...@whistler.net> writes:
>> The rule still applies. If auth info is specified on the command line,
>> use that info to authenticate. If authentication fails, the command
>> fails with an appropriate error. Otherwise, prompt.
>
> No, I'm talking about when the user *doesn't* specify the info on the
> command line.

Yes, I understand. That would fall under "otherwise, prompt."

>> Ah, this is a problem. The "explicit-auth" rule only works if the
>> prompting is necessary because of failed authentication. A script
>> shouldn't have to supply auth information for commands that don't
>> touch the repository. In that case, a --non-interactive flag is,
>> indeed, necessary.
>
> What I mean is, there are some commands that touch the repository, but
> which you can invoke *without* providing explicit auth info on the
> command line (instead, it's derived from the working copy -- or maybe
> it's absent entirely, because formerly the repository did not require
> auth and now suddenly it does).

Again, the rule still applies, and the use case falls under 
"otherwise." If the user invokes a command without providing auth 
information explicitly, and if authentication fails for whatever 
reason, prompt for new auth info.

The rule is simple enough to be unambiguous for all cases involving 
authentication. It falls down when there's a need to interact with the 
user that is not related to authentication. I don't know what those 
cases might be, but it doesn't seem appropriated to link their 
behaviour to the presence of authentication command-line options.

Colin Putney
Whistler.com


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: non-interactive user authentication

Posted by Karl Fogel <kf...@newton.ch.collab.net>.
Colin Putney <cp...@whistler.net> writes:
> The rule still applies. If auth info is specified on the command line,
> use that info to authenticate. If authentication fails, the command
> fails with an appropriate error. Otherwise, prompt.

No, I'm talking about when the user *doesn't* specify the info on the
command line.

> Ah, this is a problem. The "explicit-auth" rule only works if the
> prompting is necessary because of failed authentication. A script
> shouldn't have to supply auth information for commands that don't
> touch the repository. In that case, a --non-interactive flag is,
> indeed, necessary.

What I mean is, there are some commands that touch the repository, but
which you can invoke *without* providing explicit auth info on the
command line (instead, it's derived from the working copy -- or maybe
it's absent entirely, because formerly the repository did not require
auth and now suddenly it does).

-K

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: non-interactive user authentication

Posted by Colin Putney <cp...@whistler.net>.
On Monday, October 7, 2002, at 12:07  PM, Karl Fogel wrote:

> There's still the question of how to behave when updating a working
> copy that has auth info which is no longer valid on the server.

The rule still applies. If auth info is specified on the command line, 
use that info to authenticate. If authentication fails, the command 
fails with an appropriate error. Otherwise, prompt.

I leave the question of whether to update the working copy to others.

> Let me expand this to the general problem:
>
> Subversion has some commands that, in some circumstances, can prompt
> the user for information.  Any script that runs such commands may need
> a `--non-interactive' option to suppress the prompting, because the
> script can't always control whether or not the prompt-causing
> circumstances will arise.

Ah, this is a problem. The "explicit-auth" rule only works if the 
prompting is necessary because of failed authentication. A script 
shouldn't have to supply auth information for commands that don't touch 
the repository. In that case, a --non-interactive flag is, indeed, 
necessary.

> We can get rid of the option, but only if we also *never* prompt as a
> default fallback behavior.
>
> Do we want that?

Beats me.

Colin Putney
Whistler.com


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: non-interactive user authentication

Posted by Karl Fogel <kf...@newton.ch.collab.net>.
There's still the question of how to behave when updating a working
copy that has auth info which is no longer valid on the server.

Let me expand this to the general problem:

Subversion has some commands that, in some circumstances, can prompt
the user for information.  Any script that runs such commands may need
a `--non-interactive' option to suppress the prompting, because the
script can't always control whether or not the prompt-causing
circumstances will arise.

We can get rid of the option, but only if we also *never* prompt as a
default fallback behavior.

Do we want that?

-K

Colin Putney <cp...@whistler.net> writes:
> I'd stick to this simple rule of thumb:
> 
> If the authentication information has been provided explicitly on the
> command line, but does not resulting in successful authentication,
> fail with an appropriate error. Otherwise, prompt the user.
> 
> This would mean prompting when implicitly supplied authentication
> information (such as cached tokens) is unsuccessful, or when it's
> simply not available. The common use case for this  would be a regular
> user, which fits.
> 
> Script writers need only be explicit about how to authenticate in
> order to get the behaviour they want. Subversion should supply a long
> option for each type of authentication information it can use. So, for
> example, if we supported ssh key exchange, we'd need an --rsa-identity
> option. No big deal.
> 
> The failure modes here aren't too bad. Script writers who run into
> problems because of the prompt have a clear and easy way to deal with
> it - they just add an option to their command line. Users who go to
> the trouble of explicitly supplying authentication information on the
> command line aren't going to be put out when they receive and error
> message instead of a prompt. We can assume their doing things the hard
> way for a reason and can deal with the results.
> 
> 
> 
> Colin Putney
> Whistler.com
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: non-interactive user authentication

Posted by Colin Putney <cp...@whistler.net>.
On Monday, October 7, 2002, at 08:25  AM, Karl Fogel wrote:

> You might write your script to use --username and --password, and we
> might make Subversion fail out if they are invalid, but what if the
> server's entire authentication method changes after the working copy
> is checked out?  For regular users, one reasonable behavior is to
> prompt for new information -- it's very convenient.  But then we're
> back to wanting a --non-interactive flag for scripts...

I'd stick to this simple rule of thumb:

If the authentication information has been provided explicitly on the 
command line, but does not resulting in successful authentication, fail 
with an appropriate error. Otherwise, prompt the user.

This would mean prompting when implicitly supplied authentication 
information (such as cached tokens) is unsuccessful, or when it's 
simply not available. The common use case for this  would be a regular 
user, which fits.

Script writers need only be explicit about how to authenticate in order 
to get the behaviour they want. Subversion should supply a long option 
for each type of authentication information it can use. So, for 
example, if we supported ssh key exchange, we'd need an --rsa-identity 
option. No big deal.

The failure modes here aren't too bad. Script writers who run into 
problems because of the prompt have a clear and easy way to deal with 
it - they just add an option to their command line. Users who go to the 
trouble of explicitly supplying authentication information on the 
command line aren't going to be put out when they receive and error 
message instead of a prompt. We can assume their doing things the hard 
way for a reason and can deal with the results.



Colin Putney
Whistler.com


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: non-interactive user authentication

Posted by Kevin Pilch-Bisson <ke...@pilch-bisson.net>.
On Mon, Oct 07, 2002 at 03:45:41PM -0500, Karl Fogel wrote:
> Branko ??ibej <br...@xbc.nu> writes:
> > I have a few of those, too -- some of them do updates from
> > repositories that require authentication for reading, not just for
> > writing. I get by by either explicitly passing --password, or setting
> > things up so that the auth info is populated in the working copies. If
> > they're not very complex scripts, then I guess it's to be expected
> > that they requre pretty precise set-up.
> 
> Hmmm.  It's likely you didn't miss it the first time I said it, but
> I'll reiterate just in case: no matter how carefully someone sets up
> their client-side script, if they don't control the repository,
> there's always the chance that something on the server will change and
> the client will suddenly start prompting.
> 
> Which is why part of that "precise setup" may needs to involve passing
> the --non-interactive option. (?)
> 
I disagree, it needs to pass --username="" --password="" so it will fail if
the repos changes to require auth.
-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Kevin Pilch-Bisson                    http://www.pilch-bisson.net
     "Historically speaking, the presences of wheels in Unix
     has never precluded their reinvention." - Larry Wall
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Re: non-interactive user authentication

Posted by Kevin Pilch-Bisson <ke...@pilch-bisson.net>.
On Mon, Oct 07, 2002 at 10:24:10PM +0100, Philip Martin wrote:
> Kevin Pilch-Bisson <ke...@pilch-bisson.net> writes:
> 
> > On Mon, Oct 07, 2002 at 10:16:40PM +0100, Philip Martin wrote:
> > > Kevin Pilch-Bisson <ke...@pilch-bisson.net> writes:
> > > 
> > > > I don't see the problem with either of:
> > > > 1) Never prompt at all
> > > 
> > > Allowing people to specify --username/--password is OK, but requiring
> > > them to do it is not acceptable since passing such information via the
> > > command line can be a security risk.
> > > 
> > Right, so once their script fails with the empty uname/password, they can set
> > it up to use a cached one.
> 
> How do they do that if there is never a prompt?  The security risk is
> not just putting the stuff in a script, it's also a risk putting it on
> the process's command line where it is visible to other processes.
> 
They run the command manually without (--username and --password) and pass the
info when it prompts then, and let it be stored in the cache.  Then they run
the script again, but now they take the --username and --password out.
Problem is, no, if the password gets changed, do they get a prompt?

Hmm this is tricky.

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Kevin Pilch-Bisson                    http://www.pilch-bisson.net
     "Historically speaking, the presences of wheels in Unix
     has never precluded their reinvention." - Larry Wall
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Re: non-interactive user authentication

Posted by Paul Lussier <pl...@lanminds.com>.
In a message dated: 07 Oct 2002 22:24:10 BST
Philip Martin said:

>> Right, so once their script fails with the empty uname/password, they can set
>> it up to use a cached one.
>
>How do they do that if there is never a prompt?  The security risk is
>not just putting the stuff in a script, it's also a risk putting it on
>the process's command line where it is visible to other processes.

Well, using ssh again as an example, there is ssh-agent which caches 
my usernames and passphrases for a variety of systems and identities.

When I need to ssh or rsync from/to another system, I'm never 
prompted for any credentials, ssh simply queries the ssh-agent which 
has them securely cached (i.e. there's no command line which might 
show up in 'ps' output).

Since CVS has the CVS_RSH command, I've often taken advantage of 
setting that to 'ssh', which again, will query ssh-agent.

Yes, the user still has to input a username and passphrase, for which 
they are prompted, but not by cvs or rsync, but by ssh-agent when 
that gets fired up.
-- 

Seeya,
Paul
--
	It may look like I'm just sitting here doing nothing,
   but I'm really actively waiting for all my problems to go away.

	 If you're not having fun, you're not doing it right!



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: non-interactive user authentication

Posted by Philip Martin <ph...@codematters.co.uk>.
Kevin Pilch-Bisson <ke...@pilch-bisson.net> writes:

> On Mon, Oct 07, 2002 at 10:16:40PM +0100, Philip Martin wrote:
> > Kevin Pilch-Bisson <ke...@pilch-bisson.net> writes:
> > 
> > > I don't see the problem with either of:
> > > 1) Never prompt at all
> > 
> > Allowing people to specify --username/--password is OK, but requiring
> > them to do it is not acceptable since passing such information via the
> > command line can be a security risk.
> > 
> Right, so once their script fails with the empty uname/password, they can set
> it up to use a cached one.

How do they do that if there is never a prompt?  The security risk is
not just putting the stuff in a script, it's also a risk putting it on
the process's command line where it is visible to other processes.

-- 
Philip Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: non-interactive user authentication

Posted by Kevin Pilch-Bisson <ke...@pilch-bisson.net>.
On Mon, Oct 07, 2002 at 10:16:40PM +0100, Philip Martin wrote:
> Kevin Pilch-Bisson <ke...@pilch-bisson.net> writes:
> 
> > I don't see the problem with either of:
> > 1) Never prompt at all
> 
> Allowing people to specify --username/--password is OK, but requiring
> them to do it is not acceptable since passing such information via the
> command line can be a security risk.
> 
Right, so once their script fails with the empty uname/password, they can set
it up to use a cached one.
-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Kevin Pilch-Bisson                    http://www.pilch-bisson.net
     "Historically speaking, the presences of wheels in Unix
     has never precluded their reinvention." - Larry Wall
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Re: non-interactive user authentication

Posted by Philip Martin <ph...@codematters.co.uk>.
Kevin Pilch-Bisson <ke...@pilch-bisson.net> writes:

> I don't see the problem with either of:
> 1) Never prompt at all

Allowing people to specify --username/--password is OK, but requiring
them to do it is not acceptable since passing such information via the
command line can be a security risk.

-- 
Philip Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: non-interactive user authentication

Posted by Kevin Pilch-Bisson <ke...@pilch-bisson.net>.
On Mon, Oct 07, 2002 at 10:32:34PM +0200, Branko ??ibej wrote:
> Karl Fogel wrote:
> 
> >Branko ??ibej <br...@xbc.nu> writes:
> > 
> >
> >>I think the first order of business is to make a clean separation
> >>between the libraries and the client program. IIRC, right now the
> >>prompt is coming from the RA lib. Instead, the lib should simply
> >>return an error if authentication fails; then the client can decide
> >>about prompting or not.
> >>   
> >>
> >
> >I thought it is ultimately the client deciding whether or not to
> >prompt?  The RA layer just calls a client-supplied routine to get auth
> >info.  What that routine does is up to it.
> >
> > 
> >
> >>The next problem is what to do with the failure in the client. IMHO,
> >>if any auth tokens were passed in explicitly on the command line, it
> >>should not prompt -- the user had her shot, and missed.
> >>   
> >>
> >
> >Yes, I'm fine with that, but we still have to handle the circumstance
> >where subversion might prompt when the tokens were *not* passed on the
> >command line.
> >
> 
> Right. I'm beginning to wonder whether we should prompt at all, and the 
> answer is far from simple.

I don't see the problem with either of:
1) Never prompt at all
2) Prompt unless --username --password are specified (even if empty), and
encouraging people writing scripts to always pass them.

I personally like (2), since we also have the EDITOR business, what if a
script commits, has editor set, and doesn't specify -m or -F?


> 
> Now, none of this is a problem ina purely interactive environment. The 
> problems we're discussing only show up when the "svn" command is being 
> scripted. A simple way out is to simply say that any script that's 
> complex enough to have to bother with authentication should use the swig 
> wrappers instead. :-)
> 
> Anyway, I'm glad we're having this discussion, because it shows that 
> even features that are simple to implement can involve complex design 
> decisions.
> 
> -- 
> Brane ??ibej   <br...@xbc.nu>   http://www.xbc.nu/brane/
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org
> 

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Kevin Pilch-Bisson                    http://www.pilch-bisson.net
     "Historically speaking, the presences of wheels in Unix
     has never precluded their reinvention." - Larry Wall
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Re: non-interactive user authentication

Posted by Karl Fogel <kf...@newton.ch.collab.net>.
Branko Čibej <br...@xbc.nu> writes:
> I have a few of those, too -- some of them do updates from
> repositories that require authentication for reading, not just for
> writing. I get by by either explicitly passing --password, or setting
> things up so that the auth info is populated in the working copies. If
> they're not very complex scripts, then I guess it's to be expected
> that they requre pretty precise set-up.

Hmmm.  It's likely you didn't miss it the first time I said it, but
I'll reiterate just in case: no matter how carefully someone sets up
their client-side script, if they don't control the repository,
there's always the chance that something on the server will change and
the client will suddenly start prompting.

Which is why part of that "precise setup" may needs to involve passing
the --non-interactive option. (?)


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: non-interactive user authentication

Posted by Branko Čibej <br...@xbc.nu>.
Karl Fogel wrote:

>Branko Čibej <br...@xbc.nu> writes:
>  
>
>>Now, none of this is a problem ina purely interactive environment. The
>>problems we're discussing only show up when the "svn" command is being
>>scripted. A simple way out is to simply say that any script that's
>>complex enough to have to bother with authentication should use the
>>swig wrappers instead. :-)
>>    
>>
>
>s/simple/wrong/ :-).
>
:-)

>Anyway we're not talking about very complex scripts here -- we're
>talking about scripts that run 'svn update'.  I've already got at
>least three of those.
>  
>
I have a few of those, too -- some of them do updates from repositories 
that require authentication for reading, not just for writing. I get by 
by either explicitly passing --password, or setting things up so that 
the auth info is populated in the working copies. If they're not very 
complex scripts, then I guess it's to be expected that they requre 
pretty precise set-up.

-- 
Brane Čibej   <br...@xbc.nu>   http://www.xbc.nu/brane/


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: non-interactive user authentication

Posted by Karl Fogel <kf...@newton.ch.collab.net>.
Branko Čibej <br...@xbc.nu> writes:
> Now, none of this is a problem ina purely interactive environment. The
> problems we're discussing only show up when the "svn" command is being
> scripted. A simple way out is to simply say that any script that's
> complex enough to have to bother with authentication should use the
> swig wrappers instead. :-)

s/simple/wrong/ :-).

Anyway we're not talking about very complex scripts here -- we're
talking about scripts that run 'svn update'.  I've already got at
least three of those.

> Anyway, I'm glad we're having this discussion, because it shows that
> even features that are simple to implement can involve complex design
> decisions.

Yup.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: non-interactive user authentication

Posted by Branko Čibej <br...@xbc.nu>.
Karl Fogel wrote:

>Branko Čibej <br...@xbc.nu> writes:
>  
>
>>I think the first order of business is to make a clean separation
>>between the libraries and the client program. IIRC, right now the
>>prompt is coming from the RA lib. Instead, the lib should simply
>>return an error if authentication fails; then the client can decide
>>about prompting or not.
>>    
>>
>
>I thought it is ultimately the client deciding whether or not to
>prompt?  The RA layer just calls a client-supplied routine to get auth
>info.  What that routine does is up to it.
>
>  
>
>>The next problem is what to do with the failure in the client. IMHO,
>>if any auth tokens were passed in explicitly on the command line, it
>>should not prompt -- the user had her shot, and missed.
>>    
>>
>
>Yes, I'm fine with that, but we still have to handle the circumstance
>where subversion might prompt when the tokens were *not* passed on the
>command line.
>

Right. I'm beginning to wonder whether we should prompt at all, and the 
answer is far from simple.

Now, none of this is a problem ina purely interactive environment. The 
problems we're discussing only show up when the "svn" command is being 
scripted. A simple way out is to simply say that any script that's 
complex enough to have to bother with authentication should use the swig 
wrappers instead. :-)

Anyway, I'm glad we're having this discussion, because it shows that 
even features that are simple to implement can involve complex design 
decisions.

-- 
Brane Čibej   <br...@xbc.nu>   http://www.xbc.nu/brane/


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: non-interactive user authentication

Posted by Karl Fogel <kf...@newton.ch.collab.net>.
Branko Čibej <br...@xbc.nu> writes:
> I think the first order of business is to make a clean separation
> between the libraries and the client program. IIRC, right now the
> prompt is coming from the RA lib. Instead, the lib should simply
> return an error if authentication fails; then the client can decide
> about prompting or not.

I thought it is ultimately the client deciding whether or not to
prompt?  The RA layer just calls a client-supplied routine to get auth
info.  What that routine does is up to it.

> The next problem is what to do with the failure in the client. IMHO,
> if any auth tokens were passed in explicitly on the command line, it
> should not prompt -- the user had her shot, and missed.

Yes, I'm fine with that, but we still have to handle the circumstance
where subversion might prompt when the tokens were *not* passed on the
command line.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: non-interactive user authentication

Posted by Branko Čibej <br...@xbc.nu>.
Karl Fogel wrote:

>Peter Schuller <pe...@infidyne.com> writes:
>  
>
>>Another issie is if the username and password on the server has become
>>invalid since the last time you used the repository. Will svn prompt or
>>fail?
>>    
>>
>
>Yeah, this is a variation of a general scenario I realized this
>morning.
>
>You might write your script to use --username and --password, and we
>might make Subversion fail out if they are invalid, but what if the
>server's entire authentication method changes after the working copy
>is checked out?  For regular users, one reasonable behavior is to
>prompt for new information -- it's very convenient.  But then we're
>back to wanting a --non-interactive flag for scripts...
>
>Mrm.  Hmmm.
>
>We can't be the first project to encounter this problem.  Is there
>already a convention about how to handle it, or do different programs
>do different things?
>
>(Re detecting whether stdin is a tty, is that really reliable?  We'd
>need to add it to APR, at any rate...)
>  
>

I think the first order of business is to make a clean separation 
between the libraries and the client program. IIRC, right now the prompt 
is coming from the RA lib. Instead, the lib should simply return an 
error if authentication fails; then the client can decide about 
prompting or not.

The next problem is what to do with the failure in the client. IMHO, if 
any auth tokens were passed in explicitly on the command line, it should 
not prompt -- the user had her shot, and missed.

-- 
Brane Čibej   <br...@xbc.nu>   http://www.xbc.nu/brane/


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: non-interactive user authentication

Posted by pl...@lanminds.com.
In a message dated: 07 Oct 2002 11:40:14 CDT
Karl Fogel said:

>Paul Lussier <pl...@lanminds.com> writes:
>> I'm not advocating ssh as the only mechanism, just that an external, 
>> modular approach might be best.  For instance, rsync allows the use 
>> of either rsh or ssh.  Couldn't svn do the same?

>You tell me :-). 

I can't, I don't know much about svn, I just started playing with it 
last week.  And I'm not a developer, I'm a sysadmin with a little 
spare time right now :)

Perhaps I'm confused about exactly what the issues are here.  It 
appeared to me that someone was looking for a better way to 
authenticate such that they didn't have to always enter a username 
and password, and this is something that rsync solves by delegating 
the authentication off to rsh/ssh.

>If Apache can support it, our client should be able
>to do it.  The auth mechanisms supported by our server have already
>been decided for us...

So, the svn server limited only to what apache supports?  Is that 
because of the integration of the WebDAV/DeltaV stuff?
(remeber, I'm new to svn, and really haven't digested all of 
how it works yet)

>Of course, there's always tunneling over some secure protocol.  I'm
>talking about other auth methods used with http, besides that
>technique.

I wonder if there's a way for Apache to delegate the auth mechanism 
to something external to itself such as I suggested?  Hmmm.  That 
would make for some neat combinations...

I guess the short answer is, if the auth is limited to what Apache 
supports, and Apache doesn't support external "plug in" type auth 
mechanisms, then my suggestion is overly helpful :(

Sorry.
-- 

Seeya,
Paul
--
	It may look like I'm just sitting here doing nothing,
   but I'm really actively waiting for all my problems to go away.

	 If you're not having fun, you're not doing it right!



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: non-interactive user authentication

Posted by Karl Fogel <kf...@newton.ch.collab.net>.
Paul Lussier <pl...@lanminds.com> writes:
> I'm not advocating ssh as the only mechanism, just that an external, 
> modular approach might be best.  For instance, rsync allows the use 
> of either rsh or ssh.  Couldn't svn do the same?

You tell me :-).  If Apache can support it, our client should be able
to do it.  The auth mechanisms supported by our server have already
been decided for us...

Of course, there's always tunneling over some secure protocol.  I'm
talking about other auth methods used with http, besides that
technique.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: non-interactive user authentication

Posted by Paul Lussier <pl...@lanminds.com>.
In a message dated: 07 Oct 2002 10:25:19 CDT
Karl Fogel said:

>Peter Schuller <pe...@infidyne.com> writes:
>> Another issie is if the username and password on the server has become
>> invalid since the last time you used the repository. Will svn prompt or
>> fail?
>
>Mrm.  Hmmm.
>
>We can't be the first project to encounter this problem.  Is there
>already a convention about how to handle it, or do different programs
>do different things?
>
>(Re detecting whether stdin is a tty, is that really reliable?  We'd
>need to add it to APR, at any rate...)

Why not use an external authentication mechanism like ssh/rsh.  This 
is similar to what rsync does.  There really isn't any built-in auth 
mechanism to rsync, but you have to have access to the server itself 
to connect using rsync.

You could have an auth switch to svn which worked like:

	svn -e ssh user@host:/path/to/repository

Or something, then pass the auth portion off to something completely 
external to svn, like ssh.

With this in place, one could use ssh keys on the server, which would 
completely eliminate the need for entering usernames and passwords/phrases,
provided something like ssh-agent were employed by the user.

I'm not advocating ssh as the only mechanism, just that an external, 
modular approach might be best.  For instance, rsync allows the use 
of either rsh or ssh.  Couldn't svn do the same?
-- 

Seeya,
Paul
--
	It may look like I'm just sitting here doing nothing,
   but I'm really actively waiting for all my problems to go away.

	 If you're not having fun, you're not doing it right!



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: non-interactive user authentication

Posted by Karl Fogel <kf...@newton.ch.collab.net>.
Peter Schuller <pe...@infidyne.com> writes:
> Another issie is if the username and password on the server has become
> invalid since the last time you used the repository. Will svn prompt or
> fail?

Yeah, this is a variation of a general scenario I realized this
morning.

You might write your script to use --username and --password, and we
might make Subversion fail out if they are invalid, but what if the
server's entire authentication method changes after the working copy
is checked out?  For regular users, one reasonable behavior is to
prompt for new information -- it's very convenient.  But then we're
back to wanting a --non-interactive flag for scripts...

Mrm.  Hmmm.

We can't be the first project to encounter this problem.  Is there
already a convention about how to handle it, or do different programs
do different things?

(Re detecting whether stdin is a tty, is that really reliable?  We'd
need to add it to APR, at any rate...)


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: non-interactive user authentication

Posted by Peter Schuller <pe...@infidyne.com>.
> If you do
> 
>    $ svn --username=foo --password=bar
> 
> and the values are wrong (i.e., they do not successfully
> authenticate), should Subversion prompt, or should it just fail right
> away?

Fail, IMO. But there is another issue I don't think has been mentioned
yet - that of already checked out copies.

I don't remember what the current behavior is, but how svn should act is
a difficult question.

Is it currently possible to created a checked out version of a
repository that stores the username and URL, but not the password (or
will it be possible in the future)? If so, is the normal expected
behavior for svn to prompt, or to fail saying a password needs to
be provided? If the former, it should be possible to disable it.
But then it is easily forgotten until you run into it.

Another issie is if the username and password on the server has become
invalid since the last time you used the repository. Will svn prompt or
fail?

Perhaps SVN should never prompt unless given explicit instructions to do
so? That way its behavior is more consistent "by default", and there is
one less trap to fall into with respect to bullet proof scripting.

(To be nice to users, it could fail with a message indicating what to do
in order to enable prompting.)

-- 
/ Peter Schuller, InfiDyne Technologies HB

PGP userID: 0xE9758B7D or 'Peter Schuller <pe...@infidyne.com>'
Key retrival: Send an E-Mail to getpgpkey@scode.org
E-Mail: peter.schuller@infidyne.com Web: http://www.scode.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: non-interactive user authentication

Posted by Karl Fogel <kf...@newton.ch.collab.net>.
Scott Lamb <sl...@slamb.org> writes:
> How do you say "fail if authentication is required" otherwise?

Okay.  Hmmm...

Before I revert the change, let's all decide here what the behavior of
the old options should be.

If you do

   $ svn --username=foo --password=bar

and the values are wrong (i.e., they do not successfully
authenticate), should Subversion prompt, or should it just fail right
away?

IMHO the latter, but this is largely a matter of behaving the way most
other programs do, so I'd like to hear from others who may have more
experience with authenticating clients.

For the record, I am ready & willing (indeed, happy) to revert the
"--non-interactive" option code if we decide on the latter.

-Karl

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: non-interactive user authentication

Posted by Branko Čibej <br...@xbc.nu>.
Scott Lamb wrote:

> Branko Čibej wrote:
>
>>> Not yet, but it would be pretty easy to add a --non-interactive long
>>> option (it could also be a ~/.subversion/config option, though that's
>>> less important than having it available via the command line for
>>> scripts).
>>
>>
>> Please don't ... aargh, you already have. I think this was a bad 
>> move. It's better to fix the code than to add yet another option: If 
>> you already passed a --username and --password, or if your url is 
>> http://user:pass@foo/..., then why on earth would you have to pass 
>> --non-interactive to suppress the password dialogue, too?
>
>
> How do you say "fail if authentication is required" otherwise?


It should be as simple as providing an empy username and/or passworkd 
via the existing options.

-- 
Brane Čibej   <br...@xbc.nu>   http://www.xbc.nu/brane/


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: non-interactive user authentication

Posted by Scott Lamb <sl...@slamb.org>.
Branko Čibej wrote:
>> Not yet, but it would be pretty easy to add a --non-interactive long
>> option (it could also be a ~/.subversion/config option, though that's
>> less important than having it available via the command line for
>> scripts).
> 
> Please don't ... aargh, you already have. I think this was a bad move. 
> It's better to fix the code than to add yet another option: If you 
> already passed a --username and --password, or if your url is 
> http://user:pass@foo/..., then why on earth would you have to pass 
> --non-interactive to suppress the password dialogue, too?

How do you say "fail if authentication is required" otherwise?

Scott


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: non-interactive user authentication

Posted by Karl Fogel <kf...@newton.ch.collab.net>.
Garrett Rooney <ro...@electricjellyfish.net> writes:
> > Please don't ... aargh, you already have. I think this was a bad
> > move. It's better to fix the code than to add yet another option: If
> > you already passed a --username and --password, or if your url is
> > http://user:pass@foo/..., then why on earth would you have to pass
> > --non-interactive to suppress the password dialogue, too? That just
> > doesn't make sense -- we're beginning to accumulate one-shot options
> > at an alarming rate. And not writing tests for them, may I add.
> 
> FWIW, I agree.  This option doesn't make much sense to me...

Hmmm, Brane's and your reasonings make sense to me.  Wish I'd thought
that carefully before coding it up.

I'll revert the new-code portion of the change, while leaving the
documentation fixes (which were needed anyway).

Please note that, in general, I see nothing wrong with accumulating
one-shot options :-).  This particular one is not necessary, though.

-Karl

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: non-interactive user authentication

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On Saturday, October 5, 2002, at 11:05 PM, Branko Čibej wrote:

> Please don't ... aargh, you already have. I think this was a bad move. 
> It's better to fix the code than to add yet another option: If you 
> already passed a --username and --password, or if your url is 
> http://user:pass@foo/..., then why on earth would you have to pass 
> --non-interactive to suppress the password dialogue, too? That just 
> doesn't make sense -- we're beginning to accumulate one-shot options 
> at an alarming rate. And not writing tests for them, may I add.

FWIW, I agree.  This option doesn't make much sense to me...

-garrett

-- 
garrett rooney                    Remember, any design flaw you're
rooneg@electricjellyfish.net      sufficiently snide about becomes
http://electricjellyfish.net/     a feature.       -- Dan Sugalski


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: non-interactive user authentication

Posted by Branko Čibej <br...@xbc.nu>.
Karl Fogel wrote:

>Jeff Putsch <pu...@mxim.com> writes:
>  
>
>>I appreciate the fact the subversion allows both HTTP style (in the URL) and
>>--username/--password style authentication. Unfortunately if either
>>authentication fails subversion falls back to prompting the user
>>for username and/or password. 
>>
>>I am trying to write a specialized wrapper around subversion and 
>>would prefer to have subversion never fall back to interactive queries.
>>
>>Is there a way to prevent it from doing that?
>>    
>>
>
>Not yet, but it would be pretty easy to add a --non-interactive long
>option (it could also be a ~/.subversion/config option, though that's
>less important than having it available via the command line for
>scripts).
>
>My gosh, this is so easy, I think I'll just do it now.
>  
>

Please don't ... aargh, you already have. I think this was a bad move. 
It's better to fix the code than to add yet another option: If you 
already passed a --username and --password, or if your url is 
http://user:pass@foo/..., then why on earth would you have to pass 
--non-interactive to suppress the password dialogue, too? That just 
doesn't make sense -- we're beginning to accumulate one-shot options at 
an alarming rate. And not writing tests for them, may I add.

-- 
Brane Čibej   <br...@xbc.nu>   http://www.xbc.nu/brane/


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: non-interactive user authentication

Posted by Ben Collins-Sussman <su...@collab.net>.
Jeff Putsch <pu...@mxim.com> writes:
> > I appreciate the fact the subversion allows both HTTP style (in the URL) and
> > --username/--password style authentication. Unfortunately if either
> > authentication fails subversion falls back to prompting the user
> > for username and/or password. 

You mean, just like CVS?  Or does CVS have a --no-interactive-mode, so
it's not a problem?


> > I am trying to write a specialized wrapper around subversion and 
> > would prefer to have subversion never fall back to interactive queries.

You could also just use libsvn_client.so.  But maybe that's going overboard.

Karl Fogel <kf...@newton.ch.collab.net> writes:
> 
> My gosh, this is so easy, I think I'll just do it now.


Cool!

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org