1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-24 07:42:40 +01:00
phorge-phorge/src
epriestley f2938bacd9 Generalize SSH passthru for repository hosting
Summary:
Ref T2230. In Git, we can determine if a command is read-only or read/write from the command itself, but this isn't the case in Mercurial or SVN.

For Mercurial and SVN, we need to proxy the protocol that's coming over the wire, look at each request from the client, and then check if it's a read or a write. To support this, provide a more flexible version of `passthruIO`.

The way this will work is:

  - The SSH IO channel is wrapped in a `ProtocolChannel` which can parse the the incoming stream into message objects.
  - The `willWriteCallback` will look at those messages and determine if they're reads or writes.
    - If they're writes, it will check for write permission.
    - If we're good to go, the message object is converted back into a byte stream and handed to the underlying command.

Test Plan: Executed `git clone`, `git clone --depth 3`, `git push` (against no-write repo, got error), `git push` (against valid repo).

Reviewers: btrahan

Reviewed By: btrahan

CC: hach-que, asherkin, aran

Maniphest Tasks: T2230

Differential Revision: https://secure.phabricator.com/D7551
2013-11-11 12:12:21 -08:00
..
aphront Replace some hsprintf() with phutil_tag() and phutil_tag_div() Depends on D7545. 2013-11-09 10:48:19 -08:00
applications Generalize SSH passthru for repository hosting 2013-11-11 12:12:21 -08:00
docs Update configuration instructions for Apache 2.4 2013-11-08 10:06:05 -08:00
extensions Add src/extensions/ to Phabricator 2013-08-14 15:38:06 -07:00
infrastructure Generalize SSH passthru for repository hosting 2013-11-11 12:12:21 -08:00
view Replace some hsprintf() with phutil_tag() and phutil_tag_div() Depends on D7545. 2013-11-09 10:48:19 -08:00
__celerity_resource_map__.php Implemented support for build logs 2013-11-08 18:15:07 -08:00
__phutil_library_init__.php Delete license headers from files 2012-11-05 11:16:51 -08:00
__phutil_library_map__.php Generalize SSH passthru for repository hosting 2013-11-11 12:12:21 -08:00