l.c.s.SingleSchemePolicy(BranchOpenPolicy) : class documentation

Part of lp.codehosting.safe_open View In Hierarchy

Branch open policy that rejects URLs not on the given scheme.
Method __init__ Undocumented
Method shouldFollowReferences Whether we traverse references when mirroring.
Method transformFallbackLocation Validate, maybe modify, 'url' to be used as a stacked-on location.
Method checkOneURL Check that url is safe to open.
def __init__(self, allowed_scheme):
Undocumented
def shouldFollowReferences(self):
Whether we traverse references when mirroring.

Subclasses must override this method.

If we encounter a branch reference and this returns false, an error is raised.

ReturnsA boolean to indicate whether to follow a branch reference.
def transformFallbackLocation(self, branch, url):
Validate, maybe modify, 'url' to be used as a stacked-on location.
ParametersbranchThe branch that is being opened.
urlThe URL that the branch provides for its stacked-on location.
Returns(new_url, check) where 'new_url' is the URL of the branch to actually open and 'check' is true if 'new_url' needs to be validated by checkAndFollowBranchReference.
def checkOneURL(self, url):
Check that url is safe to open.
API Documentation for Launchpad, generated by pydoctor at 2019-07-09 00:00:06.