← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~cjwatson/launchpad/code-import-drop-macaroon-config-compat into lp:launchpad

 

Colin Watson has proposed merging lp:~cjwatson/launchpad/code-import-drop-macaroon-config-compat into lp:launchpad.

Commit message:
Remove compatibility with old codeimport.macaroon_secret_key configuration.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/code-import-drop-macaroon-config-compat/+merge/368054

This was removed on production a few weeks ago (https://portal.admin.canonical.com/C118606).
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~cjwatson/launchpad/code-import-drop-macaroon-config-compat into lp:launchpad.
=== modified file 'lib/lp/code/model/codeimportjob.py'
--- lib/lp/code/model/codeimportjob.py	2019-05-01 15:47:37 +0000
+++ lib/lp/code/model/codeimportjob.py	2019-05-29 11:10:12 +0000
@@ -420,10 +420,6 @@
     def _root_secret(self):
         secret = config.launchpad.internal_macaroon_secret_key
         if not secret:
-            # XXX cjwatson 2018-11-01: Remove this once it is no longer in
-            # production configs.
-            secret = config.codeimport.macaroon_secret_key
-        if not secret:
             raise RuntimeError(
                 "launchpad.internal_macaroon_secret_key not configured.")
         return secret

=== modified file 'lib/lp/code/model/tests/test_codeimportjob.py'
--- lib/lp/code/model/tests/test_codeimportjob.py	2019-05-22 14:57:45 +0000
+++ lib/lp/code/model/tests/test_codeimportjob.py	2019-05-29 11:10:12 +0000
@@ -1307,11 +1307,6 @@
                 caveat_id="lp.code-import-job %s" % job.id),
             ]))
 
-    def test_issueMacaroon_good_old_config(self):
-        self.pushConfig("launchpad", internal_macaroon_secret_key="")
-        self.pushConfig("codeimport", macaroon_secret_key="some-secret")
-        self.test_issueMacaroon_good()
-
     def test_issueMacaroon_not_via_authserver(self):
         job = self.makeJob()
         private_root = getUtility(IPrivateApplication)


Follow ups