← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/launchpad:charmhub-more-permissions into launchpad:master

 

Colin Watson has proposed merging ~cjwatson/launchpad:charmhub-more-permissions into launchpad:master.

Commit message:
Request package-view-revisions Charmhub permission

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/408366

`CharmhubClient.checkStatus` needs this.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:charmhub-more-permissions into launchpad:master.
diff --git a/lib/lp/charms/browser/tests/test_charmrecipe.py b/lib/lp/charms/browser/tests/test_charmrecipe.py
index 617cdf0..b665f96 100644
--- a/lib/lp/charms/browser/tests/test_charmrecipe.py
+++ b/lib/lp/charms/browser/tests/test_charmrecipe.py
@@ -356,6 +356,7 @@ class TestCharmRecipeAddView(BaseTestCharmRecipeView):
                             "permissions": [
                                 "package-manage-releases",
                                 "package-manage-revisions",
+                                "package-view-revisions",
                                 ],
                             })))),
             MatchesStructure(
@@ -627,6 +628,7 @@ class TestCharmRecipeAuthorizeView(BaseTestCharmRecipeView):
                                 "permissions": [
                                     "package-manage-releases",
                                     "package-manage-revisions",
+                                    "package-view-revisions",
                                     ],
                                 })))),
                 MatchesStructure(
diff --git a/lib/lp/charms/interfaces/charmhubclient.py b/lib/lp/charms/interfaces/charmhubclient.py
index c1b4a37..7f6443e 100644
--- a/lib/lp/charms/interfaces/charmhubclient.py
+++ b/lib/lp/charms/interfaces/charmhubclient.py
@@ -71,8 +71,9 @@ class ICharmhubClient(Interface):
         """Request permission from Charmhub to upload builds of a charm.
 
         We need the following permissions: `package-manage-revisions` (to
-        upload new blobs) and `package-manage-releases` (to release
-        revisions).
+        upload new blobs), `package-manage-releases` (to release revisions),
+        and `package-view-revisions` (to check the status of uploaded
+        blobs).
 
         The returned macaroon will include a third-party caveat that must be
         discharged by Candid.  This method does not acquire that discharge;
diff --git a/lib/lp/charms/model/charmhubclient.py b/lib/lp/charms/model/charmhubclient.py
index 112a73e..4b275b0 100644
--- a/lib/lp/charms/model/charmhubclient.py
+++ b/lib/lp/charms/model/charmhubclient.py
@@ -103,6 +103,7 @@ class CharmhubClient:
                     "permissions": [
                         "package-manage-releases",
                         "package-manage-revisions",
+                        "package-view-revisions",
                         ],
                     })
             response_data = response.json()
diff --git a/lib/lp/charms/tests/test_charmhubclient.py b/lib/lp/charms/tests/test_charmhubclient.py
index 176b14c..87e9cca 100644
--- a/lib/lp/charms/tests/test_charmhubclient.py
+++ b/lib/lp/charms/tests/test_charmhubclient.py
@@ -181,6 +181,7 @@ class TestCharmhubClient(TestCaseWithFactory):
                 "permissions": [
                     "package-manage-releases",
                     "package-manage-revisions",
+                    "package-view-revisions",
                     ],
                 }))
         self.assertEqual("sentinel", macaroon)
diff --git a/lib/lp/charms/tests/test_charmrecipe.py b/lib/lp/charms/tests/test_charmrecipe.py
index 7599d27..5817c09 100644
--- a/lib/lp/charms/tests/test_charmrecipe.py
+++ b/lib/lp/charms/tests/test_charmrecipe.py
@@ -702,6 +702,7 @@ class TestCharmRecipeAuthorization(TestCaseWithFactory):
                             "permissions": [
                                 "package-manage-releases",
                                 "package-manage-revisions",
+                                "package-view-revisions",
                                 ],
                             })))),
             ]))