Hello all,
I see in the man page for SVN::Client that the following code allows you
to use a callback to prompt the user for information used to
authenticate before access to the Subversion repository:
use SVN::Client;
my $ctx = new SVN::Client(
auth => [SVN::Client::get_simple_provider(),
SVN::Client::get_simple_prompt_provider(\&simple_prompt,2),
SVN::Client::get_username_provider()]
);
$ctx->cat (\*STDOUT,
"http://svn.collab.net/repos/svn/trunk/README",
"HEAD");
sub simple_prompt {
my $cred = shift;
my $realm = shift;
my $default_username = shift;
my $may_save = shift;
my $pool = shift;
print "Enter authentication info for realm: $realm\n";
print "Username: ";
my $username = <>;
chop($username);
$cred->username($username);
print "Password: ";
my $password = <>;
chomp($password);
$cred->password($password);
In the particular piece of software I'm working on, users will already
have been authenticated at this point (we use an external LDAP server),
and I simply want to create a Subversion client that performs operations
on the remote repository as though it were that user. Is there a simple
way I can just instantiate a SVN::Client object and simply pass it the
username it needs to operate as? Or will I need to write some sort of
weird callback routine, that I seed with the correct username ahead of
time, before calling SVN::Client->New?
Thanks in advance,
Jeremy
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Mar 17 21:37:03 2004