You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Marcus Rueckert <da...@web.de> on 2005/03/25 05:49:19 UTC
mod_dav_svn api
hi,
i just started mod_authn_svn as a C learning project.
reading through the svn and apache api atm.
atm mod_dav_svn.h only exports dav_uri_split()
if i understand the
http://httpd.apache.org/docs-2.1/developer/request.html
correctlly then apache already knows the current url points
to a svn location. now i thought it would be smart to just ask
apache about the path real path of the current repositories.
using with path apply the same logic as svnserve:
1. read svnserve.conf
2. get the path of the passwd file. [1]
3. try to read it and authenticate with it.
this way i could share the password file nicely.
but how can i cleanly access the config options from other modules?
would it be usefull to republish some of the external mod_dav_svn api?
darix
[1] ideal would be to set the realm to the same value as svnserve would
do. but i was told this would require a mod_auth_svn too. this would
mean i would need some wraper on top of mod_auth_basic and
mod_auth_digest. maybe later.
--
irssi - the client of the smart and beautiful people
http://www.irssi.de/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
[PATCH] dav_svn_get_repos_path (was: mod_dav_svn api)
Posted by Marcus Rueckert <da...@web.de>.
hi,
after some heavy discussions on irc we now have v3 of the patch. :)
darix
--
irssi - the client of the smart and beautiful people
http://www.irssi.de/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PATCH] dav_svn_get_repos_path
Posted by Max Bowsher <ma...@ukf.net>.
Marcus Rueckert wrote:
>> hi
>>
>> hopefully the last version.
>> i fixed the comments for max.
>>
>> i fixed the log message. (ok i just copied the text from cmpilato)
>>
>> and i ran make fsfscheck successfully..
>> and my the tests from my mod_authn_svn.
Now committed.
( I tweaked the comments yet again :-) ).
Max.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PATCH] dav_svn_get_repos_path
Posted by Marcus Rueckert <da...@web.de>.
hi
hopefully the last version.
i fixed the comments for max.
i fixed the log message. (ok i just copied the text from cmpilato)
and i ran make fsfscheck successfully..
and my the tests from my mod_authn_svn.
[[[
<Location /svn/path>
DAV svn
SVNPath /opt/apache2.1/svn/repos1
SVNAutoversioning on
# auth
AuthType Basic
AuthName "svn path"
AuthBasicAuthoritative On
AuthBasicProvider svn
require valid-user
</Location>
<Location /svn/parentpath>
DAV svn
SVNParentPath /opt/apache2.1/svn
SVNAutoversioning on
# auth
AuthType Basic
AuthName "svn parent path"
AuthBasicAuthoritative On
AuthBasicProvider svn
require valid-user
</Location>
<Location /nopath>
AuthType Basic
AuthName "svn parent path"
AuthBasicAuthoritative On
AuthBasicProvider svn
AuthSvnFile "/opt/apache2.1/svn/repos1/conf/htpasswd"
require valid-user
</Location>
]]]
this code snippet is from a Apache 2.1 module:
[[[
/* Given a username and password, expected to return AUTH_GRANTED
* if we can validate this user/password combination.
*/
static authn_status check_password(request_rec *r, const char *user,
const char *password)
{
authn_svn_config_rec *conf = ap_get_module_config(r->per_dir_config,
&authn_svn_module);
const char *repos_path;
dav_error *err;
err = dav_svn_get_repos_path (r, conf->base_path, &repos_path );
if (err)
{
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
"darix is debugging: %s", err->desc);
return AUTH_DENIED;
}
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
"darix is debugging: %s", repos_path);
return AUTH_GRANTED;
}
]]]
if any one is interested in the full code i will send it.
the results for the various blocks
curl -u darix http://localhost:8080/nopath
[[[
[Fri Apr 01 21:22:27 2005] [error] [client 127.0.0.1] darix is debugging: The server is misconfigured: either an SVNPath or SVN
ParentPath directive is required to specify the location of this resource's repository.
[Fri Apr 01 21:22:27 2005] [error] [client 127.0.0.1] user darix: authentication failure for "/nopath/": Password Mismatch
]]]
curl -u darix http://localhost:8080/svn/path/
[[[
[Fri Apr 01 21:21:41 2005] [error] [client 127.0.0.1] darix is debugging: /opt/apache2.1/svn/repos1
]]]
curl -u darix http://localhost:8080/svn/parentpath/repos2/
[[[
[Sat Apr 02 00:19:29 2005] [error] [client 127.0.0.1] darix is debugging: /opt/apache2.1/svn/repos2
]]]
hoping the best
darix
--
irssi - the client of the smart and beautiful people
http://www.irssi.de/
Re: [PATCH] dav_svn_get_repos_path
Posted by Julian Foad <ju...@btopenworld.com>.
C. Michael Pilato wrote:
> Marcus Rueckert <da...@web.de> writes:
>>Add a function to mod_dav_svn to get the path of the repository on diski.
>>This can be usefull for other apache modules.
>
> s/diski/disk/
> s/usefull/useful/
> s/apache/Apache/
[...]
> Noisy. You just need:
>
> Add a function to mod_dav_svn to get the path of the repository on disk.
> This can be useful for other Apache modules.
>
> * subversion/include/mod_dav_svn.h
> (dav_svn_get_repos_path): New.
>
> * subversion/mod_dav_svn/mod_dav_svn.c
> Include mod_dav_svn.h.
> (dav_svn_get_repos_path): New.
[...]
> Docstring is fine, I guess. Were it my patch, I might do the
> following instead:
[...]
Right. Given some or all of C. Michael Pilato's textual clean-ups, I'm happy
with this patch. However, it's not my area of expertise at all, and I can't
successfully run "make check" at the moment, so I'll have to leave this for
some other committer to commit.
- Julian
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PATCH] dav_svn_get_repos_path
Posted by "C. Michael Pilato" <cm...@collab.net>.
Marcus Rueckert <da...@web.de> writes:
> Add a function to mod_dav_svn to get the path of the repository on diski.
> This can be usefull for other apache modules.
s/diski/disk/
s/usefull/useful/
s/apache/Apache/
> * subversion/mod_dav_svn/mod_dav_svn.c
> (dav_svn_get_repos_path): Set *repos_path to the path to the repository on disk.
>
> Include mod_dav_svn.h so we get the prototype for
> dav_svn_get_repos_path and dav_svn_split_uri.
>
> * subversion/include/mod_dav_svn.h
> (dav_svn_get_repos_path): Declare the function and make it public for other
> apache modules.
Noisy. You just need:
Add a function to mod_dav_svn to get the path of the repository on disk.
This can be useful for other Apache modules.
* subversion/include/mod_dav_svn.h
(dav_svn_get_repos_path): New.
* subversion/mod_dav_svn/mod_dav_svn.c
Include mod_dav_svn.h.
(dav_svn_get_repos_path): New.
> Index: subversion/include/mod_dav_svn.h
> ===================================================================
> --- subversion/include/mod_dav_svn.h (revision 13816)
> +++ subversion/include/mod_dav_svn.h (working copy)
> @@ -74,6 +74,13 @@
> const char **repos_path);
>
>
> +/* Given an apache request R and a ROOT_PATH to the svn location
> + block set *REPOS_PATH to the path of the repository on disk.
> +*/
> +AP_MODULE_DECLARE(dav_error *) dav_svn_get_repos_path(request_rec *r,
> + const char *root_path,
> + const char **repos_path);
Docstring is fine, I guess. Were it my patch, I might do the
following instead:
/* Set *REPOS_PATH to the on-disk path of the repository associated
with Apache request R and a <Location> block ROOT_PATH. */
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PATCH] dav_svn_get_repos_path
Posted by Marcus Rueckert <da...@web.de>.
hi,
> 17:19:49 <@sussman:#svn-dev> never say, "return blah"
> 17:19:56 <@sussman:#svn-dev> say, "set *RETURN_VALUE to blah."
> 17:20:11 <@sussman:#svn-dev> because almost every function returns
> dav_error or svn_error_t anyway.
fixed log message accordingly. header file should be fine.
darix
--
irssi - the client of the smart and beautiful people
http://www.irssi.de/
Re: [PATCH] dav_svn_get_repos_path
Posted by Marcus Rueckert <da...@web.de>.
On 2005-04-01 14:35:01 +0100, Julian Foad wrote:
> The direction of "from" is ambiguous - it can sounds like we are getting
> the path from them. Maybe: "Add a function to mod_dav_svn to get the path
> of the repository on disk. This can be useful to other Apache modules."
thanks. :) i just took your text :)
> No indentation needed before "*".
fixed. i copy pasted the examples from the hacking file and didnt look
at the log inbetween. :)
> Full stops would be nice.
i added some. :)
> Delete "for" (or "to the").
done
> "block, set *REPOS_PATH to the path to the repository on disk."
> (It returns an error code.)
done.
> Please don't ask questions in the source comments. When possible, ask the
> questions on the mailing list and put the answers into the comments as
> facts. Otherwise each developer that looks at this will wonder, "I don't
> know ... is this right or not? This code shouldn't have been committed
> unless the original programmer was sure."
was an old comment. i removed the apr_pstrdup() but not the comment.
> We can? Then what was the purpose of the previous function call?
can i have an old comment obsoleter pleae. removed.
> "Now let's"
fixed
thanks for your review julian.
ready for the next round. new patch attached. :)
darix
--
irssi - the client of the smart and beautiful people
http://www.irssi.de/
Re: [PATCH] dav_svn_get_repos_path
Posted by Julian Foad <ju...@btopenworld.com>.
Marcus Rueckert wrote:
> Add a function to get the path of the repository on disk from other
> apache modules.
The direction of "from" is ambiguous - it can sounds like we are getting the
path from them. Maybe: "Add a function to mod_dav_svn to get the path of the
repository on disk. This can be useful to other Apache modules."
>
> * subversion/mod_dav_svn/mod_dav_svn.c
No indentation needed before "*".
> (dav_svn_get_repos_path): returns the path to the repository on disk
>
> Include mod_dav_svn.h so we get the prototype for
> dav_svn_get_repos_path and dav_svn_split_uri
Full stops would be nice.
> * subversion/include/mod_dav_svn.h
> (dav_svn_get_repos_path): declare the function and make it public to the
> for other apache modules.
Delete "for" (or "to the").
> ------------------------------------------------------------------------
>
> Index: subversion/include/mod_dav_svn.h
> ===================================================================
> --- subversion/include/mod_dav_svn.h (revision 13816)
> +++ subversion/include/mod_dav_svn.h (working copy)
> @@ -74,6 +74,13 @@
> const char **repos_path);
>
>
> +/* Given an apache request R and a ROOT_PATH to the svn location
> + block return the path to the repository on disk.
"block, set *REPOS_PATH to the path to the repository on disk."
(It returns an error code.)
> +*/
> +AP_MODULE_DECLARE(dav_error *) dav_svn_get_repos_path(request_rec *r,
> + const char *root_path,
> + const char **repos_path);
> +
> #ifdef __cplusplus
> }
> #endif /* __cplusplus */
> Index: subversion/mod_dav_svn/mod_dav_svn.c
> ===================================================================
> --- subversion/mod_dav_svn/mod_dav_svn.c (revision 13816)
> +++ subversion/mod_dav_svn/mod_dav_svn.c (working copy)
> @@ -32,6 +32,7 @@
>
> #include "dav_svn.h"
>
> +#include <mod_dav_svn.h>
>
> /* This is the default "special uri" used for SVN's special resources
> (e.g. working resources, activities) */
> @@ -248,7 +249,52 @@
> return conf->fs_parent_path;
> }
>
> +AP_MODULE_DECLARE(dav_error *) dav_svn_get_repos_path(request_rec *r,
> + const char *root_path,
> + const char **repos_path)
> +{
>
> + const char *fs_path; /* the path to the repository on disk */
> + const char *repos_name;
> + const char *ignored_path_in_repos;
> + const char *ignored_cleaned_uri;
> + const char *ignored_relative;
> + int ignored_had_slash;
> +
> + dav_error *err;
> +
> + /* The path that we will eventually try to open as an svn
> + repository. Normally defined by the SVNPath directive. */
> + fs_path = dav_svn_get_fs_path(r);
> +
> + if (fs_path != NULL)
> + {
> + /* The config object should be long-lived, right?
> + * So can't we just directly assign a pointer? */
Please don't ask questions in the source comments. When possible, ask the
questions on the mailing list and put the answers into the comments as facts.
Otherwise each developer that looks at this will wonder, "I don't know ... is
this right or not? This code shouldn't have been committed unless the original
programmer was sure."
> + *repos_path = fs_path;
> + return NULL;
> + }
> +
> + /* If the SVNParentPath directive was used instead... */
> + fs_path = dav_svn_get_fs_parent_path(r);
> +
> + /* At this point we can be sure that fs_path is NULL.
We can? Then what was the purpose of the previous function call?
> + now let just compute the full path below svn parent path. */
"Now let's"
> + /* This does all the work of interpreting/splitting the request uri. */
> + err = dav_svn_split_uri(r, r->uri, root_path, &ignored_cleaned_uri,
> + &ignored_had_slash,
> + &repos_name,
> + &ignored_relative, &ignored_path_in_repos);
> +
> + /* push the error to the caller */
> + if (err)
> + return err;
> +
> + /* ...and we need to specify exactly what repository to open. */
> + *repos_path = svn_path_join(fs_path, repos_name, r->pool);
> + return NULL;
> +}
> +
- Julian
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
[PATCH] dav_svn_get_repos_path (was: mod_dav_svn api)
Posted by Marcus Rueckert <da...@web.de>.
hi,
after some heavy discussions on irc we now have v3 of the patch. :)
this time with the patch attached :)
i have to say thank you to:
chipig, kfogel, maxb, sussman, urkle for input
darix
--
irssi - the client of the smart and beautiful people
http://www.irssi.de/
Re: mod_dav_svn api
Posted by Marcus Rueckert <da...@web.de>.
On 2005-03-31 11:55:33 -0600, kfogel@collab.net wrote:
> Seems an odd name, why not 'dav_svn_repos_path' or something like that?
renamed it to dav_get_repos_path().
> The doc string here indicates that it returns "path to the repository"
> too.
>
> This doc string describes the NULL return in terms of an
> implementation detail. A reader may not know or care why
> dav_svn_split_uri() would be called anyway. Can you reword it to
> describe something meaningful about the circumstances under which NULL
> could be returned?
fixed. see the new patch.
> Why did you have to add this #include line? I'm surprised it wasn't
> required before. Also, you don't mention it in your log message.
so far mod_dav_svn.c didnt need dav_svn_uri_split(). i need it now in
dav_svn_get_repos_path(). furthermore my own function should be
public available and has its prototype in mod_dav_svn.h.
> Indentation problem in the declaration.
fixed.
> You have one variable "repo_name", and another "repos_name", and a
> third "repos_path". Can you see why a reader might get confused? :-)
repo_name was a relict from the old testing code. removed. ;)
> Some of these are used but ignored, for example, 'had_slash'. You
> should named the variable 'ignored', or 'ignored_had_slash', or put a
> comment next to it indicating that it is unused, or *something* to
> give the reader some guidance.
i renamed all unused variables.
> I'm a confused by this code.
>
> You *call* dav_svn_split_uri(), but if conf->fs_parent_path is NULL,
> you don't use any of the results, all you use is conf->fs_path, which
> was obtained from the very first function call. I don't understand
> how the normal SVNPath case is handled. Why is it sufficient to set
> fs_path to conf->fs_path and just return it, in this case? Don't we
> need to do something more? (And if we don't, then why do we do so
> much other work before the return?)
the config code in mod_dav_svn makes sure svnpath and svnparentpath are
not set at the same time. now i set the default value for the return
code to conf->fs_path. then i check if fs_parent_path is set. if
fs_parent_path is set i need to attach the repos path to get the full
qualified repos path.
i moved the dav_svn_split_uri() into the if condition.
i commented this in the source code too.
> You set 'repo_name' to the result of dav_svn_get_repo_name(), but you
> never use the value anywhere.
removed.
> Also, you have a comment line exceeding 80 characters; please keep
> lines under 78 chars or so.
fixed.
thanks for all your comments and critics and especially for the fast
reply.
i have attached v2 of the patch.
darix
--
irssi - the client of the smart and beautiful people
http://www.irssi.de/
Re: mod_dav_svn api
Posted by kf...@collab.net.
Marcus Rueckert <da...@web.de> writes:
> Add a function to get the path of the repository on disk from other
> apache modules.
>
> * subversion/mod_dav_svn/mod_dav_svn.c
> (dav_svn_get_fs_dir): returns the path to the repository on disk
>
> * subversion/include/mod_dav_svn.h
> (dav_svn_get_fs_dir): declare the function and make it public to the
> for other apache modules.
Seems an odd name, why not 'dav_svn_repos_path' or something like that?
> Index: subversion/include/mod_dav_svn.h
> ===================================================================
> --- subversion/include/mod_dav_svn.h (revision 13799)
> +++ subversion/include/mod_dav_svn.h (working copy)
> @@ -74,6 +74,14 @@
> const char **repos_path);
>
>
> +/* Given an apache request R and a ROOT_PATH to the svn location
> + block this function returns the path to the repository on disk.
> +
> + The function returns NULL in case of an error in dav_svn_split_uri.
> + */
> +AP_MODULE_DECLARE(const char *) dav_svn_get_fs_dir(request_rec *r,
> + const char *root_path);
> +
The doc string here indicates that it returns "path to the repository"
too.
This doc string describes the NULL return in terms of an
implementation detail. A reader may not know or care why
dav_svn_split_uri() would be called anyway. Can you reword it to
describe something meaningful about the circumstances under which NULL
could be returned?
> #ifdef __cplusplus
> }
> #endif /* __cplusplus */
> Index: subversion/mod_dav_svn/mod_dav_svn.c
> ===================================================================
> --- subversion/mod_dav_svn/mod_dav_svn.c (revision 13799)
> +++ subversion/mod_dav_svn/mod_dav_svn.c (working copy)
> @@ -32,6 +32,7 @@
>
> #include "dav_svn.h"
>
> +#include <mod_dav_svn.h>
Why did you have to add this #include line? I'm surprised it wasn't
required before. Also, you don't mention it in your log message.
> /* This is the default "special uri" used for SVN's special resources
> (e.g. working resources, activities) */
> @@ -248,7 +249,52 @@
> return conf->fs_parent_path;
> }
>
> +AP_MODULE_DECLARE(const char) *dav_svn_get_fs_dir(request_rec *r,
> + const char *root_path)
> +{
Indentation problem in the declaration.
> + const char *fs_path;
> + const char *repo_name;
> + const char *cleaned_uri;
> + const char *repos_name;
> + const char *relative;
> + const char *repos_path;
> + int had_slash;
You have one variable "repo_name", and another "repos_name", and a
third "repos_path". Can you see why a reader might get confused? :-)
Some of these are used but ignored, for example, 'had_slash'. You
should named the variable 'ignored', or 'ignored_had_slash', or put a
comment next to it indicating that it is unused, or *something* to
give the reader some guidance.
> + dav_error *err;
> + dav_svn_dir_conf *conf;
> +
> + conf = ap_get_module_config(r->per_dir_config, &dav_svn_module);
> +
> + repo_name = dav_svn_get_repo_name(r);
> +
> + /* This does all the work of interpreting/splitting the request uri. */
> + err = dav_svn_split_uri(r, r->uri, root_path,
> + &cleaned_uri, &had_slash,
> + &repos_name, &relative, &repos_path);
> +
> + /* we encountered an error on splitting. silently ignore it and return nothing. */
> + if (err)
> + return NULL;
> +
> + /* The path that we will eventually try to open as an svn
> + repository. Normally defined by the SVNPath directive.
> +
> + At this point we can be sure that fs_path or fs_parent_path
> + is non-NULL. otherwise dav_svn_split_uri had thrown an error.
> + */
> + fs_path = conf->fs_path;
>
> + /* If the SVNParentPath directive was used instead... */
> + if (conf->fs_parent_path != NULL)
> + {
> + /* ...and we need to specify exactly what repository to open. */
> + fs_path = svn_path_join(conf->fs_parent_path, repos_name, r->pool);
> + }
> +
> + return fs_path;
> +}
I'm a confused by this code.
You *call* dav_svn_split_uri(), but if conf->fs_parent_path is NULL,
you don't use any of the results, all you use is conf->fs_path, which
was obtained from the very first function call. I don't understand
how the normal SVNPath case is handled. Why is it sufficient to set
fs_path to conf->fs_path and just return it, in this case? Don't we
need to do something more? (And if we don't, then why do we do so
much other work before the return?)
You set 'repo_name' to the result of dav_svn_get_repo_name(), but you
never use the value anywhere.
Also, you have a comment line exceeding 80 characters; please keep
lines under 78 chars or so.
-Karl
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: mod_dav_svn api
Posted by Marcus Rueckert <da...@web.de>.
On 2005-03-25 12:25:54 -0600, Ben Collins-Sussman wrote:
> Aha, you're right. Sorry for misunderstanding. I think that
> dav_svn_get_fs_path() and dav_svn_get_fs_parent_path() need to be
> exported, so that your module can use them.
>
> Then your module could steal this code from mod_dav_svn/repos.c:1193:
[...]
> ... now 'fs_path' is the actualy path to the repository, and you can
> read fs_path/conf/svnserve.conf.
hi!:)
actually this part of my project is done.
i copied the needed code from repos.c and added dav_svn_get_fs_dir() in
mod_dav_svn. this function is exported so other apache modules can use
it.
patch and log message are attached.
comments and critics welcome. :)
darix
--
irssi - the client of the smart and beautiful people
http://www.irssi.de/
Re: mod_dav_svn api
Posted by Ben Collins-Sussman <su...@collab.net>.
On Mar 25, 2005, at 12:13 PM, Marcus Rueckert wrote:
> On 2005-03-25 07:52:26 -0600, Ben Collins-Sussman wrote:
>>> but how can i cleanly access the config options from other modules?
>
> i want to write a module which uses the same logic as svnserve for
> authentication. therefor i need to find the filesystem path of the
> repository to read conf/svnserve.conf to find the passwd file.
>
> what would be a proper way to get the path to it?
Aha, you're right. Sorry for misunderstanding. I think that
dav_svn_get_fs_path() and dav_svn_get_fs_parent_path() need to be
exported, so that your module can use them.
Then your module could steal this code from mod_dav_svn/repos.c:1193:
/* This does all the work of interpreting/splitting the request uri.
*/
err = dav_svn_split_uri(r, r->uri, root_path,
&cleaned_uri, &had_slash,
&repos_name, &relative, &repos_path);
if (err)
return err;
/* The path that we will eventually try to open as an svn
repository. Normally defined by the SVNPath directive. */
fs_path = dav_svn_get_fs_path(r);
/* If the SVNParentPath directive was used instead... */
fs_parent_path = dav_svn_get_fs_parent_path(r);
if (fs_parent_path != NULL)
{
/* ...then the URL to the repository is actually one implicit
component longer... */
root_path = svn_path_join(root_path, repos_name, r->pool);
/* ...and we need to specify exactly what repository to open. */
fs_path = svn_path_join(fs_parent_path, repos_name, r->pool);
}
... now 'fs_path' is the actualy path to the repository, and you can
read fs_path/conf/svnserve.conf.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: mod_dav_svn api
Posted by Marcus Rueckert <da...@web.de>.
On 2005-03-25 07:52:26 -0600, Ben Collins-Sussman wrote:
> >but how can i cleanly access the config options from other modules?
i want to write a module which uses the same logic as svnserve for
authentication. therefor i need to find the filesystem path of the
repository to read conf/svnserve.conf to find the passwd file.
what would be a proper way to get the path to it?
> >would it be usefull to republish some of the external mod_dav_svn api?
for my module it would be usefull if dav_svn_get_fs_path would be
public. or a similar function that just returns the repository path of
for the current request object.
> I don't understand these last two questions, can you elaborate? I
> don't see why your module needs anything more than dav_svn_split_uri().
> That's all mod_authz_svn needs.
right. because authz_svn only works against relative paths inside the
repository. it doesnt need the path to the repository on the disk.
if i just add a setting like AuthnSvnFile, mod_authn_svn would work so
well with svnparentpath.
> Also, have you looked at mod_authz_svn? It's incredibly simple, and
> your own module could use it as a template. Your own module would be
> even smaller and simpler.
i will read mod_authz_svn about the config parsing stuff.
but it doesnt help me to find the svnserve.conf and the passwd file.
darix
--
irssi - the client of the smart and beautiful people
http://www.irssi.de/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: mod_dav_svn api
Posted by Ben Collins-Sussman <su...@collab.net>.
On Mar 24, 2005, at 11:49 PM, Marcus Rueckert wrote:
> hi,
>
> i just started mod_authn_svn as a C learning project.
> reading through the svn and apache api atm.
>
> atm mod_dav_svn.h only exports dav_uri_split()
>
> if i understand the
> http://httpd.apache.org/docs-2.1/developer/request.html
> correctlly then apache already knows the current url points
> to a svn location. now i thought it would be smart to just ask
> apache about the path real path of the current repositories.
> using with path apply the same logic as svnserve:
>
> 1. read svnserve.conf
> 2. get the path of the passwd file. [1]
> 3. try to read it and authenticate with it.
>
> this way i could share the password file nicely.
>
> but how can i cleanly access the config options from other modules?
> would it be usefull to republish some of the external mod_dav_svn api?
I don't understand these last two questions, can you elaborate? I
don't see why your module needs anything more than dav_svn_split_uri().
That's all mod_authz_svn needs.
Also, have you looked at mod_authz_svn? It's incredibly simple, and
your own module could use it as a template. Your own module would be
even smaller and simpler.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org