开发者

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.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