Git Smart HTTP - User Authentication for certain repositories
I was wondering how you authenticate between git repos for smart http.
For example, I have all my repositories in /repos/
, however, I would like to assign "John Doe" to only two of them. The other I want "Jane Doe" to access; however, I don't want either one of them to be able to access each other's repositories.
By the way: I do have user authentication working in genernal with http auth, it's the separating priv. for certain use开发者_运维知识库rs is what I'm really after.
Using http as a transport, you can use WebDAV. The official howto is here, but tutorials abound on the web.
I spoke to the developer of https://github.com/sitaramc/gitolite and he pointed me in the direction:
in short, you need a "mini gitolite"? (1) set it up the way my man page says but instead of using gl-auth-command use your script (2) your script should do/deal with the following: - it should take the authenticated username from $REMOTE_USER - it should look at the PATH_INFO, REQUEST_URI, etc., to find out what repo he wants to access and whether he wants to read or write (you can see the code in simulate_ssh_connection() in my code for that) - then use whatever logic you want to decide if you should allow or reject the request If you allow it you must "exec" the original git-http-backend.
精彩评论