summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/changelog89
-rw-r--r--debian/compat1
-rw-r--r--debian/control44
-rw-r--r--debian/copyright10
-rw-r--r--debian/patches/improve-unknown-interaction-mock.patch56
-rw-r--r--debian/patches/isolate-from-proxy.patch66
-rw-r--r--debian/patches/series2
-rwxr-xr-xdebian/rules7
-rw-r--r--debian/source/format1
-rw-r--r--debian/watch3
10 files changed, 279 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..c68abec
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,89 @@
+py-macaroon-bakery (1.2.3-1) UNRELEASED; urgency=medium
+
+ [ Ondřej Nový ]
+ * d/watch: Use https protocol.
+
+ [ Colin Watson ]
+ * New upstream release.
+
+ -- Ondřej Nový <onovy@debian.org> Wed, 09 Jan 2019 13:51:12 +0100
+
+py-macaroon-bakery (1.2.1-1) unstable; urgency=medium
+
+ * New upstream release.
+
+ -- Colin Watson <cjwatson@debian.org> Mon, 15 Oct 2018 10:59:57 +0100
+
+py-macaroon-bakery (1.2.0-1) unstable; urgency=medium
+
+ * debian/watch: Switch to PyPI, which upstream updates more reliably than
+ GitHub releases.
+ * New upstream release.
+
+ -- Colin Watson <cjwatson@debian.org> Fri, 12 Oct 2018 15:29:00 +0100
+
+py-macaroon-bakery (1.1.4-1) unstable; urgency=medium
+
+ [ Ondřej Nový ]
+ * Convert git repository from git-dpm to gbp layout
+
+ [ Colin Watson ]
+ * New upstream release.
+
+ -- Colin Watson <cjwatson@debian.org> Mon, 20 Aug 2018 17:54:44 +0100
+
+py-macaroon-bakery (1.1.3-1) unstable; urgency=medium
+
+ * New upstream release.
+
+ -- Colin Watson <cjwatson@debian.org> Wed, 28 Feb 2018 17:09:45 +0000
+
+py-macaroon-bakery (1.1.2-1) unstable; urgency=medium
+
+ * New upstream release.
+
+ -- Colin Watson <cjwatson@debian.org> Tue, 20 Feb 2018 23:47:51 +0000
+
+py-macaroon-bakery (1.1.0-2) unstable; urgency=medium
+
+ * Move VCS to salsa.debian.org.
+ * Improve mock setup for 407-then-unknown test.
+
+ -- Colin Watson <cjwatson@debian.org> Fri, 09 Feb 2018 22:05:55 +0000
+
+py-macaroon-bakery (1.1.0-1) unstable; urgency=medium
+
+ * New upstream release.
+
+ -- Colin Watson <cjwatson@debian.org> Mon, 05 Feb 2018 16:04:22 +0000
+
+py-macaroon-bakery (0.0.6-1) unstable; urgency=medium
+
+ * New upstream release.
+
+ -- Colin Watson <cjwatson@debian.org> Sat, 11 Nov 2017 12:55:42 +0000
+
+py-macaroon-bakery (0.0.5-1) unstable; urgency=medium
+
+ * New upstream release.
+ * Apply https://github.com/go-macaroon-bakery/py-macaroon-bakery/pull/28
+ to isolate client tests from any configured HTTP proxy.
+ * Set Rules-Requires-Root: no.
+
+ -- Colin Watson <cjwatson@debian.org> Mon, 06 Nov 2017 10:42:31 +0000
+
+py-macaroon-bakery (0.0.4-1) unstable; urgency=medium
+
+ * New upstream release.
+ * Cherry-pick
+ https://github.com/go-macaroon-bakery/py-macaroon-bakery/pull/26 to
+ lower protobuf and requests dependencies to versions satisfiable in
+ unstable.
+
+ -- Colin Watson <cjwatson@debian.org> Fri, 03 Nov 2017 16:11:44 +0000
+
+py-macaroon-bakery (0.0.3-1) unstable; urgency=medium
+
+ * Initial release (closes: #866779).
+
+ -- Colin Watson <cjwatson@debian.org> Thu, 02 Nov 2017 14:35:45 +0000
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..ec63514
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+9
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..445bb38
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,44 @@
+Source: py-macaroon-bakery
+Section: python
+Priority: optional
+Maintainer: Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>
+Uploaders: Colin Watson <cjwatson@debian.org>
+Build-Depends: debhelper (>= 9~),
+ dh-python,
+ python3-all,
+ python3-httmock,
+ python3-mock,
+ python3-nacl (>= 1.1.2),
+ python3-nose,
+ python3-protobuf (>= 3.0.0),
+ python3-pymacaroons (>= 0.12.0),
+ python3-requests (>= 2.18.1),
+ python3-rfc3339 (>= 1.0),
+ python3-setuptools,
+ python3-six (>= 1.11.0),
+Standards-Version: 4.1.1
+X-Python3-Version: >= 3.5
+Vcs-Git: https://salsa.debian.org/python-team/modules/py-macaroon-bakery.git
+Vcs-Browser: https://salsa.debian.org/python-team/modules/py-macaroon-bakery
+Homepage: https://github.com/go-macaroon-bakery/py-macaroon-bakery
+Rules-Requires-Root: no
+
+Package: python3-macaroonbakery
+Architecture: all
+Multi-Arch: foreign
+Depends: ${misc:Depends},
+ ${python3:Depends}
+Description: Higher-level macaroon operations for Python 3
+ Macaroons, like cookies, are a form of bearer credential. Unlike opaque
+ tokens, macaroons embed caveats that define specific authorization
+ requirements for the target service, the service that issued the root
+ macaroon and which is capable of verifying the integrity of macaroons it
+ receives.
+ .
+ Macaroons allow for delegation and attenuation of authorization. They are
+ simple and fast to verify, and decouple authorization policy from the
+ enforcement of that policy.
+ .
+ The macaroonbakery library builds on pymacaroons to allow working with
+ macaroons at a higher level, such as by automatically gathering discharge
+ macaroons for third-party caveats from their corresponding services.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..ed4a695
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,10 @@
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: py-macaroon-bakery
+Upstream-Contact: Juju UI Team <juju-gui@lists.ubuntu.com>
+Source: https://github.com/go-macaroon-bakery/py-macaroon-bakery
+
+Files: *
+Copyright: 2017 Canonical Ltd.
+License: LGPL-3
+ On Debian and Debian-based systems, a copy of the GNU Lesser General Public
+ License version 3 is available in /usr/share/common-licenses/LGPL-3.
diff --git a/debian/patches/improve-unknown-interaction-mock.patch b/debian/patches/improve-unknown-interaction-mock.patch
new file mode 100644
index 0000000..b09b3a2
--- /dev/null
+++ b/debian/patches/improve-unknown-interaction-mock.patch
@@ -0,0 +1,56 @@
+From: Colin Watson <cjwatson@debian.org>
+Date: Fri, 9 Feb 2018 21:54:21 +0000
+Subject: Improve mock setup for 407-then-unknown test
+
+`test_407_then_unknown_interaction_methods` causes the client to fetch
+the possible methods supported by the discharger (because it's told that
+it only supports a non-window method). This is currently unmocked,
+which causes the client to actually contact `http://example.com/visit`.
+This fails in Launchpad builds because they run with a restrictive
+network setup that doesn't even expose DNS lookups for non-permitted
+hosts.
+
+There isn't really a good way to simulate this without setting up a
+similar stunt DNS server (though perhaps installing an
+`httmock.all_requests` fallback mock that raises an exception would be a
+good idea?), but this seems to be the only failure at the moment.
+
+Forwarded: https://github.com/go-macaroon-bakery/py-macaroon-bakery/pull/45
+Last-Update: 2018-02-09
+
+Patch-Name: improve-unknown-interaction-mock.patch
+---
+ macaroonbakery/tests/test_bakery.py | 13 ++++++++++++-
+ 1 file changed, 12 insertions(+), 1 deletion(-)
+
+diff --git a/macaroonbakery/tests/test_bakery.py b/macaroonbakery/tests/test_bakery.py
+index 72a6928..1883987 100644
+--- a/macaroonbakery/tests/test_bakery.py
++++ b/macaroonbakery/tests/test_bakery.py
+@@ -146,6 +146,16 @@ def discharge_401(url, request):
+ }
+
+
++@urlmatch(path='.*/visit')
++def visit_200(url, request):
++ return {
++ 'status_code': 200,
++ 'content': {
++ 'interactive': '/visit'
++ }
++ }
++
++
+ @urlmatch(path='.*/wait')
+ def wait_after_401(url, request):
+ if request.url != 'http://example.com/wait':
+@@ -245,7 +255,8 @@ class TestBakery(TestCase):
+ def kind(self):
+ return 'unknown'
+ client = httpbakery.Client(interaction_methods=[UnknownInteractor()])
+- with HTTMock(first_407_then_200), HTTMock(discharge_401):
++ with HTTMock(first_407_then_200), HTTMock(discharge_401),\
++ HTTMock(visit_200):
+ with self.assertRaises(httpbakery.InteractionError) as exc:
+ requests.get(
+ ID_PATH,
diff --git a/debian/patches/isolate-from-proxy.patch b/debian/patches/isolate-from-proxy.patch
new file mode 100644
index 0000000..06cc402
--- /dev/null
+++ b/debian/patches/isolate-from-proxy.patch
@@ -0,0 +1,66 @@
+From: Colin Watson <cjwatson@debian.org>
+Date: Mon, 6 Nov 2017 10:27:10 +0000
+Subject: Isolate client tests from any HTTP proxy
+
+Debian's Python packaging tools set http_proxy to a non-existent proxy
+to help flush out packages that try to talk to the network during build,
+but these tests could previously fail in more normal development
+environments too.
+
+Forwarded: https://github.com/go-macaroon-bakery/py-macaroon-bakery/pull/28
+Last-Update: 2018-02-05
+
+Patch-Name: isolate-from-proxy.patch
+---
+ macaroonbakery/tests/test_bakery.py | 6 ++++++
+ macaroonbakery/tests/test_client.py | 7 +++++++
+ 2 files changed, 13 insertions(+)
+
+diff --git a/macaroonbakery/tests/test_bakery.py b/macaroonbakery/tests/test_bakery.py
+index a6c3e58..72a6928 100644
+--- a/macaroonbakery/tests/test_bakery.py
++++ b/macaroonbakery/tests/test_bakery.py
+@@ -1,5 +1,6 @@
+ # Copyright 2017 Canonical Ltd.
+ # Licensed under the LGPLv3, see LICENCE file for details.
++import os
+ from unittest import TestCase
+
+ import macaroonbakery.httpbakery as httpbakery
+@@ -171,6 +172,11 @@ def wait_on_error(url, request):
+
+
+ class TestBakery(TestCase):
++ def setUp(self):
++ super(TestBakery, self).setUp()
++ # http_proxy would cause requests to talk to the proxy, which is
++ # unlikely to know how to talk to the test server.
++ os.environ.pop('http_proxy', None)
+
+ def assert_cookie_security(self, cookies, name, secure):
+ for cookie in cookies:
+diff --git a/macaroonbakery/tests/test_client.py b/macaroonbakery/tests/test_client.py
+index b03bafa..2ae08d3 100644
+--- a/macaroonbakery/tests/test_client.py
++++ b/macaroonbakery/tests/test_client.py
+@@ -3,6 +3,7 @@
+ import base64
+ import datetime
+ import json
++import os
+ import threading
+ from unittest import TestCase
+
+@@ -27,6 +28,12 @@ TEST_OP = bakery.Op(entity='test', action='test')
+
+
+ class TestClient(TestCase):
++ def setUp(self):
++ super(TestClient, self).setUp()
++ # http_proxy would cause requests to talk to the proxy, which is
++ # unlikely to know how to talk to the test server.
++ os.environ.pop('http_proxy', None)
++
+ def test_single_service_first_party(self):
+ b = new_bakery('loc', None, None)
+
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..f8e7d6e
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,2 @@
+isolate-from-proxy.patch
+improve-unknown-interaction-mock.patch
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..d01c6c6
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,7 @@
+#! /usr/bin/make -f
+
+export PYBUILD_NAME := macaroonbakery
+export PYBUILD_TEST_NOSE := 1
+
+%:
+ dh $@ --with python3 --buildsystem=pybuild
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/debian/watch b/debian/watch
new file mode 100644
index 0000000..2f3e303
--- /dev/null
+++ b/debian/watch
@@ -0,0 +1,3 @@
+version=4
+opts="uversionmangle=s/(rc|a|b|c)/~$1/" \
+ https://pypi.debian.net/macaroonbakery/macaroonbakery@ANY_VERSION@@ARCHIVE_EXT@