簡體   English   中英

Git Smart HTTP-某些存儲庫的用戶身份驗證

[英]Git Smart HTTP - User Authentication for certain repositories

我想知道您如何在智能http的git repos之間進行身份驗證。

例如,我所有的存儲庫都在/repos/ ,但是,我只想給其中的兩個分配“ John Doe”。 我要“ Jane Doe”訪問另一個; 但是,我不希望它們中的任何一個都能訪問彼此的存儲庫。

順便說一句:我確實使用http auth進行用戶身份驗證,這是單獨的priv。 對於某些用戶,我真正想要的是。

使用http作為傳輸方式,可以使用WebDAV 官方的howto在這里 ,但是教程在網絡上比比皆是。

我與https://github.com/sitaramc/gitolite的開發人員交談,他指出了我的方向:

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.

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM