launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #29410
[Merge] ~cjwatson/launchpad:chroot-url-https into launchpad:master
Colin Watson has proposed merging ~cjwatson/launchpad:chroot-url-https into launchpad:master.
Commit message:
Link to chroot URLs using HTTPS
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/433445
If you're fetching a chroot for a `DistroArchSeries`, then you probably intend to chroot into it and thus execute code from it, so it seems like a good idea to provide at least transport-level security for the code contained in it.
--
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:chroot-url-https into launchpad:master.
diff --git a/lib/lp/services/librarian/interfaces/__init__.py b/lib/lp/services/librarian/interfaces/__init__.py
index 8a2fd89..84a2d50 100644
--- a/lib/lp/services/librarian/interfaces/__init__.py
+++ b/lib/lp/services/librarian/interfaces/__init__.py
@@ -79,7 +79,9 @@ class ILibraryFileAlias(Interface):
# XXX Guilherme Salgado, 2007-01-18 bug=80487:
# We can't use TextLine here because they return
# byte strings.
- http_url = Attribute(_("The http URL to this file"))
+ http_url = Attribute(
+ _("The http URL to this file; consider using getURL() instead")
+ )
https_url = Attribute(_("The https URL to this file"))
private_url = Attribute(_("The secure URL to this file (private files)"))
diff --git a/lib/lp/soyuz/browser/tests/test_distroarchseries_webservice.py b/lib/lp/soyuz/browser/tests/test_distroarchseries_webservice.py
index 16c6daa..db9a3c2 100644
--- a/lib/lp/soyuz/browser/tests/test_distroarchseries_webservice.py
+++ b/lib/lp/soyuz/browser/tests/test_distroarchseries_webservice.py
@@ -224,8 +224,8 @@ class TestDistroArchSeriesWebservice(TestCaseWithFactory):
pocket=PackagePublishingPocket.UPDATES
)
self.assertEqual(sha1_2, updates_chroot.content.sha1)
- release_chroot_url = release_chroot.http_url
- updates_chroot_url = updates_chroot.http_url
+ release_chroot_url = release_chroot.getURL()
+ updates_chroot_url = updates_chroot.getURL()
response = ws.named_get(das_url, "getChrootURL", pocket="Release")
self.assertEqual(200, response.status)
self.assertEqual(release_chroot_url, response.jsonBody())
@@ -257,7 +257,7 @@ class TestDistroArchSeriesWebservice(TestCaseWithFactory):
pocket=PackagePublishingPocket.UPDATES
)
self.assertEqual(sha1_2, updates_chroot.content.sha1)
- updates_chroot_url = updates_chroot.http_url
+ updates_chroot_url = updates_chroot.getURL()
response = ws.named_get(das_url, "getChrootURL", pocket="Release")
self.assertEqual(200, response.status)
self.assertEqual(release_chroot_url, response.jsonBody())
@@ -296,8 +296,8 @@ class TestDistroArchSeriesWebservice(TestCaseWithFactory):
self.assertEqual(sha1_1, chroot_image.content.sha1)
lxd_image = das.getChroot(image_type=BuildBaseImageType.LXD)
self.assertEqual(sha1_2, lxd_image.content.sha1)
- chroot_image_url = chroot_image.http_url
- lxd_image_url = lxd_image.http_url
+ chroot_image_url = chroot_image.getURL()
+ lxd_image_url = lxd_image.getURL()
response = ws.named_get(
das_url, "getChrootURL", image_type="Chroot tarball"
)
diff --git a/lib/lp/soyuz/model/distroarchseries.py b/lib/lp/soyuz/model/distroarchseries.py
index b7eb150..66cd8b1 100644
--- a/lib/lp/soyuz/model/distroarchseries.py
+++ b/lib/lp/soyuz/model/distroarchseries.py
@@ -175,7 +175,7 @@ class DistroArchSeries(SQLBase):
chroot = self.getChroot(pocket=pocket, image_type=image_type)
if chroot is None:
return None
- return chroot.http_url
+ return chroot.getURL()
def getChrootHash(self, pocket, image_type):
"""See `IDistroArchSeries`."""