omniauth-venmo 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 60bdfd003b5d583bfadcb37f10841a063cc7ddf2
4
- data.tar.gz: ab3676ea93ee823dcfe07e623f4d6506cd343755
3
+ metadata.gz: 43c3c6a45b943b060325c3531cd415e6faf67a24
4
+ data.tar.gz: 6a1ffdfead99d716690ede1aa0140150bec37bd8
5
5
  SHA512:
6
- metadata.gz: cf9bd0ae7115a489990b7698fc69c0d510da4af43bdd0494159338f9881c770fff0428464c6b1384d22f54c7c2e46056b6a2606810648358744df744250a69ae
7
- data.tar.gz: 6b983c319373e6c23acd31898f7cb39daaaea3176967012ea8baec625ee86a01b2407645d42d4ea5ebecfd4eb88b8c37b8db86ae75fd4f77420fdd90b097e87f
6
+ metadata.gz: c2ec28de14cdf3ceadbe8827508707262479242b0147f77095fdd2beb380a8e7c96714ff3c1614e6b5e09157ec608101f154a9e37cd43854eeb81ea68d300030
7
+ data.tar.gz: 11937b054a35d26978812e810abf53b6d440f018fc59f1b51ca866ae52b1a5e43ec74ba2eed12132db9041531d2020a574e70894ad423eb23e81a9fdfd922be4
data/.travis.yml ADDED
@@ -0,0 +1,13 @@
1
+ bundler_args: --without development
2
+ gemfile:
3
+ - Gemfile
4
+ language: ruby
5
+ rvm:
6
+ - rbx-18mode
7
+ - rbx-19mode
8
+ - jruby-18mode
9
+ - jruby-19mode
10
+ - 1.8.7
11
+ - 1.9.2
12
+ - 1.9.3
13
+ - 2.0.0
data/Gemfile CHANGED
@@ -1,2 +1,12 @@
1
1
  source 'https://rubygems.org'
2
+
3
+ gem 'rake'
4
+
5
+ group :test do
6
+ gem 'coveralls', :require => false
7
+ gem 'rack-test'
8
+ gem 'rspec', '~> 2.7'
9
+ gem 'simplecov', :require => false
10
+ end
11
+
2
12
  gemspec
