[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [Patch] Expression support for SVNPath and SVNParentPath

From: Branko Čibej <brane_at_wandisco.com>
Date: Fri, 27 Feb 2015 08:45:09 +0100

On 25.02.2015 17:35, Graham Leggett wrote:
> Hi all,
>
> The SVNParentPath directive allows a set of repos to be placed at an URL, but if you have more complex needs such as providing many customers (with separately mounted home directories) access to many repositories, this may not be enough.
>
> The attached patch brings httpd v2.4 expression support to the SVNPath and SVNParentPath directories through the addition of an optional second parameter, which allows you to do stuff like this:
>
> <LocationMatch ^/svn/(?<CUSTOMERNAME>[^/]+)/>
>
> # customer has their own partition, inside is an “svn” directory with repos in it
> SVNParentPath /home/partition %{env:MATCH_CUSTOMERNAME}/svn
>
> # customer repos are protected by this group
> require ldap-group cn=https://svn.${SERVER_SUFFIX}/%{env:MATCH_CUSTOMERNAME},ou=svn,ou=Groups,o=Somewhere
>
> </LocationMatch>
>
> Or perhaps this based on the HOST header (and a wildcard SSL cert):
>
> <Location />
>
> # customer has their own partition, inside is an “svn” directory with repos in it
> SVNParentPath /home/svn %{HTTP_HOST}
>
> # customer repos are protected by this group
> require ldap-group cn=%{HTTP_HOST},ou=svn,ou=Groups,o=Somewhere
>
> </Location>
>
> Both the SVNPath and SVNParentPath directives now take an optional second argument, containing a string expression to be evaluated and added to the end of the primary path. If the expression evaluates to a path above the first argument, an error will be returned.
>
> The patch was developed against trunk, and applies clean to v1.7.19.

I think this would be a nice feature to have in mod_dav_svn. It is, IMO,
a better approach than the one currently implemented on the
SVNParentPathTemplate branch, even if it is limited to httpd-2.4+.

Graham, I've created a branch for this:

    ^/subversion/branches/mod-dav-svn-expressions

you can commit your patch there, if you will; you have the necessary
karma since Subversion-the-project uses the universal-commit bit.

Once that's done, we'll want to tweak our test suite so that we can test
the new feature, and probably update docs and so on.

-- Brane
Received on 2015-02-27 08:45:47 CET

This is an archived mail posted to the Subversion Dev mailing list.