Git-smart-http authentication by repository
This patch allows the repository name to differ from the project name.
We migrated to a multi-repository per project setup after the whole infrastructure (scripts, build servers etc.) was set up. At this point we considered that renaming all the repositories to match the project identifier is too time-consuming and error-prone.
The compromise we found is to path the authentication script so that is also looks at the pool of repository identifiers when authenticating a git-smart-http request:
- extract the project/repository identifier from the request URI
- if it is a project identifier, use that project to authenticate the request
- if it is a repository identifier, use the first project it belongs to authenticate the request.
While this patch does not represent a full solution to the multi-repository problem, I hope it helps others in the same situation as us.