l.c.i.g.IGitAPI(Interface) : interface documentation

Part of lp.code.interfaces.gitapi View In Hierarchy

The Git XML-RPC interface to Launchpad.

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
def translatePath(path, permission, requester_id, can_authenticate):
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.
def notify(translated_path):
Notify of a change to the repository at 'translated_path'.
Parameterstranslated_pathThe translated path to the repository. (We use translated paths here in order to avoid problems with repository names etc. being changed during a push.)
ReturnsA NotFound fault if no repository can be found for 'translated_path'; otherwise None.
def authenticateWithPassword(username, password):
Authenticate a user by username and password.

This currently only works when using macaroon authentication.

ReturnsAn 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.
def checkRefPermissions(translated_paths, ref_paths, auth_params):
Return a list of ref rules for a user in a repository that match the input refs.
ReturnsA list of rules for the user in the specified repository
API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.