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

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: 2fe1d2d7f508bdf214706b909de9d3eea759afdc
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/launchpad:charmhub-more-permissions
Merge into: launchpad:master
Diff against target: 72 lines (+8/-2)
5 files modified
lib/lp/charms/browser/tests/test_charmrecipe.py (+2/-0)
lib/lp/charms/interfaces/charmhubclient.py (+3/-2)
lib/lp/charms/model/charmhubclient.py (+1/-0)
lib/lp/charms/tests/test_charmhubclient.py (+1/-0)
lib/lp/charms/tests/test_charmrecipe.py (+1/-0)
Reviewer Review Type Date Requested Status
Cristian Gonzalez (community) Approve
Review via email: mp+408366@code.launchpad.net

Commit message

Request package-view-revisions Charmhub permission

Description of the change

`CharmhubClient.checkStatus` needs this.

To post a comment you must log in.
Revision history for this message
Cristian Gonzalez (cristiangsp) wrote :

Looks good!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/lib/lp/charms/browser/tests/test_charmrecipe.py b/lib/lp/charms/browser/tests/test_charmrecipe.py
2index 617cdf0..b665f96 100644
3--- a/lib/lp/charms/browser/tests/test_charmrecipe.py
4+++ b/lib/lp/charms/browser/tests/test_charmrecipe.py
5@@ -356,6 +356,7 @@ class TestCharmRecipeAddView(BaseTestCharmRecipeView):
6 "permissions": [
7 "package-manage-releases",
8 "package-manage-revisions",
9+ "package-view-revisions",
10 ],
11 })))),
12 MatchesStructure(
13@@ -627,6 +628,7 @@ class TestCharmRecipeAuthorizeView(BaseTestCharmRecipeView):
14 "permissions": [
15 "package-manage-releases",
16 "package-manage-revisions",
17+ "package-view-revisions",
18 ],
19 })))),
20 MatchesStructure(
21diff --git a/lib/lp/charms/interfaces/charmhubclient.py b/lib/lp/charms/interfaces/charmhubclient.py
22index c1b4a37..7f6443e 100644
23--- a/lib/lp/charms/interfaces/charmhubclient.py
24+++ b/lib/lp/charms/interfaces/charmhubclient.py
25@@ -71,8 +71,9 @@ class ICharmhubClient(Interface):
26 """Request permission from Charmhub to upload builds of a charm.
27
28 We need the following permissions: `package-manage-revisions` (to
29- upload new blobs) and `package-manage-releases` (to release
30- revisions).
31+ upload new blobs), `package-manage-releases` (to release revisions),
32+ and `package-view-revisions` (to check the status of uploaded
33+ blobs).
34
35 The returned macaroon will include a third-party caveat that must be
36 discharged by Candid. This method does not acquire that discharge;
37diff --git a/lib/lp/charms/model/charmhubclient.py b/lib/lp/charms/model/charmhubclient.py
38index 112a73e..4b275b0 100644
39--- a/lib/lp/charms/model/charmhubclient.py
40+++ b/lib/lp/charms/model/charmhubclient.py
41@@ -103,6 +103,7 @@ class CharmhubClient:
42 "permissions": [
43 "package-manage-releases",
44 "package-manage-revisions",
45+ "package-view-revisions",
46 ],
47 })
48 response_data = response.json()
49diff --git a/lib/lp/charms/tests/test_charmhubclient.py b/lib/lp/charms/tests/test_charmhubclient.py
50index 176b14c..87e9cca 100644
51--- a/lib/lp/charms/tests/test_charmhubclient.py
52+++ b/lib/lp/charms/tests/test_charmhubclient.py
53@@ -181,6 +181,7 @@ class TestCharmhubClient(TestCaseWithFactory):
54 "permissions": [
55 "package-manage-releases",
56 "package-manage-revisions",
57+ "package-view-revisions",
58 ],
59 }))
60 self.assertEqual("sentinel", macaroon)
61diff --git a/lib/lp/charms/tests/test_charmrecipe.py b/lib/lp/charms/tests/test_charmrecipe.py
62index 7599d27..5817c09 100644
63--- a/lib/lp/charms/tests/test_charmrecipe.py
64+++ b/lib/lp/charms/tests/test_charmrecipe.py
65@@ -702,6 +702,7 @@ class TestCharmRecipeAuthorization(TestCaseWithFactory):
66 "permissions": [
67 "package-manage-releases",
68 "package-manage-revisions",
69+ "package-view-revisions",
70 ],
71 })))),
72 ]))

Subscribers

People subscribed via source and target branches

to status/vote changes: