[Python-modules-commits] [py-macaroon-bakery] 04/04: Initial release (closes: #866779).

Colin Watson cjwatson at moszumanska.debian.org
Thu Nov 2 14:35:38 UTC 2017


This is an automated email from the git hooks/post-receive script.

cjwatson pushed a commit to branch master
in repository py-macaroon-bakery.

commit f67cdf1c1e5cf5578a2ee79e2a34943b23d842e7
Merge: efdccf6 1c45312
Author: Colin Watson <cjwatson at debian.org>
Date:   Thu Nov 2 14:35:17 2017 +0000

    Initial release (closes: #866779).

 debian/.git-dpm                             |  7 ++-
 debian/changelog                            |  5 ++
 debian/compat                               |  1 +
 debian/control                              | 41 ++++++++++++++
 debian/copyright                            | 10 ++++
 debian/patches/avoid-relative-imports.patch | 83 +++++++++++++++++++++++++++++
 debian/patches/series                       |  1 +
 debian/rules                                |  7 +++
 debian/watch                                |  4 ++
 macaroonbakery/codec.py                     | 11 ++--
 macaroonbakery/macaroon.py                  |  6 +--
 11 files changed, 168 insertions(+), 8 deletions(-)

diff --cc debian/.git-dpm
index c43337b,0000000..f0f64ed
mode 100644,000000..100644
--- a/debian/.git-dpm
+++ b/debian/.git-dpm
@@@ -1,8 -1,0 +1,11 @@@
 +# see git-dpm(1) from git-dpm package
- 79ff2842fa477ee0693ea167c0a74cd7cf080d27
- 79ff2842fa477ee0693ea167c0a74cd7cf080d27
++1c453126cefd68073c089b7b334b8c793b38c152
++1c453126cefd68073c089b7b334b8c793b38c152
 +79ff2842fa477ee0693ea167c0a74cd7cf080d27
 +79ff2842fa477ee0693ea167c0a74cd7cf080d27
 +py-macaroon-bakery_0.0.3.orig.tar.gz
 +5a749b8bfce5cdc00084ced3301a356681c08647
 +29083
++debianTag="debian/%e%v"
++patchedTag="patched/%e%v"
++upstreamTag="upstream/%e%u"
diff --cc debian/changelog
index 0000000,0000000..97f6414
new file mode 100644
--- /dev/null
+++ b/debian/changelog
@@@ -1,0 -1,0 +1,5 @@@
++py-macaroon-bakery (0.0.3-1) UNRELEASED; urgency=medium
++
++  * Initial release (closes: #866779).
++
++ -- Colin Watson <cjwatson at debian.org>  Tue, 31 Oct 2017 10:39:18 +0000
diff --cc debian/compat
index 0000000,0000000..ec63514
new file mode 100644
--- /dev/null
+++ b/debian/compat
@@@ -1,0 -1,0 +1,1 @@@
++9
diff --cc debian/control
index 0000000,0000000..a641fd2
new file mode 100644
--- /dev/null
+++ b/debian/control
@@@ -1,0 -1,0 +1,41 @@@
++Source: py-macaroon-bakery
++Section: python
++Priority: optional
++Maintainer: Debian Python Modules Team <python-modules-team at lists.alioth.debian.org>
++Uploaders: Colin Watson <cjwatson at debian.org>
++Build-Depends: debhelper (>= 9~),
++               dh-python,
++               python3-all,
++               python3-httmock,
++               python3-mock,
++               python3-nacl (>= 1.1.1),
++               python3-nose,
++               python3-pymacaroons (>= 0.10.0),
++               python3-requests (>= 2.16.5),
++               python3-setuptools,
++               python3-six (>= 1.10.0)
++Standards-Version: 4.1.1
++X-Python3-Version: >= 3.5
++Vcs-Git: https://anonscm.debian.org/git/python-modules/packages/py-macaroon-bakery.git
++Vcs-Browser: https://anonscm.debian.org/cgit/python-modules/packages/py-macaroon-bakery.git
++Homepage: https://github.com/go-macaroon-bakery/py-macaroon-bakery
++
++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 --cc debian/copyright
index 0000000,0000000..ed4a695
new file mode 100644
--- /dev/null
+++ b/debian/copyright
@@@ -1,0 -1,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 at 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 --cc debian/patches/avoid-relative-imports.patch
index 0000000,0000000..4b02a1e
new file mode 100644
--- /dev/null
+++ b/debian/patches/avoid-relative-imports.patch
@@@ -1,0 -1,0 +1,83 @@@
++From 1c453126cefd68073c089b7b334b8c793b38c152 Mon Sep 17 00:00:00 2001
++From: Colin Watson <cjwatson at debian.org>
++Date: Thu, 2 Nov 2017 14:16:23 +0000
++Subject: Avoid relative imports to fix Python 3 tests
++
++This is fixed in a different way in 0.0.4.
++
++Forwarded: not-needed
++Last-Update: 2017-11-02
++
++Patch-Name: avoid-relative-imports.patch
++---
++ macaroonbakery/codec.py    | 11 ++++++++---
++ macaroonbakery/macaroon.py |  6 +++---
++ 2 files changed, 11 insertions(+), 6 deletions(-)
++
++diff --git a/macaroonbakery/codec.py b/macaroonbakery/codec.py
++index 4015bbb..f5cc493 100644
++--- a/macaroonbakery/codec.py
+++++ b/macaroonbakery/codec.py
++@@ -3,14 +3,13 @@
++ 
++ import base64
++ import json
++-import namespace
+++from macaroonbakery import namespace
++ 
++ from nacl.public import Box, PublicKey
++ from nacl.encoding import Base64Encoder
++ import six
++ 
++-import bakery
++-import macaroon
+++from macaroonbakery import bakery
++ 
++ _PUBLIC_KEY_PREFIX_LEN = 4
++ _KEY_LEN = 32
++@@ -178,6 +177,8 @@ def _decode_caveat_v1(key, caveat):
++     @param caveat a base64 encoded JSON string.
++     '''
++ 
+++    from macaroonbakery import macaroon
+++
++     data = base64.b64decode(caveat).decode('utf-8')
++     wrapper = json.loads(data)
++     tp_public_key = PublicKey(base64.b64decode(wrapper['ThirdPartyPublicKey']))
++@@ -212,6 +213,8 @@ def _decode_caveat_v1(key, caveat):
++ def _decode_caveat_v2_v3(version, key, caveat):
++     '''Decodes a version 2 or version 3 caveat.
++     '''
+++    from macaroonbakery import macaroon
+++
++     if (len(caveat) < 1 + _PUBLIC_KEY_PREFIX_LEN +
++             _KEY_LEN + Box.NONCE_SIZE + 16):
++         raise ValueError('caveat id too short')
++@@ -243,6 +246,8 @@ def _decode_caveat_v2_v3(version, key, caveat):
++ 
++ 
++ def _decode_secret_part_v2_v3(version, data):
+++    from macaroonbakery import macaroon
+++
++     if len(data) < 1:
++         raise ValueError('secret part too short')
++     got_version = six.byte2int(data[:1])
++diff --git a/macaroonbakery/macaroon.py b/macaroonbakery/macaroon.py
++index b0a89bb..954161c 100644
++--- a/macaroonbakery/macaroon.py
+++++ b/macaroonbakery/macaroon.py
++@@ -6,11 +6,11 @@ import copy
++ import logging
++ import os
++ 
++-import bakery
++-import codec
+++from macaroonbakery import bakery
+++from macaroonbakery import codec
++ import pymacaroons
++ 
++-import namespace
+++from macaroonbakery import namespace
++ 
++ MACAROON_V1, MACAROON_V2 = 1, 2
++ 
diff --cc debian/patches/series
index 0000000,0000000..5b8cfe5
new file mode 100644
--- /dev/null
+++ b/debian/patches/series
@@@ -1,0 -1,0 +1,1 @@@
++avoid-relative-imports.patch
diff --cc debian/rules
index 0000000,0000000..d01c6c6
new file mode 100755
--- /dev/null
+++ b/debian/rules
@@@ -1,0 -1,0 +1,7 @@@
++#! /usr/bin/make -f
++
++export PYBUILD_NAME := macaroonbakery
++export PYBUILD_TEST_NOSE := 1
++
++%:
++	dh $@ --with python3 --buildsystem=pybuild
diff --cc debian/watch
index 0000000,0000000..3b4de03
new file mode 100644
--- /dev/null
+++ b/debian/watch
@@@ -1,0 -1,0 +1,4 @@@
++version=4
++opts="filenamemangle=s%(?:.*?)?v?(\d[\d.]*)\.tar\.gz%py-macaroon-bakery-$1.tar.gz%" \
++    https://github.com/go-macaroon-bakery/py-macaroon-bakery/releases \
++    (?:.*?/)?v?(\d[\d.]*)\.tar\.gz

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/py-macaroon-bakery.git



More information about the Python-modules-commits mailing list