omniauth-splitwise 0.1.0 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/Rakefile +3 -2
- data/lib/omniauth/strategies/splitwise.rb +4 -2
- data/lib/omniauth-splitwise.rb +3 -1
- data/lib/omniauth_splitwise/version.rb +3 -1
- data/lib/omniauth_splitwise.rb +2 -0
- metadata +12 -57
- data/spec/omniauth/strategies/splitwise_spec.rb +0 -51
- data/spec/spec_helper.rb +0 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4f57a76324984f753628766a4e182e59b8389ef7316f1c9f7640583cfcb00fd8
|
|
4
|
+
data.tar.gz: d1cb47c381ae86be5a55e74d60a7234c27f71d90490d999705305342b9894f07
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3712ca486ae0d669993d7b14e665551b3044a2e09ac5345c84b570c5c4ace20274d5ee4beecc8aace2e9cee1999a05fc7f871a75508bd9a44df858f70fde06bc
|
|
7
|
+
data.tar.gz: bfba92145ab57edbf8c7012202f3df319fe2139ab6598f2ab83d9cd48952cc6fa3240ee4b00456270b4d48acd41a1191be73eab9d86fb9b84d322de08c514a6f
|
data/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# OmniAuth Splitwise
|
|
1
|
+
# OmniAuth Splitwise [](https://rubygems.org/gems/omniauth-splitwise)
|
|
2
2
|
|
|
3
3
|
An OmniAuth strategy for authenticating to [Splitwise](http://www.splitwise.com).
|
|
4
4
|
To use it, you'll need to [sign up for a Consumer Key and Secret](https://secure.splitwise.com/oauth_clients).
|
|
@@ -59,7 +59,7 @@ auth = request.env['omniauth.auth']
|
|
|
59
59
|
|
|
60
60
|
token = auth['credentials']['token']
|
|
61
61
|
client = OAuth2::Client.new(ENV["SPLITWISE_KEY"], ENV["SPLITWISE_SECRET"])
|
|
62
|
-
access_token = OAuth2::AccessToken.new(client,
|
|
62
|
+
access_token = OAuth2::AccessToken.new(client, token)
|
|
63
63
|
|
|
64
64
|
# Start making API requests:
|
|
65
65
|
access_token.get('/api/v3.0/get_current_user').parsed
|
data/Rakefile
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
require 'bundler/gem_tasks'
|
|
2
4
|
|
|
3
5
|
require 'rubocop/rake_task'
|
|
@@ -7,5 +9,4 @@ require 'rspec/core'
|
|
|
7
9
|
require 'rspec/core/rake_task'
|
|
8
10
|
RSpec::Core::RakeTask.new(:spec)
|
|
9
11
|
|
|
10
|
-
task(:default).clear
|
|
11
|
-
task default: %i(rubocop spec)
|
|
12
|
+
task(:default).clear.enhance(%i(rubocop spec))
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
require 'omniauth-oauth2'
|
|
2
4
|
|
|
3
5
|
module OmniAuth
|
|
4
6
|
module Strategies
|
|
5
7
|
class Splitwise < OmniAuth::Strategies::OAuth2
|
|
6
|
-
BASE_SITE = 'https://secure.splitwise.com/'
|
|
8
|
+
BASE_SITE = 'https://secure.splitwise.com/'
|
|
7
9
|
|
|
8
10
|
option :name, "splitwise"
|
|
9
|
-
option :client_options, site: BASE_SITE
|
|
11
|
+
option :client_options, site: BASE_SITE, auth_scheme: :request_body
|
|
10
12
|
|
|
11
13
|
uid do
|
|
12
14
|
raw_info.fetch('id')
|
data/lib/omniauth-splitwise.rb
CHANGED
data/lib/omniauth_splitwise.rb
CHANGED
metadata
CHANGED
|
@@ -1,72 +1,30 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: omniauth-splitwise
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Nathan Griffith
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 1980-01-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: omniauth-oauth2
|
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
|
16
|
-
requirements:
|
|
17
|
-
- - "~>"
|
|
18
|
-
- !ruby/object:Gem::Version
|
|
19
|
-
version: '1.0'
|
|
20
|
-
type: :runtime
|
|
21
|
-
prerelease: false
|
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
-
requirements:
|
|
24
|
-
- - "~>"
|
|
25
|
-
- !ruby/object:Gem::Version
|
|
26
|
-
version: '1.0'
|
|
27
|
-
- !ruby/object:Gem::Dependency
|
|
28
|
-
name: rake
|
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
|
30
|
-
requirements:
|
|
31
|
-
- - ">="
|
|
32
|
-
- !ruby/object:Gem::Version
|
|
33
|
-
version: '0'
|
|
34
|
-
type: :development
|
|
35
|
-
prerelease: false
|
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
37
16
|
requirements:
|
|
38
17
|
- - ">="
|
|
39
18
|
- !ruby/object:Gem::Version
|
|
40
19
|
version: '0'
|
|
41
|
-
|
|
42
|
-
name: rspec
|
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
|
44
|
-
requirements:
|
|
45
|
-
- - "~>"
|
|
46
|
-
- !ruby/object:Gem::Version
|
|
47
|
-
version: '3.0'
|
|
48
|
-
type: :development
|
|
49
|
-
prerelease: false
|
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
-
requirements:
|
|
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
|
-
- - ">="
|
|
60
|
-
- !ruby/object:Gem::Version
|
|
61
|
-
version: '0'
|
|
62
|
-
type: :development
|
|
20
|
+
type: :runtime
|
|
63
21
|
prerelease: false
|
|
64
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
65
23
|
requirements:
|
|
66
24
|
- - ">="
|
|
67
25
|
- !ruby/object:Gem::Version
|
|
68
26
|
version: '0'
|
|
69
|
-
description:
|
|
27
|
+
description:
|
|
70
28
|
email:
|
|
71
29
|
- nathan@ngriffith.com
|
|
72
30
|
executables: []
|
|
@@ -80,13 +38,12 @@ files:
|
|
|
80
38
|
- lib/omniauth/strategies/splitwise.rb
|
|
81
39
|
- lib/omniauth_splitwise.rb
|
|
82
40
|
- lib/omniauth_splitwise/version.rb
|
|
83
|
-
- spec/omniauth/strategies/splitwise_spec.rb
|
|
84
|
-
- spec/spec_helper.rb
|
|
85
41
|
homepage: https://github.com/smudge/omniauth-splitwise
|
|
86
42
|
licenses:
|
|
87
43
|
- MIT
|
|
88
|
-
metadata:
|
|
89
|
-
|
|
44
|
+
metadata:
|
|
45
|
+
rubygems_mfa_required: 'true'
|
|
46
|
+
post_install_message:
|
|
90
47
|
rdoc_options: []
|
|
91
48
|
require_paths:
|
|
92
49
|
- lib
|
|
@@ -94,17 +51,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
94
51
|
requirements:
|
|
95
52
|
- - ">="
|
|
96
53
|
- !ruby/object:Gem::Version
|
|
97
|
-
version: '
|
|
54
|
+
version: '2.6'
|
|
98
55
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
99
56
|
requirements:
|
|
100
57
|
- - ">="
|
|
101
58
|
- !ruby/object:Gem::Version
|
|
102
59
|
version: '0'
|
|
103
60
|
requirements: []
|
|
104
|
-
rubygems_version: 3.
|
|
105
|
-
signing_key:
|
|
61
|
+
rubygems_version: 3.5.22
|
|
62
|
+
signing_key:
|
|
106
63
|
specification_version: 4
|
|
107
64
|
summary: Splitwise strategy for OmniAuth
|
|
108
|
-
test_files:
|
|
109
|
-
- spec/spec_helper.rb
|
|
110
|
-
- spec/omniauth/strategies/splitwise_spec.rb
|
|
65
|
+
test_files: []
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
require 'spec_helper'
|
|
2
|
-
|
|
3
|
-
describe "OmniAuth::Strategies::Splitwise" do
|
|
4
|
-
subject do
|
|
5
|
-
OmniAuth::Strategies::Splitwise.new(nil)
|
|
6
|
-
end
|
|
7
|
-
|
|
8
|
-
context 'client options' do
|
|
9
|
-
it 'has correct provider name' do
|
|
10
|
-
subject.options.name eq('splitwise')
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
it 'has correct Splitwise site' do
|
|
14
|
-
subject.options.client_options.site.should eq('https://secure.splitwise.com/')
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
it 'has correct callback uri' do
|
|
18
|
-
subject.callback_path.should eq('/auth/splitwise/callback')
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
it 'has correct token path' do
|
|
22
|
-
subject.client.options[:token_url].should eq('/oauth/token')
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
it 'has correct authorize path' do
|
|
26
|
-
subject.client.options[:authorize_url].should eq('/oauth/authorize')
|
|
27
|
-
end
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
context '#uid' do
|
|
31
|
-
before :each do
|
|
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
|
-
)
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
it 'returns the id from user_data' do
|
|
44
|
-
subject.uid.should eq('123')
|
|
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)
|
|
49
|
-
end
|
|
50
|
-
end
|
|
51
|
-
end
|
data/spec/spec_helper.rb
DELETED