You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Ryan Vordermann <rv...@gmail.com> on 2013/01/31 21:01:19 UTC

Default values for args to svn_cmdline_create_auth_baton

Hi,

My name is Ryan. I'm not subscribed to this list so I would appreciate
being CC'ed on responses

I'm working on a utility that uses the svn client api. Right now it works,
 but I want to add support for usernames and passwords. I do not (yet)
want to support any of the other security features.  What are the
 appropriate values for the following arguments to this function?

svn_cmdline_create_auth_baton

Currently I have this:
svn_boolean_t non_interactive = FALSE;
const char *config_dir = NULL;
svn_boolean_t no_auth_cache = FALSE;
svn_boolean_t trust_server_cert = FALSE;
svn_config_t *cfg_config = NULL;

Which so far works, but I was just taking a WAG.

Thanks in advance,
Ryan Vordermann

Re: Default values for args to svn_cmdline_create_auth_baton

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Ryan Vordermann wrote on Sun, Feb 17, 2013 at 11:13:36 -0700:
> On Sun, Feb 17, 2013 at 2:51 AM, Daniel Shahaf <d....@daniel.shahaf.name> wrote:
> >> On Fri, Feb 1, 2013 at 11:31 AM, Daniel Shahaf <d....@daniel.shahaf.name> wrote:
> >> > Daniel Shahaf wrote on Fri, Feb 01, 2013 at 19:15:04 +0200:
> >> >> > want to support any of the other security features.  What are the
> >> >> >  appropriate values for the following arguments to this function?
> >> >> >
> >> >> > svn_cmdline_create_auth_baton
> >> >> >
> >> >> > Currently I have this:
> >> >> > svn_boolean_t non_interactive = FALSE;
> >>
> >> >> Basically this is "may prompt".  The "plaintext" and "SSL certificate"
> >> >> prompt depend on this.
> >>
> >> OH. Does this part depend a call back then for the prompt?
> >>
> >
> > Your English doesn't parse.  Anyway, the code (somewhere in libsvn_subr)
> > will not call the "plaintext prompt" if "non_interactive" is TRUE.
> 
> Sorry, what I should have said was, if non-interactive is false, do I
> have the plain
> text prompt (like when providing a message for commits), or is that a
> function somewhere?

If you work at the libsvn_client level, and don't use any svn_cmdline_*
functions, you won't get the default plaintext prompt that svn uses
(becauses that one uses /dev/tty or stderr, and libsvn_client may use
neither of them).  I don't recall what's the canonical way to set the
svn_auth_plaintext_prompt_func_t --- whether you should use svn_auth_*
directly, or whether libsvn_client wraps it for you somehow.  But I
guess it's the former.

Re: Default values for args to svn_cmdline_create_auth_baton

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Ryan Vordermann wrote on Sat, Feb 16, 2013 at 19:00:34 -0700:
> Daniel,
> 
> Thank you for prompt response. I'm sorry I haven't returned the
> courtesy. I'm a full time student and I work with two jobs. One of

Busy man!

> them is closing on the ship date for their first product so things are
> busy. I copied and pasted material from your first email, to put the
> answer into one. Is that okay?
> 

Yeah there's some latitude when replying to split or join multiple posts
into one reply.  The points to keep in mind are threaded MUAs + "one
logical change per commit" (or the equivalent for mail threads that have
diverged into multiple topics).

> On Fri, Feb 1, 2013 at 11:31 AM, Daniel Shahaf <d....@daniel.shahaf.name> wrote:
> > Daniel Shahaf wrote on Fri, Feb 01, 2013 at 19:15:04 +0200:
> >> > want to support any of the other security features.  What are the
> >> >  appropriate values for the following arguments to this function?
> >> >
> >> > svn_cmdline_create_auth_baton
> >> >
> >> > Currently I have this:
> >> > svn_boolean_t non_interactive = FALSE;
> 
> >> Basically this is "may prompt".  The "plaintext" and "SSL certificate"
> >> prompt depend on this.
> 
> OH. Does this part depend a call back then for the prompt?
> 

Your English doesn't parse.  Anyway, the code (somewhere in libsvn_subr)
will not call the "plaintext prompt" if "non_interactive" is TRUE.

> >> > const char *config_dir = NULL;
> >> > svn_boolean_t no_auth_cache = FALSE;
> >> > svn_boolean_t trust_server_cert = FALSE;
> >>
> >> Like the corresponding arguments to the cmdline binary.
> >>
> >> > svn_config_t *cfg_config = NULL;
> >> >
> >> That's the parsed "config" file from CONFIG_DIR.  I'm not quite sure why
> >> we have both this and 'const char *config_dir'.
> >>
> >> (Also, where do you see the name "cfg_config"?  It's called "cfg" at the
> >> declaration and definition, in trunk.)
> 
> At this point I'm not sure anymore, but I *think* it was something I
> read in the source for the command line.
> 

I see.  I suppose the context was having cfg_config and cfg_servers,
i.e., in code that deals with both ~/.subversion/{config,servers}.

> >> > Which so far works, but I was just taking a WAG.
> >>
> >> Did you read the API documentation?  Was it not clear?
> 
> Not at the time. I was being a bad person. My advisor said "Add this
> feature" and five minutes later, it was so. Since nothing crashed I
> just ran with it at the time. I think I get this section now though.
> 
> Thank you Daniel!

