You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Alexis Boutillier <al...@libertysurf.fr> on 2004/10/07 14:38:29 UTC

[python bindings] How to create an authentication func

I'm trying to make a svn_client_ls on a URL.

It works fine if another client (svn status -u) have stored username and
password in /.subversion directory but if i delete this directory, my
python prog can't authenticate with the apache serveur.

I use LDAP password under apache.

there is my python code :
		util.apr_initialize()
		pool = util.svn_pool_create(None)

		util.svn_config_ensure(None,pool)

		provider = client.svn_client_get_simple_provider(pool)

		ctx = client.svn_client_create_context(pool)
		ctx.config = util.svn_config_get_config(None,pool)
		ctx.auth_baton = util.svn_auth_open([provider],pool)
		rev = util.svn_opt_revision_t()
		if svnRev is None:
			rev.kind = util.svn_opt_revision_head
		else:
			rev.kind = util.svn_opt_revision_number
			rev.value.number = svnRev
		result =
client.svn_client_ls('http://intranet/svn-test-repos/testEnv/testDrivers/test1',rev,False,ctx,pool)

The program end with a : libsvn._core.SubversionException: ("PROPFIND
request failed on '/svn-test-repos/testEnv/testDrivers/test1'", 170001)

I try to use "svn_auth_set_parameter" with ctx.auth_baton but it require
a pointer as the last argument instead of a string.

I try to use "svn_client_get_simple_prompt_provider" with a function but
it require a svn_auth_simple_prompt_func_t instead of a python function.

I try to set util.SVN_AUTH_PARAM_DEFAULT_USERNAME and
util.SVN_AUTH_PARAM_DEFAULT_PASSWORD as well as
client.SVN_CLIENT_AUTH_USERNAME and client.SVN_CLIENT_AUTH_PASSWORD but
it doesn't change anythings.

Could someone help me to fix this problem ?


-- 
Boutillier Alexis
Methodology engineer

Arteris SA
The Network-on-Chip Company TM
www.arteris.net

6 par Ariane Immeuble Mercure
78284 Guyancourt Cedex
France
Office: (+33) 1 61 37 38 71
Fac:    (+33) 1 61 37 38 41
Alexis.Boutillier@arteris.net


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

Re: [python bindings] How to create an authentication func

Posted by Alexis Boutillier <al...@arteris.net>.
Thanks, that's what i figured out.

I only have to pass one username and one password, that's why i try to
use the SVN_AUTH_PARAM_DEFAULT_USERNAME and PASSWORD but those two must
be store in the auth_baton with the svn_auth_set_parameter.

I will watch for this function to work as it could be the simplest way
to get the authentication working.

It complain about a pointer in the last argument, do the last argument
(the value) could be something other than a string ?

On Fri, 2004-10-08 at 07:53, Ben Reser wrote:
> On Thu, Oct 07, 2004 at 04:38:29PM +0200, Alexis Boutillier wrote:
> > I'm trying to make a svn_client_ls on a URL.
> > 
> > It works fine if another client (svn status -u) have stored username and
> > password in /.subversion directory but if i delete this directory, my
> > python prog can't authenticate with the apache serveur.
> > 
> > I use LDAP password under apache.
> > 
> > there is my python code :
> 
> [snip]
> 
> > The program end with a : libsvn._core.SubversionException: ("PROPFIND
> > request failed on '/svn-test-repos/testEnv/testDrivers/test1'", 170001)
> > 
> > I try to use "svn_auth_set_parameter" with ctx.auth_baton but it require
> > a pointer as the last argument instead of a string.
> > 
> > I try to use "svn_client_get_simple_prompt_provider" with a function but
> > it require a svn_auth_simple_prompt_func_t instead of a python function.
> > 
> > I try to set util.SVN_AUTH_PARAM_DEFAULT_USERNAME and
> > util.SVN_AUTH_PARAM_DEFAULT_PASSWORD as well as
> > client.SVN_CLIENT_AUTH_USERNAME and client.SVN_CLIENT_AUTH_PASSWORD but
> > it doesn't change anythings.
> > 
> > Could someone help me to fix this problem ?
> 
> The Python bindings don't have authentication providers implemented.  So
> unless you want to implment the thunking for them then you can't do
> anything about this.  I did the ones for the Perl bindings and it's a
> big pain to get them to work.  However, you can certainly look at how
> the Perl bindings did it to help in figuring it out.
-- 
Boutillier Alexis
Methodology engineer

Arteris SA
The Network-on-Chip Company TM
www.arteris.net

6 par Ariane Immeuble Mercure
78284 Guyancourt Cedex
France
Office: (+33) 1 61 37 38 71
Fac:    (+33) 1 61 37 38 41
Alexis.Boutillier@arteris.net


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

Re: [python bindings] How to create an authentication func

Posted by Ben Reser <be...@reser.org>.
On Thu, Oct 07, 2004 at 04:38:29PM +0200, Alexis Boutillier wrote:
> I'm trying to make a svn_client_ls on a URL.
> 
> It works fine if another client (svn status -u) have stored username and
> password in /.subversion directory but if i delete this directory, my
> python prog can't authenticate with the apache serveur.
> 
> I use LDAP password under apache.
> 
> there is my python code :

[snip]

> The program end with a : libsvn._core.SubversionException: ("PROPFIND
> request failed on '/svn-test-repos/testEnv/testDrivers/test1'", 170001)
> 
> I try to use "svn_auth_set_parameter" with ctx.auth_baton but it require
> a pointer as the last argument instead of a string.
> 
> I try to use "svn_client_get_simple_prompt_provider" with a function but
> it require a svn_auth_simple_prompt_func_t instead of a python function.
> 
> I try to set util.SVN_AUTH_PARAM_DEFAULT_USERNAME and
> util.SVN_AUTH_PARAM_DEFAULT_PASSWORD as well as
> client.SVN_CLIENT_AUTH_USERNAME and client.SVN_CLIENT_AUTH_PASSWORD but
> it doesn't change anythings.
> 
> Could someone help me to fix this problem ?

The Python bindings don't have authentication providers implemented.  So
unless you want to implment the thunking for them then you can't do
anything about this.  I did the ones for the Perl bindings and it's a
big pain to get them to work.  However, you can certainly look at how
the Perl bindings did it to help in figuring it out.

-- 
Ben Reser <be...@reser.org>
http://ben.reser.org

"Conscience is the inner voice which warns us somebody may be looking."
- H.L. Mencken

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