omniauth-thebase 0.0.1 → 0.1.0
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/.travis.yml +9 -0
- data/Gemfile +7 -1
- data/README.md +5 -0
- data/lib/omniauth-thebase/version.rb +1 -1
- data/lib/omniauth/strategies/thebase.rb +4 -0
- data/omniauth-thebase.gemspec +4 -5
- data/spec/omniauth/strategies/thebase_spec.rb +60 -1
- data/spec/spec_helper.rb +11 -12
- metadata +18 -30
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e749aeabfc6a113ff677b6a7c156fe84a345f038
|
4
|
+
data.tar.gz: b191e7583944eb3f9f188f25cc76aaff5740fcee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10d593442837a351b1a613429b05c36ebece737874607b23b06b6b610314cb2bfe628b671efe68e98e27177acbbd4d6b4d1c93e16eda9a6ff0f369f8225d1c60
|
7
|
+
data.tar.gz: 16f042f21e666df78a30daf1d85038c4b3dfc69f72fb3cb5b1f6cb74c7b4298923960fead2ad4531178b73d7364ea1b3d18236a6acbdb6747fb3e89bcc034d89
|
data/.travis.yml
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
language: ruby
|
2
|
+
rvm:
|
3
|
+
- 2.1.8
|
4
|
+
- 2.2.4
|
5
|
+
- 2.3.0
|
6
|
+
script: bundle exec rspec
|
7
|
+
env:
|
8
|
+
global:
|
9
|
+
- secure: gEyc0B9sVLbXuzb0hPppvn4bQgYLvLNw7s1nW3dB7qDr+vinsuGfpAC1twF0IyKYMXN1ocQaWfN8EOUeTlKarWM7z/8B/klVFW6bXZlvyMrgVWqqTErUjnoBWQsMwee2mKikK4VT0G54vOoLFNwXZaCztlCmB0dRjmNLSMG5c2EypTZyc9NWRSD2JcV0WYcwznTE7dwhZRjuJ5OuS6Z4v1PL4zFg0h1jBmFVC5DyL6Q+fwYVtGgtbAcT410USSdLMF6+oW0k1VBjACcAtjkcryhYggH2uzH2IWso9xcP+QZFwQyTqzcduQ83ztkMeXsHOZDLLXqbv21ZIKCd1bFlAk7VsbtXtLD/LIslUyEn9gE+1wEuaZCRQzNs7UOOEc72zxyBjL6cC3jdHfHpblJq5kpoH2SvTdB2F/620tau5MIt49rGsHklb4Y/NiA/7eJSinBASDu56pqxGFPR7sTD2r0IcnG98MvrUoHPvsyI5ZasJcjrdx+F4wzd7dO6Zp+txmX7SBUCVRlP6JYIaisETzf0NsvHaBOVh3rJe75WQom61zfdeGaReMmoPM+rJSxLSClA+wrpiRZXECC8WyyVsDNqbOvm6hQPW/EJ84VdedikGU2BtKiPvzrfJTRda6+frmWdNjGXEoTmHbEc4TrcsYldAaGRKxO9qxj6LpHq+xM=
|
data/Gemfile
CHANGED
@@ -1,7 +1,13 @@
|
|
1
|
-
source '
|
1
|
+
source 'https://rubygems.org'
|
2
2
|
|
3
3
|
gemspec
|
4
4
|
|
5
5
|
group :development, :test do
|
6
6
|
gem 'pry'
|
7
7
|
end
|
8
|
+
|
9
|
+
group :test do
|
10
|
+
gem 'rspec', '~> 3.0'
|
11
|
+
gem 'simplecov', require: false
|
12
|
+
gem "codeclimate-test-reporter", require: false
|
13
|
+
end
|
data/README.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# OmniAuth Thebase
|
2
2
|
|
3
|
+
[](https://travis-ci.org/zaikoflow/omniauth-thebase)
|
4
|
+
[](https://codeclimate.com/github/zaikoflow/omniauth-thebase)
|
5
|
+
[](https://codeclimate.com/github/zaikoflow/omniauth-thebase)
|
6
|
+
[](https://gemnasium.com/zaikoflow/omniauth-thebase)
|
7
|
+
|
3
8
|
Omniauth for [Thebase](https://thebase.com/)
|
4
9
|
|
5
10
|
Instration
|
data/omniauth-thebase.gemspec
CHANGED
@@ -3,7 +3,7 @@ require File.expand_path('../lib/omniauth-thebase/version', __FILE__)
|
|
3
3
|
Gem::Specification.new do |gem|
|
4
4
|
gem.authors = ["Masahiro Saito"]
|
5
5
|
gem.email = ["camelmasa@gmail.com"]
|
6
|
-
gem.description = %q{OmniAuth strategy for Thebase
|
6
|
+
gem.description = %q{OmniAuth strategy for Thebase}
|
7
7
|
gem.summary = %q{OmniAuth strategy for Thebase.}
|
8
8
|
gem.homepage = "https://github.com/stockflow/omniauth-thebase"
|
9
9
|
gem.license = "MIT"
|
@@ -18,8 +18,7 @@ Gem::Specification.new do |gem|
|
|
18
18
|
# Nothing lower than omniauth-oauth2 1.1.1
|
19
19
|
# http://www.rubysec.com/advisories/CVE-2012-6134/
|
20
20
|
gem.add_dependency 'omniauth-oauth2', '>= 1.1.1'
|
21
|
-
gem.add_development_dependency
|
22
|
-
gem.add_development_dependency 'rack-test'
|
23
|
-
gem.add_development_dependency
|
24
|
-
gem.add_development_dependency 'webmock'
|
21
|
+
gem.add_development_dependency "rspec", "~> 3.0"
|
22
|
+
gem.add_development_dependency 'rack-test', "~> 0.6"
|
23
|
+
gem.add_development_dependency "webmock", "~> 1.22"
|
25
24
|
end
|
@@ -1,5 +1,64 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe OmniAuth::Strategies::Thebase do
|
4
|
-
|
4
|
+
subject do
|
5
|
+
described_class.new({})
|
6
|
+
end
|
7
|
+
|
8
|
+
context "client options" do
|
9
|
+
it 'returns correct site' do
|
10
|
+
expect(subject.options.client_options.site).to eq("https://api.thebase.in")
|
11
|
+
end
|
12
|
+
|
13
|
+
it 'returns correct authorize_url' do
|
14
|
+
expect(subject.options.client_options.authorize_url).to eq("/1/oauth/authorize")
|
15
|
+
end
|
16
|
+
|
17
|
+
it 'returns correct token_url' do
|
18
|
+
expect(subject.options.client_options.token_url).to eq("/1/oauth/token")
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
context "uid" do
|
23
|
+
before do
|
24
|
+
allow(subject).to receive(:raw_info) { {"shop_id" => "base" } }
|
25
|
+
end
|
26
|
+
|
27
|
+
it 'returns correct uid' do
|
28
|
+
expect(subject.uid).to eq("base")
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
context "extra" do
|
33
|
+
before do
|
34
|
+
allow(subject).to receive(:raw_info) { { "shop_id" => "base" } }
|
35
|
+
end
|
36
|
+
|
37
|
+
it 'returns correct extra block' do
|
38
|
+
expect(subject.extra).to eq( { raw_info: {"shop_id" => "base" } })
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
describe "#raw_info" do
|
43
|
+
let(:access_token) { double('AccessToken', options: {}) }
|
44
|
+
let(:response) { double('Response', parsed: { "user" => { "shop_id" => "base" } } ) }
|
45
|
+
|
46
|
+
before do
|
47
|
+
allow(subject).to receive(:access_token) { access_token }
|
48
|
+
end
|
49
|
+
|
50
|
+
it "returns raw_info" do
|
51
|
+
allow(access_token).to receive(:get).with('/1/users/me') { response }
|
52
|
+
expect(subject.raw_info).to eq({ "shop_id" => "base" })
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
describe "#callback_url" do
|
57
|
+
it "returns callback url" do
|
58
|
+
allow(subject).to receive(:full_host) { "http://localhost" }
|
59
|
+
allow(subject).to receive(:script_name) { "/1" }
|
60
|
+
|
61
|
+
expect(subject.callback_url).to eq "http://localhost/1/auth/thebase/callback"
|
62
|
+
end
|
63
|
+
end
|
5
64
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,16 +1,15 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
|
2
|
+
|
3
|
+
require "codeclimate-test-reporter"
|
3
4
|
require 'simplecov'
|
4
|
-
SimpleCov.start
|
5
|
-
require 'rspec'
|
6
|
-
require 'rack/test'
|
7
|
-
require 'webmock/rspec'
|
8
|
-
require 'omniauth'
|
9
|
-
require 'omniauth-thebase'
|
10
5
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
6
|
+
SimpleCov.start do
|
7
|
+
formatter SimpleCov::Formatter::MultiFormatter.new(
|
8
|
+
[
|
9
|
+
SimpleCov::Formatter::HTMLFormatter,
|
10
|
+
CodeClimate::TestReporter::Formatter
|
11
|
+
]
|
12
|
+
)
|
15
13
|
end
|
16
14
|
|
15
|
+
require 'omniauth-thebase'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-thebase
|
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
|
- Masahiro Saito
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-04-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: omniauth
|
@@ -42,59 +42,45 @@ dependencies:
|
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
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
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
54
|
+
version: '3.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rack-test
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
61
|
+
version: '0.6'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: simplecov
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - ">="
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '0'
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - ">="
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '0'
|
68
|
+
version: '0.6'
|
83
69
|
- !ruby/object:Gem::Dependency
|
84
70
|
name: webmock
|
85
71
|
requirement: !ruby/object:Gem::Requirement
|
86
72
|
requirements:
|
87
|
-
- - "
|
73
|
+
- - "~>"
|
88
74
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
75
|
+
version: '1.22'
|
90
76
|
type: :development
|
91
77
|
prerelease: false
|
92
78
|
version_requirements: !ruby/object:Gem::Requirement
|
93
79
|
requirements:
|
94
|
-
- - "
|
80
|
+
- - "~>"
|
95
81
|
- !ruby/object:Gem::Version
|
96
|
-
version: '
|
97
|
-
description: OmniAuth strategy for Thebase
|
82
|
+
version: '1.22'
|
83
|
+
description: OmniAuth strategy for Thebase
|
98
84
|
email:
|
99
85
|
- camelmasa@gmail.com
|
100
86
|
executables: []
|
@@ -103,6 +89,7 @@ extra_rdoc_files: []
|
|
103
89
|
files:
|
104
90
|
- ".gitignore"
|
105
91
|
- ".rspec"
|
92
|
+
- ".travis.yml"
|
106
93
|
- Gemfile
|
107
94
|
- LICENSE.txt
|
108
95
|
- README.md
|
@@ -133,10 +120,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
133
120
|
version: '0'
|
134
121
|
requirements: []
|
135
122
|
rubyforge_project:
|
136
|
-
rubygems_version: 2.
|
123
|
+
rubygems_version: 2.5.1
|
137
124
|
signing_key:
|
138
125
|
specification_version: 4
|
139
126
|
summary: OmniAuth strategy for Thebase.
|
140
127
|
test_files:
|
141
128
|
- spec/omniauth/strategies/thebase_spec.rb
|
142
129
|
- spec/spec_helper.rb
|
130
|
+
has_rdoc:
|