On Thu, Jan 15, 2009 at 1:04 AM, Peter <peter.d...@gmail.com> wrote:
>
> I have written a way for projects to be made private or public
> individually. A private project cannot be accessed by anyone except
> the owner and any authorized contributors (if any).
Nice. There's been a few requests for this, so it's quite timely.
> This is how contributor authorization works:
>
> * The owner specifies a passkey in a field in the Project Settings
> page.
> * A user that wants to become a contributor gets this passkey from the
> project owner (they can email for it, call, etc.)
> * Once the aspiring contributor has the passkey, he goes to the
> project's home page and types it in the box (the box will not show up
> if the user is not logged on).
> * If the passkey is correct, the user gets instant access to the
> project.
>
> I would be very interested in your comments.
I'm thinking we should do a proper project memberships model, with
roles attached. That way, adding a member to a project is a matter of
inviting them; type in their email address, wait for them to click the
confirm link.
Rather than doing the "is this a private project?" checking in the
views and helpers like you're doing a lot of place, it's much easier
(both in implementation and maintenance) to check it in a before
filter. There's a find_project method in the application controller
that is used throughout (or should be at least, if it's not I've been
doing it wrong). After it has found a given project would be a good
time to check for its privateness, and either redirect back with a
flash[:error] or render a page and stop the filter chain.
That way we'll have less places where the authorization is done and
that makes maintaining it easier in the long run.
>
> Peter
>
Cheers,
JS
On Mon, Jan 26, 2009 at 11:11 PM, Thomas <tho...@tschamm.de> wrote:
> Today I thought about security of a private repository you are talking
> about. How do you provide read-access to a private repository only for
> the contributers? As far as I see, only write-access can be permitted
> or forbidden, if a user knows the repository's name, he can clone
> whatever he wants. This is only security through obscurity. Do you
> have ideas how to improve control for read-access on private
> repositories? Or do i miss something?
The way most people do it when they run a private install of Gitorious
is to never actually set up the git-daemon, that way all push and
pulling/cloning has to be done through ssh and thus relying on the
pubkey and permissions (in gitorious) for the particular repository.
>
> Kind regards,
>
> Thomas
Cheers,
JS