summaryrefslogtreecommitdiff
path: root/README.rst
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2017-10-31 10:34:41 +0000
committerColin Watson <cjwatson@debian.org>2017-10-31 10:34:41 +0000
commit79ff2842fa477ee0693ea167c0a74cd7cf080d27 (patch)
treed0eb436672c1a73088fce42f939bdf4cf6f4427b /README.rst
Import py-macaroon-bakery_0.0.3.orig.tar.gz
Diffstat (limited to 'README.rst')
-rw-r--r--README.rst35
1 files changed, 35 insertions, 0 deletions
diff --git a/README.rst b/README.rst
new file mode 100644
index 0000000..c3c06de
--- /dev/null
+++ b/README.rst
@@ -0,0 +1,35 @@
+===============
+Macaroon Bakery
+===============
+
+A Python library for working with macaroons.
+
+
+Installation
+------------
+The easiest way to install macaroonbakery is via pip::
+
+ $ pip install macaroonbakery
+
+macaroonbakery was developed around pymacaroons. On ubuntu, you
+can get libsodium from a ppa::
+
+ $ sudo add-apt-repository ppa:yellow/ppa -y
+ $ apt-get install libsodium13
+
+Usage
+-----
+Interacting with a protected url, you can use the BakeryAuth provided to deal
+with the macaroon bakery
+
+ >>> from macaroonbakery import httpbakery
+ >>> jar = requests.cookies.RequestsCookieJar()
+ >>> resp = requests.get('some protected url',
+ cookies=jar,
+ auth=httpbakery.BakeryAuth(cookies=jar))
+ >>> resp.raise_for_status()
+
+
+You can use any cookie storage you'd like so next subsequent calls the macaroon
+saved in the cookie jar will be directly used and will not require
+any other authentication (for example, cookielib.FileCookieJar).