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 +4 -4
- data/.travis.yml +13 -0
- data/Gemfile +10 -0
- data/README.md +94 -0
- data/lib/omniauth/strategies/venmo.rb +1 -3
- data/lib/omniauth/venmo/version.rb +1 -1
- metadata +4 -3
- data/Guardfile +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 43c3c6a45b943b060325c3531cd415e6faf67a24
|
4
|
+
data.tar.gz: 6a1ffdfead99d716690ede1aa0140150bec37bd8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c2ec28de14cdf3ceadbe8827508707262479242b0147f77095fdd2beb380a8e7c96714ff3c1614e6b5e09157ec608101f154a9e37cd43854eeb81ea68d300030
|
7
|
+
data.tar.gz: 11937b054a35d26978812e810abf53b6d440f018fc59f1b51ca866ae52b1a5e43ec74ba2eed12132db9041531d2020a574e70894ad423eb23e81a9fdfd922be4
|
data/.travis.yml
ADDED
data/Gemfile
CHANGED
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' =>
|
28
|
+
'profile' => "https://venmo.com/#{raw_info['username']}"
|
31
29
|
}
|
32
30
|
})
|
33
31
|
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.
|
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-
|
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
|
-
-
|
121
|
+
- README.md
|
121
122
|
- Rakefile
|
122
123
|
- lib/omniauth-venmo.rb
|
123
124
|
- lib/omniauth/strategies/venmo.rb
|
data/Guardfile
DELETED