wine_bouncer 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +6 -14
- data/CHANGELOG.md +3 -0
- data/Gemfile +2 -1
- data/README.md +5 -4
- data/lib/wine_bouncer/configuration.rb +4 -4
- data/lib/wine_bouncer/oauth2.rb +1 -1
- data/lib/wine_bouncer/version.rb +1 -1
- data/spec/lib/wine_bouncer/auth_strategies/default_spec.rb +2 -2
- data/spec/lib/wine_bouncer/auth_strategies/swagger_spec.rb +6 -6
- data/spec/spec_helper.rb +2 -2
- data/wine_bouncer.gemspec +2 -2
- metadata +9 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0f4668d91c8511bd195dbf27385e218c42799f80
|
4
|
+
data.tar.gz: 8eb68bc10c6c78b5bff560b31f0c182c0f9eac6c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4bf782163f97d90df75e4600eaea58d00f23c1103f93e85f34096597ca26a08fe0402d3931588c7341e6f89ce645b9fe9dc5aa1e5db7bd32a2c86befc5a6f388
|
7
|
+
data.tar.gz: f858a9f25eeafc06e88f8c9acc0c96e2126cb8b823ea264031814f29d790ae819408843c3cd8223118cf686ec39b82b0764f9d1dded5799ff626d65bbfaf1c0a
|
data/.travis.yml
CHANGED
@@ -5,33 +5,25 @@ before_install:
|
|
5
5
|
language: ruby
|
6
6
|
cache: bundler
|
7
7
|
rvm:
|
8
|
-
- 2.1.0
|
9
8
|
- 2.2.2
|
10
9
|
- 2.2.5
|
11
|
-
- 2.3.
|
10
|
+
- 2.3.3
|
12
11
|
env:
|
13
12
|
|
14
13
|
- rails=4.2.6 grape=0.15.0 doorkeeper=3.1.0
|
15
|
-
- rails=4.2.6 grape=0.
|
16
|
-
- rails=4.2.6 grape=0.
|
17
|
-
- rails=4.2.6 grape=0.15.0 doorkeeper=4.2.0
|
18
|
-
- rails=4.2.6 grape=0.16.2 doorkeeper=3.1.0
|
14
|
+
- rails=4.2.6 grape=1.0.0 doorkeeper=3.1.0
|
15
|
+
- rails=4.2.6 grape=0.16.2 doorkeeper=4.2.0
|
19
16
|
- rails=5.0.0 grape=0.16.2 doorkeeper=4.0.0
|
20
17
|
- rails=5.0.0 grape=0.16.2 doorkeeper=4.1.0
|
21
18
|
- rails=5.0.0 grape=0.16.2 doorkeeper=4.2.0
|
19
|
+
- rails=5.0.0 grape=1.0.0 doorkeeper=4.2.0
|
22
20
|
|
23
21
|
addons:
|
24
22
|
code_climate:
|
25
23
|
repo_token: ab1b6ce5f973da033f80ae2e99fadbb32b2f9c37892703956d8ef954c8e8134e
|
24
|
+
after_success:
|
25
|
+
- bundle exec codeclimate-test-reporter
|
26
26
|
notifications:
|
27
27
|
hipchat:
|
28
28
|
rooms:
|
29
29
|
secure: SUWenlDzlDbpryO1QzD+rN4MxIBpAAzwsFqnnkyRQ11thRVdvKuT2TUd+RlYImLXDNkvNjqmpXh7mihtcro9g8unR3nF1UKbuAPIv2kCklsio0jAnjVn7+h1l56hsa90Jy9t/YpKtoLx2QNWLz70n8VrtGJMAt53T6tZdgNUp58=
|
30
|
-
matrix:
|
31
|
-
exclude:
|
32
|
-
- rvm: 2.1.0
|
33
|
-
env: rails=5.0.0 grape=0.16.2 doorkeeper=4.0.0
|
34
|
-
- rvm: 2.1.0
|
35
|
-
env: rails=5.0.0 grape=0.16.2 doorkeeper=4.1.0
|
36
|
-
- rvm: 2.1.0
|
37
|
-
env: rails=5.0.0 grape=0.16.2 doorkeeper=4.2.0
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,9 @@ Changelog
|
|
4
4
|
## Unreleased
|
5
5
|
|
6
6
|
|
7
|
+
## 1.0.2
|
8
|
+
* [#68](https://github.com/antek-drzewiecki/wine_bouncer/pull/68): Update dependency to allow grape v1. Thanks @chandeeland
|
9
|
+
|
7
10
|
## 1.0.1
|
8
11
|
* [#65](https://github.com/antek-drzewiecki/wine_bouncer/pull/65): Support for Doorkeeper 4.1 and 4.2. Thanks @daveallie
|
9
12
|
|
data/Gemfile
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
source 'https://rubygems.org'
|
4
4
|
|
5
|
-
ENV['grape'] ||= '0.
|
5
|
+
ENV['grape'] ||= '1.0.0'
|
6
6
|
ENV['rails'] ||= '5.0.0'
|
7
7
|
ENV['doorkeeper'] ||= '4.0.0'
|
8
8
|
|
@@ -15,6 +15,7 @@ gem 'grape', ENV['grape']
|
|
15
15
|
gem 'doorkeeper', ENV['doorkeeper']
|
16
16
|
|
17
17
|
gem 'codeclimate-test-reporter', group: :test, require: nil
|
18
|
+
gem 'simplecov', :require => false, :group => :test
|
18
19
|
|
19
20
|
# Specify your gem's dependencies in wine_bouncer.gemspec
|
20
21
|
gemspec
|
data/README.md
CHANGED
@@ -28,9 +28,10 @@ Table of Contents
|
|
28
28
|
|
29
29
|
|
30
30
|
## Requirements
|
31
|
-
- Ruby > 2.
|
32
|
-
- Doorkeeper > 1.4.0 and < 4.
|
33
|
-
- Grape > 0.10 and < 1.
|
31
|
+
- Ruby > 2.1
|
32
|
+
- Doorkeeper > 1.4.0 and < 4.3
|
33
|
+
- Grape > 0.10 and < 1.1
|
34
|
+
|
34
35
|
Please submit pull requests and Travis env bumps for newer dependency versions.
|
35
36
|
|
36
37
|
## Installation
|
@@ -38,7 +39,7 @@ Please submit pull requests and Travis env bumps for newer dependency versions.
|
|
38
39
|
Add this line to your application's Gemfile:
|
39
40
|
|
40
41
|
```ruby
|
41
|
-
gem 'wine_bouncer', '~> 1.0.
|
42
|
+
gem 'wine_bouncer', '~> 1.0.2'
|
42
43
|
```
|
43
44
|
|
44
45
|
And then execute:
|
@@ -20,12 +20,12 @@ module WineBouncer
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def define_resource_owner &block
|
23
|
-
|
23
|
+
raise(ArgumentError, 'define_resource_owner expects a block in the configuration') unless block_given?
|
24
24
|
@defined_resource_owner = block
|
25
25
|
end
|
26
26
|
|
27
27
|
def defined_resource_owner
|
28
|
-
|
28
|
+
raise(Errors::UnconfiguredError, 'Please define define_resource_owner to configure the resource owner') unless @defined_resource_owner
|
29
29
|
@defined_resource_owner
|
30
30
|
end
|
31
31
|
|
@@ -41,7 +41,7 @@ module WineBouncer
|
|
41
41
|
end
|
42
42
|
|
43
43
|
def self.configuration
|
44
|
-
@configuration ||
|
44
|
+
@configuration || raise(Errors::UnconfiguredError.new)
|
45
45
|
end
|
46
46
|
|
47
47
|
def self.configuration=(config)
|
@@ -59,7 +59,7 @@ module WineBouncer
|
|
59
59
|
config
|
60
60
|
end
|
61
61
|
|
62
|
-
|
62
|
+
private_class_method
|
63
63
|
|
64
64
|
###
|
65
65
|
# Returns a new configuration or existing one.
|
data/lib/wine_bouncer/oauth2.rb
CHANGED
@@ -100,7 +100,7 @@ module WineBouncer
|
|
100
100
|
private
|
101
101
|
|
102
102
|
def set_auth_strategy(strategy)
|
103
|
-
@auth_strategy = WineBouncer::AuthStrategies.const_get(
|
103
|
+
@auth_strategy = WineBouncer::AuthStrategies.const_get(strategy.to_s.capitalize.to_s).new
|
104
104
|
end
|
105
105
|
end
|
106
106
|
end
|
data/lib/wine_bouncer/version.rb
CHANGED
@@ -15,14 +15,14 @@ describe ::WineBouncer::AuthStrategies::Default do
|
|
15
15
|
context_double = double()
|
16
16
|
allow(context_double).to receive(:options) { auth_context }
|
17
17
|
klass.api_context = context_double
|
18
|
-
expect(klass.send
|
18
|
+
expect(klass.send(:endpoint_authorizations)).to eq(scopes_hash)
|
19
19
|
end
|
20
20
|
|
21
21
|
it 'returns nil when the authentication key has no hash key.' do
|
22
22
|
context_double = double()
|
23
23
|
allow(context_double).to receive(:options) { { route_options: { some: scopes_hash } } }
|
24
24
|
klass.api_context = context_double
|
25
|
-
expect(klass.send
|
25
|
+
expect(klass.send(:endpoint_authorizations)).to eq(nil)
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
@@ -15,14 +15,14 @@ describe ::WineBouncer::AuthStrategies::Swagger do
|
|
15
15
|
context_double = double()
|
16
16
|
allow(context_double).to receive(:options) { auth_context }
|
17
17
|
klass.api_context = context_double
|
18
|
-
expect(klass.send
|
18
|
+
expect(klass.send(:endpoint_authorizations)).to eq(scopes_map)
|
19
19
|
end
|
20
20
|
|
21
21
|
it 'returns nil when the authentication key has no hash key.' do
|
22
22
|
context_double = double()
|
23
23
|
allow(context_double).to receive(:options) { { route_options: { some: scopes_map } } }
|
24
24
|
klass.api_context = context_double
|
25
|
-
expect(klass.send
|
25
|
+
expect(klass.send(:endpoint_authorizations)).to eq(nil)
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
@@ -31,14 +31,14 @@ describe ::WineBouncer::AuthStrategies::Swagger do
|
|
31
31
|
context_double = double()
|
32
32
|
allow(context_double).to receive(:options) { auth_context }
|
33
33
|
klass.api_context = context_double
|
34
|
-
expect(klass.send
|
34
|
+
expect(klass.send(:has_authorizations?)).to eq(true)
|
35
35
|
end
|
36
36
|
|
37
37
|
it 'returns false when there is no authentication key.' do
|
38
38
|
context_double = double()
|
39
39
|
allow(context_double).to receive(:options) { { route_options: { some: scopes_map } } }
|
40
40
|
klass.api_context = context_double
|
41
|
-
expect(klass.send
|
41
|
+
expect(klass.send(:has_authorizations?)).to eq(false)
|
42
42
|
end
|
43
43
|
end
|
44
44
|
|
@@ -47,14 +47,14 @@ describe ::WineBouncer::AuthStrategies::Swagger do
|
|
47
47
|
context_double = double()
|
48
48
|
allow(context_double).to receive(:options) { auth_context }
|
49
49
|
klass.api_context = context_double
|
50
|
-
expect(klass.send
|
50
|
+
expect(klass.send(:authorization_type_oauth2)).to eq(scopes)
|
51
51
|
end
|
52
52
|
|
53
53
|
it 'returns nil when there is no oauth2 key.' do
|
54
54
|
context_double = double()
|
55
55
|
allow(context_double).to receive(:options) { { route_options: { authorizations: { no_oauth: scopes } } } }
|
56
56
|
klass.api_context = context_double
|
57
|
-
expect(klass.send
|
57
|
+
expect(klass.send(:authorization_type_oauth2)).to eq(nil)
|
58
58
|
end
|
59
59
|
end
|
60
60
|
|
data/spec/spec_helper.rb
CHANGED
@@ -16,8 +16,8 @@
|
|
16
16
|
# users commonly want.
|
17
17
|
#
|
18
18
|
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
19
|
-
require '
|
20
|
-
|
19
|
+
require 'simplecov'
|
20
|
+
SimpleCov.start
|
21
21
|
|
22
22
|
RSpec.configure do |config|
|
23
23
|
# rspec-expectations config goes here. You can use an alternate
|
data/wine_bouncer.gemspec
CHANGED
@@ -7,7 +7,7 @@ Gem::Specification.new do |spec|
|
|
7
7
|
spec.name = 'wine_bouncer'
|
8
8
|
spec.version = WineBouncer::VERSION
|
9
9
|
spec.authors = ['Antek Drzewiecki']
|
10
|
-
spec.email = ['
|
10
|
+
spec.email = ['a.drzewiecki@devsquare.nl']
|
11
11
|
spec.summary = %q{A Ruby gem that allows Oauth2 protection with Doorkeeper for Grape Api's}
|
12
12
|
spec.homepage = ''
|
13
13
|
spec.license = 'MIT'
|
@@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
18
18
|
spec.require_paths = ['lib']
|
19
19
|
|
20
|
-
spec.add_runtime_dependency 'grape', '
|
20
|
+
spec.add_runtime_dependency 'grape', '>= 0.10', '< 1.1'
|
21
21
|
spec.add_runtime_dependency 'doorkeeper', '>= 1.4', '< 4.3'
|
22
22
|
|
23
23
|
spec.add_development_dependency 'railties'
|
metadata
CHANGED
@@ -1,35 +1,35 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wine_bouncer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Antek Drzewiecki
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-09-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: grape
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0.10'
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: '1.
|
22
|
+
version: '1.1'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
|
-
- - "
|
27
|
+
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
29
|
version: '0.10'
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '1.
|
32
|
+
version: '1.1'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: doorkeeper
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -192,7 +192,7 @@ dependencies:
|
|
192
192
|
version: 0.8.7
|
193
193
|
description:
|
194
194
|
email:
|
195
|
-
-
|
195
|
+
- a.drzewiecki@devsquare.nl
|
196
196
|
executables: []
|
197
197
|
extensions: []
|
198
198
|
extra_rdoc_files: []
|
@@ -306,7 +306,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
306
306
|
version: '0'
|
307
307
|
requirements: []
|
308
308
|
rubyforge_project:
|
309
|
-
rubygems_version: 2.
|
309
|
+
rubygems_version: 2.4.6
|
310
310
|
signing_key:
|
311
311
|
specification_version: 4
|
312
312
|
summary: A Ruby gem that allows Oauth2 protection with Doorkeeper for Grape Api's
|
@@ -374,3 +374,4 @@ test_files:
|
|
374
374
|
- spec/rails_helper.rb
|
375
375
|
- spec/shared/orm/active_record.rb
|
376
376
|
- spec/spec_helper.rb
|
377
|
+
has_rdoc:
|