data/README.md ADDED
@@ -0,0 +1,94 @@
1
+ omniauth-venmo
2
+ ==============
3
+
4
+ [![Gem Version](https://badge.fury.io/rb/omniauth-venmo.png)](http://badge.fury.io/rb/omniauth-venmo)
5
+ [![Build Status](https://travis-ci.org/tmilewski/omniauth-venmo.png?branch=master)](https://travis-ci.org/tmilewski/omniauth-venmo)
6
+
7
+ Venmo OAuth2 Strategy for OmniAuth 1.x and supports the OAuth 2.0 server-side flow.
8
+
9
+ *Venmo API docs are currently in the works and will be released upon completion.*
10
+
11
+ ## Installation
12
+
13
+ Add to your `Gemfile`:
14
+
15
+ ```ruby
16
+ gem 'omniauth-venmo'
17
+ ```
18
+
19
+ Then `bundle install`.
20
+
21
+
22
+ ## Usage
23
+
24
+ `OmniAuth::Strategies::Venmo` is simply a Rack middleware. Read the OmniAuth 1.0 docs for detailed instructions: https://github.com/intridea/omniauth.
25
+
26
+ Here's a quick example, adding the middleware to a Rails app in `config/initializers/omniauth.rb`:
27
+
28
+ ```ruby
29
+ Rails.application.config.middleware.use OmniAuth::Builder do
30
+ provider :venmo, ENV['VENMO_CLIENT_ID'], ENV['VENMO_CLIENT_SECRET']
31
+ end
32
+ ```
33
+
34
+ ## Configuration
35
+
36
+ Currently, there is only one configuration option that needs to be set:
37
+
38
+ * `scope`: A comma-separated list of permissions you want to request from the user. The available permissions are as follows: `access_feed`, `access_profile`, `access_friends`, and `make_payments`. Default: `access_profile`
39
+
40
+ ```ruby
41
+ Rails.application.config.middleware.use OmniAuth::Builder do
42
+ provider :venmo, ENV['VENMO_CLIENT_ID'], ENV['VENMO_CLIENT_SECRET'], :scope => 'access_profile,make_payments'
43
+ end
44
+ ```
45
+
46
+ ## Auth Hash
47
+
48
+ Here's an example *Auth Hash* available in `request.env['omniauth.auth']`:
49
+
50
+ ```ruby
51
+ {
52
+ :provider => 'venmo',
53
+ :uid => '1234567',
54
+ :info => {
55
+ :username => 'tmilewski',
56
+ :email => 'foo@bar.com',
57
+ :phone => '16105553287',
58
+ :name => 'Tom Milewski',
59
+ :first_name => 'Tom',
60
+ :last_name => 'Milewski',
61
+ :image => 'https://venmopics.appspot.com/u/v1/s/caa2d1a7-192d-4516-bfef-4ef8a1cd9dbe',
62
+ :balance => 0.0,
63
+ :urls => { :profile => 'https://venmo.com/tmilewski' },
64
+ },
65
+ :credentials => {
66
+ :token => 'ABCDEF...',
67
+ :expires => false
68
+ },
69
+ :extra => {
70
+ :raw_info => {
71
+ :id => '1234567',
72
+ :username => 'tmilewski',
73
+ :email => 'foo@bar.com',
74
+ :phone => '16105553287',
75
+ :name => 'Tom Milewski',
76
+ :firstname => 'Tom',
77
+ :lastname => 'Milewski',
78
+ :picture => 'https://venmopics.appspot.com/u/v1/s/caa2d1a7-192d-4516-bfef-4ef8a1cd9dbe',
79
+ :balance => 0.0,
80
+ :urls => { :profile => 'https://venmo.com/tmilewski' },
81
+ }
82
+ }
83
+ }
84
+ ```
85
+
86
+ ## License
87
+
88
+ Copyright (c) 2013 by Tom Milewski
89
+
90
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
91
+
92
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
93
+
94
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,7 +1,5 @@
1
1
  require 'omniauth-oauth2'
2
2
 
3
- # access_feed, access_profile, access_friends, make_payments
4
-
5
3
  module OmniAuth
6
4
  module Strategies
7
5
  class Venmo < OmniAuth::Strategies::OAuth2
@@ -27,7 +25,7 @@ module OmniAuth
27
25
  'image' => raw_info['picture'],
28
26
  'balance' => raw_info['balance'],
29
27
  'urls' => {
30
- 'profile' => nil # TODO: Fill in when Venmo is back online.
28
+ 'profile' => "https://venmo.com/#{raw_info['username']}"
31
29
  }
32
30
  })
33
31
  end
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module Venmo
3
- VERSION = "1.0.0"
3
+ VERSION = "1.0.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-venmo
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Milewski
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-09 00:00:00.000000000 Z
11
+ date: 2013-10-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth
@@ -116,8 +116,9 @@ extensions: []
116
116
  extra_rdoc_files: []
117
117
  files:
118
118
  - .gitignore
119
+ - .travis.yml
119
120
  - Gemfile
120
- - Guardfile
121
+ - README.md
121
122
  - Rakefile
122
123
  - lib/omniauth-venmo.rb
123
124
  - lib/omniauth/strategies/venmo.rb
data/Guardfile DELETED
@@ -1,10 +0,0 @@
1
- guard 'rspec', :version => 2 do
2
- watch(%r{^spec/.+_spec\.rb$})
3
- watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
4
- watch('spec/spec_helper.rb') { "spec" }
5
- end
6
-
7
- guard 'bundler' do
8
- watch('Gemfile')
9
- watch(/^.+\.gemspec/)
10
- end