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

Part of lp.codehosting.safe_open View In Hierarchy

Branch policy that only allows certain URLs.
Method __init__ Undocumented
Method shouldFollowReferences Whether we traverse references when mirroring.
Method checkOneURL Check the safety of the source URL.
Method transformFallbackLocation See BranchOpenPolicy.transformFallbackLocation.
def __init__(self, should_follow_references, allowed_urls=None, check=False):
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 checkOneURL(self, url):
Check the safety of the source URL.

Subclasses must override this method.

ParametersurlThe source URL to check.
RaisesBadUrlsubclasses are expected to raise this or a subclass when it finds a URL it deems to be unsafe.
def transformFallbackLocation(self, branch, url):
See BranchOpenPolicy.transformFallbackLocation.

Here we return the URL that would be used anyway and optionally check it.

API Documentation for Launchpad, generated by pydoctor at 2019-07-09 00:00:06.