Part of lp.code.interfaces.gitapi View In Hierarchy
Published at "git" on the private XML-RPC server.
The Git pack frontend uses this to translate user-visible paths to internal ones, and to notify Launchpad of ref changes.
Method | translatePath | Translate 'path' so that the Git pack frontend can access it. |
Method | notify | Notify of a change to the repository at 'translated_path'. |
Method | authenticateWithPassword | Authenticate a user by username and password. |
Method | checkRefPermissions | Return a list of ref rules for a user in a repository that |
Translate 'path' so that the Git pack frontend can access it. If the repository does not exist and write permission was requested, register a new repository if possible. :param path: The path being translated. This should be a string representing an absolute path to a Git repository. :param permission: "read" or "write". :param requester_id: The database ID of the person requesting the path translation, or None for an anonymous request. :param can_authenticate: True if the frontend can request authentication, otherwise False. :returns: A `PathTranslationError` fault if 'path' cannot be translated; a `PermissionDenied` fault if the requester cannot see or create the repository; otherwise, a dict containing at least the following keys:: "path", whose value is the repository's storage path; "writable", whose value is True if the requester can push to this repository, otherwise False.
Parameters | translated_path | The translated path to the repository. (We use translated paths here in order to avoid problems with repository names etc. being changed during a push.) |
Returns | A NotFound fault if no repository can be found for
'translated_path'; otherwise None. |
This currently only works when using macaroon authentication.
Returns | An Unauthorized fault if the username and password do
not match; otherwise, a dict containing a "uid" (for a real
user) or "user" (for internal services) key indicating the
authenticated principal, and possibly "macaroon" with a macaroon
that requires further authorisation by other methods. |