Git Product home page Git Product logo

py-macaroon-bakery's Introduction

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).

py-macaroon-bakery's People

Contributors

albertodonato avatar azzar1 avatar cjwatson avatar fabricematrat avatar frankban avatar johnsca avatar mhilton avatar ricardokirkner avatar rogpeppe avatar techalchemy avatar zoedberg avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.