{"pull_request":{"state":"open","user":{"avatar_url":"https://secure.gravatar.com/avatar/c5a7f21b46df698f3db31c37ed0cf55a?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"c5a7f21b46df698f3db31c37ed0cf55a","url":"https://api.github.com/users/nvie","login":"nvie","id":83844},"merged_by":null,"deletions":6,"updated_at":"2011-11-06T13:08:24Z","comments":0,"base":{"ref":"master","user":{"avatar_url":"https://secure.gravatar.com/avatar/181de1fb11dffe39774f3e2e23cda3b6?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"181de1fb11dffe39774f3e2e23cda3b6","url":"https://api.github.com/users/mitsuhiko","login":"mitsuhiko","id":7396},"repo":{"name":"flask-oauth","pushed_at":"2011-10-13T15:25:37Z","master_branch":null,"fork":false,"clone_url":"https://github.com/mitsuhiko/flask-oauth.git","updated_at":"2011-11-06T11:31:48Z","open_issues":8,"homepage":"http://flask.pocoo.org/","language":"Python","forks":17,"private":false,"svn_url":"https://svn.github.com/mitsuhiko/flask-oauth","url":"https://api.github.com/repos/mitsuhiko/flask-oauth","owner":{"avatar_url":"https://secure.gravatar.com/avatar/181de1fb11dffe39774f3e2e23cda3b6?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"181de1fb11dffe39774f3e2e23cda3b6","url":"https://api.github.com/users/mitsuhiko","login":"mitsuhiko","id":7396},"html_url":"https://github.com/mitsuhiko/flask-oauth","description":"OAuth Support for Flask","size":204,"id":656526,"watchers":64,"git_url":"git://github.com/mitsuhiko/flask-oauth.git","created_at":"2010-05-08T15:14:53Z","ssh_url":"git@github.com:mitsuhiko/flask-oauth.git"},"label":"mitsuhiko:master","sha":"0bc1c171ecd91f2a00d3649f05f7afacee6aab27"},"commits":1,"diff_url":"https://github.com/mitsuhiko/flask-oauth/pull/16.diff","closed_at":null,"additions":21,"merged":false,"head":{"ref":"master","user":{"avatar_url":"https://secure.gravatar.com/avatar/c5a7f21b46df698f3db31c37ed0cf55a?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"c5a7f21b46df698f3db31c37ed0cf55a","url":"https://api.github.com/users/nvie","login":"nvie","id":83844},"repo":{"name":"flask-oauth","pushed_at":"2011-11-06T13:05:21Z","master_branch":null,"fork":true,"clone_url":"https://github.com/nvie/flask-oauth.git","updated_at":"2011-11-06T13:05:24Z","open_issues":0,"homepage":"http://flask.pocoo.org/","language":"Python","forks":0,"private":false,"svn_url":"https://svn.github.com/nvie/flask-oauth","url":"https://api.github.com/repos/nvie/flask-oauth","owner":{"avatar_url":"https://secure.gravatar.com/avatar/c5a7f21b46df698f3db31c37ed0cf55a?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"c5a7f21b46df698f3db31c37ed0cf55a","url":"https://api.github.com/users/nvie","login":"nvie","id":83844},"html_url":"https://github.com/nvie/flask-oauth","description":"OAuth Support for Flask","size":120,"id":2719824,"watchers":1,"git_url":"git://github.com/nvie/flask-oauth.git","created_at":"2011-11-06T11:31:48Z","ssh_url":"git@github.com:nvie/flask-oauth.git"},"label":"nvie:master","sha":"36196341828c15152828b33304cf912a8ba04fc0"},"url":"https://api.github.com/repos/mitsuhiko/flask-oauth/pulls/16","merged_at":null,"body":"Currently, Flask-OAuth supported only a single token per OAuth instance. This means that you can, for example, sign up with your Twitter account, and send tweets from that account, but if you sign up with multiple Twitter accounts, you are unable to send tweets from an arbitrary one of them (at least not without residing to evil solutions like keeping global state with the \"default\" OAuth token to use).\r\n\r\nWhat this patch adds:\r\n\r\n* Each of OAuth's request methods (get, post, put, delete, and request) gets an optional `token` argument, which can be passed in to send the request using that token.\r\n* The token will be passed to the `tokengetter_func`.  The tokengetter function thus can be prepared to receive a `token` argument.  For example:\r\n\r\n      @twitter.tokengetter\r\n      def my_token_getter(token=None):\r\n          if token is not None:  # During auth, token won't be passed\r\n              oauth_secret = get_my_secret_for_token(token)\r\n              return (token, oauth_secret)\r\n          return None\r\n\r\n* For backwards-compatibility, the `token` argument will only be passed to the `tokengetter_func` when it is explicitly passed as a kwarg to one of the request methods.\r\n\r\n@mitsuhiko: Please let me know what you think of this patch or this approach. If you'd like to merge this in Flask-OAuth, I'd be happy to write paragraph or two of documentation for this patch, too.","html_url":"https://github.com/mitsuhiko/flask-oauth/pull/16","issue_url":"https://github.com/mitsuhiko/flask-oauth/issues/16","_links":{"comments":{"href":"https://api.github.com/repos/mitsuhiko/flask-oauth/issues/16/comments"},"html":{"href":"https://github.com/mitsuhiko/flask-oauth/pull/16"},"review_comments":{"href":"https://api.github.com/repos/mitsuhiko/flask-oauth/pulls/16/comments"},"self":{"href":"https://api.github.com/repos/mitsuhiko/flask-oauth/pulls/16"}},"review_comments":0,"title":"Add support to send requests on behalf of multiple OAuth tokens","number":16,"mergeable":null,"id":467573,"patch_url":"https://github.com/mitsuhiko/flask-oauth/pull/16.patch","changed_files":1,"created_at":"2011-11-06T13:08:24Z"},"action":"opened","number":16}