You're welcome.

Daniel

Re: Default values for args to svn_cmdline_create_auth_baton

Posted by Ryan Vordermann <rv...@gmail.com>.
Daniel,

Thank you for prompt response. I'm sorry I haven't returned the
courtesy. I'm a full time student and I work with two jobs. One of
them is closing on the ship date for their first product so things are
busy. I copied and pasted material from your first email, to put the
answer into one. Is that okay?

On Fri, Feb 1, 2013 at 11:31 AM, Daniel Shahaf <d....@daniel.shahaf.name> wrote:
> Daniel Shahaf wrote on Fri, Feb 01, 2013 at 19:15:04 +0200:
>> Hi again!
>>
>> Ryan Vordermann wrote on Thu, Jan 31, 2013 at 13:01:19 -0700:
>> > Hi,
>> >
>> > My name is Ryan. I'm not subscribed to this list so I would appreciate
>> > being CC'ed on responses
>> >
>> > I'm working on a utility that uses the svn client api. Right now it works,
>> >  but I want to add support for usernames and passwords. I do not (yet)
>>
>> Have a look at subversion/tests/cmdline/atomic-ra-revprop-change.c .  It
>> supports exactly providing a (single, known-in-advance)
>> username/password pair.
>
> I should clarify, though: that tool uses the svn_ra_* API directly,
> bypassing the (higher-level) svn_client_* API.  Your tool might or might
> not want to do that.

I found that file really helpful, but I'm still going to try sticking
to the client lib. Mostly as a design choice. There isn't a reason I
couldn't form deeper connection to SVN.

>> > want to support any of the other security features.  What are the
>> >  appropriate values for the following arguments to this function?
>> >
>> > svn_cmdline_create_auth_baton
>> >
>> > Currently I have this:
>> > svn_boolean_t non_interactive = FALSE;

>> Basically this is "may prompt".  The "plaintext" and "SSL certificate"
>> prompt depend on this.

OH. Does this part depend a call back then for the prompt?

>> > const char *config_dir = NULL;
>> > svn_boolean_t no_auth_cache = FALSE;
>> > svn_boolean_t trust_server_cert = FALSE;
>>
>> Like the corresponding arguments to the cmdline binary.
>>
>> > svn_config_t *cfg_config = NULL;
>> >
>> That's the parsed "config" file from CONFIG_DIR.  I'm not quite sure why
>> we have both this and 'const char *config_dir'.
>>
>> (Also, where do you see the name "cfg_config"?  It's called "cfg" at the
>> declaration and definition, in trunk.)

At this point I'm not sure anymore, but I *think* it was something I
read in the source for the command line.

>> > Which so far works, but I was just taking a WAG.
>>
>> Did you read the API documentation?  Was it not clear?

Not at the time. I was being a bad person. My advisor said "Add this
feature" and five minutes later, it was so. Since nothing crashed I
just ran with it at the time. I think I get this section now though.

Thank you Daniel!

Re: Default values for args to svn_cmdline_create_auth_baton

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Daniel Shahaf wrote on Fri, Feb 01, 2013 at 19:15:04 +0200:
> Hi again!
> 
> Ryan Vordermann wrote on Thu, Jan 31, 2013 at 13:01:19 -0700:
> > Hi,
> > 
> > My name is Ryan. I'm not subscribed to this list so I would appreciate
> > being CC'ed on responses
> > 
> > I'm working on a utility that uses the svn client api. Right now it works,
> >  but I want to add support for usernames and passwords. I do not (yet)
> 
> Have a look at subversion/tests/cmdline/atomic-ra-revprop-change.c .  It
> supports exactly providing a (single, known-in-advance)
> username/password pair.

I should clarify, though: that tool uses the svn_ra_* API directly,
bypassing the (higher-level) svn_client_* API.  Your tool might or might
not want to do that.

Re: Default values for args to svn_cmdline_create_auth_baton

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Hi again!

Ryan Vordermann wrote on Thu, Jan 31, 2013 at 13:01:19 -0700:
> Hi,
> 
> My name is Ryan. I'm not subscribed to this list so I would appreciate
> being CC'ed on responses
> 
> I'm working on a utility that uses the svn client api. Right now it works,
>  but I want to add support for usernames and passwords. I do not (yet)

Have a look at subversion/tests/cmdline/atomic-ra-revprop-change.c .  It
supports exactly providing a (single, known-in-advance)
username/password pair.

> want to support any of the other security features.  What are the
>  appropriate values for the following arguments to this function?
> 
> svn_cmdline_create_auth_baton
> 
> Currently I have this:
> svn_boolean_t non_interactive = FALSE;

Basically this is "may prompt".  The "plaintext" and "SSL certificate"
prompt depend on this.

> const char *config_dir = NULL;
> svn_boolean_t no_auth_cache = FALSE;
> svn_boolean_t trust_server_cert = FALSE;

Like the corresponding arguments to the cmdline binary.

> svn_config_t *cfg_config = NULL;
> 

That's the parsed "config" file from CONFIG_DIR.  I'm not quite sure why
we have both this and 'const char *config_dir'.

(Also, where do you see the name "cfg_config"?  It's called "cfg" at the
declaration and definition, in trunk.)

> Which so far works, but I was just taking a WAG.
> 

Did you read the API documentation?  Was it not clear?

> Thanks in advance,
> Ryan Vordermann