omniauth-splitwise 0.0.1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/LICENSE +21 -0
- data/README.md +29 -20
- data/Rakefile +11 -1
- data/lib/omniauth-splitwise.rb +1 -2
- data/lib/omniauth/strategies/splitwise.rb +22 -19
- data/lib/omniauth_splitwise.rb +2 -0
- data/lib/omniauth_splitwise/version.rb +3 -0
- data/spec/omniauth/strategies/splitwise_spec.rb +24 -10
- metadata +39 -31
- data/.gitignore +0 -16
- data/.rspec +0 -1
- data/Gemfile +0 -4
- data/Gemfile.lock +0 -36
- data/example/Gemfile +0 -6
- data/example/Gemfile.lock +0 -35
- data/example/config.ru +0 -27
- data/lib/omniauth/splitwise/version.rb +0 -5
- data/omniauth-splitwise.gemspec +0 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 9bc6c1857d364dc5239bab481eef88c31912a70057e7840825bafdced35dba18
|
4
|
+
data.tar.gz: cc0416a613b44a05c5dc000b7eaec93c04013ad531d01a3ecb941b973ec16d4a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e175f3194e9ed25d411feebaab9d377cc08ba32df794b1d3ee5e4e6b32d4feca04fcebd205608e635b5b2807bcfd81b8751a0501f8ff22772352b1fc63826ec8
|
7
|
+
data.tar.gz: 88ce09fe1d5c9a6854c4f03069c93da33a426b2087455a542490f09c58ad2344e630101926a87f63968b85c42449df6df88a14dc63aa146deb2d98a68a333f29
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2014 Nathan Griffith
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
# OmniAuth Splitwise
|
2
2
|
|
3
|
-
An OmniAuth strategy for authenticating to [Splitwise](http://www.splitwise.com).
|
3
|
+
An OmniAuth strategy for authenticating to [Splitwise](http://www.splitwise.com).
|
4
|
+
To use it, you'll need to [sign up for a Consumer Key and Secret](https://secure.splitwise.com/oauth_clients).
|
5
|
+
|
6
|
+
As of 2020, this gem uses OAuth 2.0 to interface with Splitwise.
|
4
7
|
|
5
8
|
## Installation
|
6
9
|
|
@@ -16,13 +19,13 @@ Or install it yourself:
|
|
16
19
|
|
17
20
|
$ gem install omniauth-splitwise
|
18
21
|
|
19
|
-
##
|
22
|
+
## App Setup
|
20
23
|
|
21
24
|
For Rack apps, in your config.ru:
|
22
25
|
|
23
26
|
```ruby
|
24
27
|
use OmniAuth::Builder do
|
25
|
-
provider :splitwise, ENV
|
28
|
+
provider :splitwise, ENV.fetch('SPLITWISE_KEY'), ENV.fetch('SPLITWISE_SECRET')
|
26
29
|
end
|
27
30
|
```
|
28
31
|
|
@@ -30,21 +33,37 @@ For Rails apps, in config/initializers/omniauth.rb:
|
|
30
33
|
|
31
34
|
```ruby
|
32
35
|
Rails.application.config.middleware.use OmniAuth::Builder do
|
33
|
-
provider :splitwise, ENV
|
36
|
+
provider :splitwise, ENV.fetch('SPLITWISE_KEY'), ENV.fetch('SPLITWISE_SECRET')
|
34
37
|
end
|
35
38
|
```
|
36
39
|
|
37
40
|
See also: [Integrating OmniAuth Into Your Application](https://github.com/intridea/omniauth#integrating-omniauth-into-your-application).
|
38
41
|
|
39
|
-
|
42
|
+
### Usage
|
40
43
|
|
41
|
-
|
44
|
+
Once a successful OAuth2 request has been made, several fields are available immediately:
|
42
45
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
+
```ruby
|
47
|
+
auth = request.env['omniauth.auth']
|
48
|
+
|
49
|
+
auth['provider'] # => 'splitwise'
|
50
|
+
auth['uid'] # => Splitwise User ID
|
51
|
+
auth['info'] # => A hash containing 'first_name', 'last_name', and 'email'
|
52
|
+
auth['extra'] # => The full user hash from /api/v3.0/get_current_user
|
53
|
+
```
|
54
|
+
|
55
|
+
Additionally, the bearer token may be extracted and reused:
|
56
|
+
|
57
|
+
```ruby
|
58
|
+
auth = request.env['omniauth.auth']
|
46
59
|
|
47
|
-
|
60
|
+
token = auth['credentials']['token']
|
61
|
+
client = OAuth2::Client.new(ENV["SPLITWISE_KEY"], ENV["SPLITWISE_SECRET"])
|
62
|
+
access_token = OAuth2::AccessToken.new(client, splitwise_token)
|
63
|
+
|
64
|
+
# Start making API requests:
|
65
|
+
access_token.get('/api/v3.0/get_current_user').parsed
|
66
|
+
```
|
48
67
|
|
49
68
|
## Contributing
|
50
69
|
|
@@ -53,13 +72,3 @@ Then visit [localhost:9292](http://localhost:9292) to try it out.
|
|
53
72
|
3. Commit your changes (`git commit -am 'Added some feature'`)
|
54
73
|
4. Push to the branch (`git push origin my-new-feature`)
|
55
74
|
5. Create new Pull Request
|
56
|
-
|
57
|
-
# License
|
58
|
-
|
59
|
-
Copyright (C) 2014 by Nathan Griffith
|
60
|
-
|
61
|
-
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:
|
62
|
-
|
63
|
-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
64
|
-
|
65
|
-
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.
|
data/Rakefile
CHANGED
@@ -1 +1,11 @@
|
|
1
|
-
require
|
1
|
+
require 'bundler/gem_tasks'
|
2
|
+
|
3
|
+
require 'rubocop/rake_task'
|
4
|
+
RuboCop::RakeTask.new
|
5
|
+
|
6
|
+
require 'rspec/core'
|
7
|
+
require 'rspec/core/rake_task'
|
8
|
+
RSpec::Core::RakeTask.new(:spec)
|
9
|
+
|
10
|
+
task(:default).clear
|
11
|
+
task default: %i(rubocop spec)
|
data/lib/omniauth-splitwise.rb
CHANGED
@@ -1,2 +1 @@
|
|
1
|
-
require
|
2
|
-
require 'omniauth/strategies/splitwise'
|
1
|
+
require 'omniauth_splitwise' # rubocop:disable Naming/FileName
|
@@ -1,36 +1,39 @@
|
|
1
|
-
require 'omniauth
|
1
|
+
require 'omniauth-oauth2'
|
2
2
|
|
3
3
|
module OmniAuth
|
4
4
|
module Strategies
|
5
|
-
class Splitwise < OmniAuth::Strategies::
|
6
|
-
|
5
|
+
class Splitwise < OmniAuth::Strategies::OAuth2
|
6
|
+
BASE_SITE = 'https://secure.splitwise.com/'.freeze
|
7
7
|
|
8
|
-
option :
|
9
|
-
|
10
|
-
:request_token_path => '/api/v3.0/get_request_token',
|
11
|
-
:access_token_path => '/api/v3.0/get_access_token',
|
12
|
-
:authorize_path => '/authorize',
|
13
|
-
:http_method => :post,
|
14
|
-
:scheme => :header
|
15
|
-
}
|
8
|
+
option :name, "splitwise"
|
9
|
+
option :client_options, site: BASE_SITE
|
16
10
|
|
17
11
|
uid do
|
18
|
-
|
12
|
+
raw_info.fetch('id')
|
19
13
|
end
|
20
14
|
|
21
15
|
info do
|
22
|
-
|
16
|
+
{
|
17
|
+
'first_name' => raw_info['first_name'],
|
18
|
+
'last_name' => raw_info['last_name'],
|
19
|
+
'email' => raw_info['email'],
|
20
|
+
}
|
21
|
+
end
|
22
|
+
|
23
|
+
extra do
|
24
|
+
raw_info
|
23
25
|
end
|
24
26
|
|
25
|
-
private
|
27
|
+
private
|
26
28
|
|
27
|
-
def
|
28
|
-
@
|
29
|
+
def raw_info
|
30
|
+
@raw_info ||= access_token.get('/api/v3.0/get_current_user').parsed['user']
|
29
31
|
end
|
30
32
|
|
31
|
-
|
32
|
-
|
33
|
-
|
33
|
+
# We must override callback_url due to this issue:
|
34
|
+
# https://github.com/omniauth/omniauth-oauth2/issues/93
|
35
|
+
def callback_url
|
36
|
+
full_host + script_name + callback_path
|
34
37
|
end
|
35
38
|
end
|
36
39
|
end
|
@@ -2,36 +2,50 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe "OmniAuth::Strategies::Splitwise" do
|
4
4
|
subject do
|
5
|
-
OmniAuth::Strategies::Splitwise.new(nil
|
5
|
+
OmniAuth::Strategies::Splitwise.new(nil)
|
6
6
|
end
|
7
7
|
|
8
8
|
context 'client options' do
|
9
|
+
it 'has correct provider name' do
|
10
|
+
subject.options.name eq('splitwise')
|
11
|
+
end
|
12
|
+
|
9
13
|
it 'has correct Splitwise site' do
|
10
|
-
subject.options.client_options.site.should eq('https://secure.splitwise.com')
|
14
|
+
subject.options.client_options.site.should eq('https://secure.splitwise.com/')
|
11
15
|
end
|
12
16
|
|
13
|
-
it 'has correct
|
14
|
-
subject.
|
17
|
+
it 'has correct callback uri' do
|
18
|
+
subject.callback_path.should eq('/auth/splitwise/callback')
|
15
19
|
end
|
16
20
|
|
17
|
-
it 'has correct
|
18
|
-
subject.options.
|
21
|
+
it 'has correct token path' do
|
22
|
+
subject.client.options[:token_url].should eq('/oauth/token')
|
19
23
|
end
|
20
24
|
|
21
25
|
it 'has correct authorize path' do
|
22
|
-
subject.options.
|
26
|
+
subject.client.options[:authorize_url].should eq('/oauth/authorize')
|
23
27
|
end
|
24
28
|
end
|
25
29
|
|
26
30
|
context '#uid' do
|
27
31
|
before :each do
|
28
|
-
subject.stub(
|
32
|
+
subject.stub(
|
33
|
+
raw_info: {
|
34
|
+
'id' => '123',
|
35
|
+
'first_name' => 'Marie',
|
36
|
+
'last_name' => 'Curie',
|
37
|
+
'email' => 'mc@example.org',
|
38
|
+
'other_data' => 0o12345,
|
39
|
+
},
|
40
|
+
)
|
29
41
|
end
|
30
42
|
|
31
43
|
it 'returns the id from user_data' do
|
32
44
|
subject.uid.should eq('123')
|
33
|
-
subject.info[
|
34
|
-
subject.info[
|
45
|
+
subject.info['first_name'].should eq('Marie')
|
46
|
+
subject.info['last_name'].should eq('Curie')
|
47
|
+
subject.info['email'].should eq('mc@example.org')
|
48
|
+
subject.extra['other_data'].should eq(0o12345)
|
35
49
|
end
|
36
50
|
end
|
37
51
|
end
|
metadata
CHANGED
@@ -1,57 +1,71 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-splitwise
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Griffith
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-09-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name: omniauth-
|
14
|
+
name: omniauth-oauth2
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.0
|
19
|
+
version: '1.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.0
|
26
|
+
version: '1.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
|
-
type: :
|
34
|
+
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - ~>
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: '3.0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - ~>
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rubocop-betterment
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
53
60
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
55
69
|
description:
|
56
70
|
email:
|
57
71
|
- nathan@ngriffith.com
|
@@ -59,23 +73,18 @@ executables: []
|
|
59
73
|
extensions: []
|
60
74
|
extra_rdoc_files: []
|
61
75
|
files:
|
62
|
-
-
|
63
|
-
- .rspec
|
64
|
-
- Gemfile
|
65
|
-
- Gemfile.lock
|
76
|
+
- LICENSE
|
66
77
|
- README.md
|
67
78
|
- Rakefile
|
68
|
-
- example/Gemfile
|
69
|
-
- example/Gemfile.lock
|
70
|
-
- example/config.ru
|
71
79
|
- lib/omniauth-splitwise.rb
|
72
|
-
- lib/omniauth/splitwise/version.rb
|
73
80
|
- lib/omniauth/strategies/splitwise.rb
|
74
|
-
-
|
81
|
+
- lib/omniauth_splitwise.rb
|
82
|
+
- lib/omniauth_splitwise/version.rb
|
75
83
|
- spec/omniauth/strategies/splitwise_spec.rb
|
76
84
|
- spec/spec_helper.rb
|
77
|
-
homepage: https://github.com/
|
78
|
-
licenses:
|
85
|
+
homepage: https://github.com/smudge/omniauth-splitwise
|
86
|
+
licenses:
|
87
|
+
- MIT
|
79
88
|
metadata: {}
|
80
89
|
post_install_message:
|
81
90
|
rdoc_options: []
|
@@ -83,20 +92,19 @@ require_paths:
|
|
83
92
|
- lib
|
84
93
|
required_ruby_version: !ruby/object:Gem::Requirement
|
85
94
|
requirements:
|
86
|
-
- -
|
95
|
+
- - ">="
|
87
96
|
- !ruby/object:Gem::Version
|
88
97
|
version: '0'
|
89
98
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
90
99
|
requirements:
|
91
|
-
- -
|
100
|
+
- - ">="
|
92
101
|
- !ruby/object:Gem::Version
|
93
102
|
version: '0'
|
94
103
|
requirements: []
|
95
|
-
|
96
|
-
rubygems_version: 2.0.14
|
104
|
+
rubygems_version: 3.0.3
|
97
105
|
signing_key:
|
98
106
|
specification_version: 4
|
99
107
|
summary: Splitwise strategy for OmniAuth
|
100
108
|
test_files:
|
101
|
-
- spec/omniauth/strategies/splitwise_spec.rb
|
102
109
|
- spec/spec_helper.rb
|
110
|
+
- spec/omniauth/strategies/splitwise_spec.rb
|
data/.gitignore
DELETED
data/.rspec
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
--color
|
data/Gemfile
DELETED
data/Gemfile.lock
DELETED
@@ -1,36 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
omniauth-splitwise (0.0.1)
|
5
|
-
multi_json
|
6
|
-
omniauth-oauth (~> 1.0.0)
|
7
|
-
|
8
|
-
GEM
|
9
|
-
remote: http://rubygems.org/
|
10
|
-
specs:
|
11
|
-
diff-lcs (1.1.3)
|
12
|
-
hashie (2.0.5)
|
13
|
-
multi_json (1.8.2)
|
14
|
-
oauth (0.4.7)
|
15
|
-
omniauth (1.1.4)
|
16
|
-
hashie (>= 1.2, < 3)
|
17
|
-
rack
|
18
|
-
omniauth-oauth (1.0.1)
|
19
|
-
oauth
|
20
|
-
omniauth (~> 1.0)
|
21
|
-
rack (1.5.2)
|
22
|
-
rspec (2.7.0)
|
23
|
-
rspec-core (~> 2.7.0)
|
24
|
-
rspec-expectations (~> 2.7.0)
|
25
|
-
rspec-mocks (~> 2.7.0)
|
26
|
-
rspec-core (2.7.1)
|
27
|
-
rspec-expectations (2.7.0)
|
28
|
-
diff-lcs (~> 1.1.2)
|
29
|
-
rspec-mocks (2.7.0)
|
30
|
-
|
31
|
-
PLATFORMS
|
32
|
-
ruby
|
33
|
-
|
34
|
-
DEPENDENCIES
|
35
|
-
omniauth-splitwise!
|
36
|
-
rspec (~> 2.7.0)
|
data/example/Gemfile
DELETED
data/example/Gemfile.lock
DELETED
@@ -1,35 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: ../
|
3
|
-
specs:
|
4
|
-
omniauth-splitwise (0.0.1)
|
5
|
-
multi_json
|
6
|
-
omniauth-oauth (~> 1.0.0)
|
7
|
-
|
8
|
-
GEM
|
9
|
-
remote: http://rubygems.org/
|
10
|
-
specs:
|
11
|
-
hashie (2.0.5)
|
12
|
-
multi_json (1.8.2)
|
13
|
-
oauth (0.4.7)
|
14
|
-
omniauth (1.1.4)
|
15
|
-
hashie (>= 1.2, < 3)
|
16
|
-
rack
|
17
|
-
omniauth-oauth (1.0.1)
|
18
|
-
oauth
|
19
|
-
omniauth (~> 1.0)
|
20
|
-
rack (1.5.2)
|
21
|
-
rack-protection (1.5.0)
|
22
|
-
rack
|
23
|
-
sinatra (1.4.3)
|
24
|
-
rack (~> 1.4)
|
25
|
-
rack-protection (~> 1.4)
|
26
|
-
tilt (~> 1.3, >= 1.3.4)
|
27
|
-
tilt (1.4.1)
|
28
|
-
|
29
|
-
PLATFORMS
|
30
|
-
ruby
|
31
|
-
|
32
|
-
DEPENDENCIES
|
33
|
-
multi_json
|
34
|
-
omniauth-splitwise!
|
35
|
-
sinatra
|
data/example/config.ru
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
require 'bundler/setup'
|
2
|
-
require 'sinatra/base'
|
3
|
-
require 'omniauth-splitwise'
|
4
|
-
|
5
|
-
class App < Sinatra::Base
|
6
|
-
get '/' do
|
7
|
-
redirect '/auth/splitwise'
|
8
|
-
end
|
9
|
-
|
10
|
-
get '/auth/:provider/callback' do
|
11
|
-
content_type 'application/json'
|
12
|
-
MultiJson.encode(request.env)
|
13
|
-
end
|
14
|
-
|
15
|
-
get '/auth/failure' do
|
16
|
-
content_type 'application/json'
|
17
|
-
MultiJson.encode(request.env)
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
use Rack::Session::Cookie
|
22
|
-
|
23
|
-
use OmniAuth::Builder do
|
24
|
-
provider :splitwise, ENV['SPLITWISE_KEY'], ENV['SPLITWISE_SECRET']
|
25
|
-
end
|
26
|
-
|
27
|
-
run App.new
|
data/omniauth-splitwise.gemspec
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
$:.push File.expand_path('../lib', __FILE__)
|
3
|
-
require 'omniauth/splitwise/version'
|
4
|
-
|
5
|
-
Gem::Specification.new do |s|
|
6
|
-
s.name = 'omniauth-splitwise'
|
7
|
-
s.version = OmniAuth::Splitwise::VERSION
|
8
|
-
s.authors = ['Nathan Griffith']
|
9
|
-
s.email = ['nathan@ngriffith.com']
|
10
|
-
s.summary = 'Splitwise strategy for OmniAuth'
|
11
|
-
s.homepage = 'https://github.com/Smudge/omniauth-splitwise'
|
12
|
-
|
13
|
-
s.files = `git ls-files`.split("\n")
|
14
|
-
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
15
|
-
s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
|
16
|
-
s.require_paths = ['lib']
|
17
|
-
|
18
|
-
s.add_runtime_dependency 'omniauth-oauth', '~> 1.0.0'
|
19
|
-
s.add_runtime_dependency 'multi_json'
|
20
|
-
|
21
|
-
s.add_development_dependency 'rspec', '~> 2.7.0'
|
22
|
-
end
|