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

[Patch] Expression support for SVNPath and SVNParentPath

From: Graham Leggett <minfrin_at_sharp.fm>
Date: Wed, 25 Feb 2015 18:35:57 +0200

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.

Regards,
Graham

Received on 2015-02-25 17:37:29 CET

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.