{ "info": { "author": "Randall Degges", "author_email": "rdegges@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "# flask-samurai\n\n[![Build Status](https://secure.travis-ci.org/rdegges/flask-samurai.png?branch=master)](http://travis-ci.org/rdegges/flask-samurai)\n\nEasily create Heroku addons in Flask.\n\n\n![samurai](https://github.com/rdegges/flask-samurai/raw/master/assets/samurai.jpg)\n\n\n## Meta\n\n* author: Randall Degges\n* email: rdegges@gmail.com\n* status: maintained, in development\n\n\n## Audience\n\nSo, you use [Heroku](http://www.heroku.com/) to host your Flask apps. You like\nthe [addons](http://addons.heroku.com/), and you feel good, but your favorite\n(API / service / tool / whatever) doesn't yet have an addon, and that makes you\nupset.\n\n- You: \"I thought the cloud was supposed to have *everything*! (grumble)\"\n- You: \"I know! I'll make my own addon! I'll even get rich in the process!\"\n\nSo you google \"How can I create a Heroku addon?\" and find the official\n[docs](https://addons.heroku.com/provider), but you're intimidated.\n\n- You: \"There's too much stuff to do. I give up. (grumble)\"\n- You: \"I hate *the cloud* :(\"\n\n**Don't feel bad! Stop whining!**\n\nI've got you covered.\n\n\n## Purpose\n\n`flask-samurai` basically makes building Heroku addons in Flask easier than it\nalready is, and probably easier than it even should be. If you've ever wanted\nto make a Heroku addon, but didn't feel like doing a lot of work,\n`flask-samurai` is probably just the thing you need.\n\nAmong other things, `flask-samurai` will:\n\n- Handle all Heroku API call authentication.\n- Run local tests against your Heroku API calls to make sure you didn't fuck\n anything up.\n- Make adding / removing / changing Heroku addon users insanely easy.\n\n\n## Installation\n\nFrom the command line, run `pip install -U flask-samurai`. If you don't have\n`pip` installed, and you're on Ubuntu (or Debian), try running `sudo apt-get -y\ninstall python-pip` first.\n\n\nNext, you need to add two settings to your Flask configuration:\n\n``` python\n# flask-samurai settings:\nSAMURAI_USERNAME = 'myaddonname'\nSAMURAI_PASSWORD = 'somelongpassword'\n```\n\nThose two settings should be identical to what you've defined in your\n`addon-manifest.json` file that Heroku requires you to generate. If you have no\nidea what the hell I'm talking about, [read\nthis](https://addons.heroku.com/provider/resources/technical/build/getting-started)..\n\nIf you don't know how to configure your Flask app, you should probably [read\nthis](http://flask.pocoo.org/docs/config/).\n\n\n## Usage\n\nRight now, there's only a single decorator to help you do stuff: `heroku`. This\ndecorator basically lets you wrap a Flask view, and ensures that all incoming\nHTTP requests are coming from Heroku directly.\n\nTo use it, do the following:\n\n``` python\nfrom flask import Flask\nfrom samurai.decorators import Heroku\n\napp = Flask(__name__)\napp.config.from_pyfile('settings.py')\n\n# ...\n\n@app.route('/heroku/blah')\n@heroku\ndef blah():\n \"\"\"This view will return a 401 if the request is NOT originated by Heroku.\"\"\"\n return 'hi'\n```\n\nMake sure that the `@heroku` decorator goes beneath the `@app` decorator, as\norder matters.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/rdegges/flask-samurai", "keywords": "python security heroku flask web addon provider", "license": "UNLICENSE", "maintainer": null, "maintainer_email": null, "name": "flask-samurai", "package_url": "https://pypi.org/project/flask-samurai/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/flask-samurai/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/rdegges/flask-samurai" }, "release_url": "https://pypi.org/project/flask-samurai/0.1/", "requires_dist": null, "requires_python": null, "summary": "Easily create Heroku addons in Flask.", "version": "0.1" }, "last_serial": 792042, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "9cb77ad8db4f3ecdd4f148e92976e095", "sha256": "b6ec58c40d03e017f0bdce1890108d41e88fb01258e4a7b7d1ab6134f3532ab7" }, "downloads": -1, "filename": "flask-samurai-0.1.tar.gz", "has_sig": false, "md5_digest": "9cb77ad8db4f3ecdd4f148e92976e095", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28695, "upload_time": "2012-08-06T05:52:13", "url": "https://files.pythonhosted.org/packages/61/ee/4282f9f970314b1e0fd0150ab958647e77ef976a6d182d995b8d547c7cd5/flask-samurai-0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9cb77ad8db4f3ecdd4f148e92976e095", "sha256": "b6ec58c40d03e017f0bdce1890108d41e88fb01258e4a7b7d1ab6134f3532ab7" }, "downloads": -1, "filename": "flask-samurai-0.1.tar.gz", "has_sig": false, "md5_digest": "9cb77ad8db4f3ecdd4f148e92976e095", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28695, "upload_time": "2012-08-06T05:52:13", "url": "https://files.pythonhosted.org/packages/61/ee/4282f9f970314b1e0fd0150ab958647e77ef976a6d182d995b8d547c7cd5/flask-samurai-0.1.tar.gz" } ] }