wine_bouncer 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +9 -0
- data/.rubocop_todo.yml +182 -0
- data/.travis.yml +8 -7
- data/CHANGELOG.md +4 -1
- data/Gemfile +2 -2
- data/README.md +8 -7
- data/Rakefile +4 -5
- data/lib/wine_bouncer/auth_methods/auth_methods.rb +2 -2
- data/lib/wine_bouncer/auth_strategies/default.rb +1 -2
- data/lib/wine_bouncer/auth_strategies/protected.rb +1 -3
- data/lib/wine_bouncer/auth_strategies/swagger.rb +0 -1
- data/lib/wine_bouncer/configuration.rb +3 -7
- data/lib/wine_bouncer/extension.rb +5 -5
- data/lib/wine_bouncer/oauth2.rb +3 -7
- data/lib/wine_bouncer/version.rb +1 -1
- data/spec/dummy/app/api/default_api.rb +0 -2
- data/spec/dummy/app/api/swagger_api.rb +0 -2
- data/spec/dummy/config/application.rb +6 -8
- data/spec/dummy/config/initializers/cookies_serializer.rb +1 -1
- data/spec/dummy/config/initializers/doorkeeper.rb +1 -1
- data/spec/dummy/config/initializers/secret_token.rb +1 -1
- data/spec/dummy/db/migrate/20140915160601_create_doorkeeper_tables.rb +16 -16
- data/spec/dummy/db/schema.rb +36 -38
- data/spec/factories/access_token.rb +1 -1
- data/spec/factories/application.rb +1 -1
- data/spec/factories/user.rb +1 -1
- data/spec/intergration/oauth2_default_strategy_spec.rb +1 -5
- data/spec/intergration/oauth2_protected_strategy_spec.rb +1 -2
- data/spec/intergration/oauth2_swagger_strategy_spec.rb +1 -6
- data/spec/lib/generators/wine_bouncer/initializer_generator_spec.rb +0 -1
- data/spec/lib/wine_bouncer/auth_methods/auth_methods_spec.rb +6 -9
- data/spec/lib/wine_bouncer/auth_strategies/default_spec.rb +0 -2
- data/spec/lib/wine_bouncer/auth_strategies/swagger_spec.rb +0 -1
- data/spec/rails_helper.rb +1 -4
- data/spec/shared/orm/active_record.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- data/wine_bouncer.gemspec +17 -15
- metadata +67 -36
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e6961476143d7f8be5bc53b9268c7950a374d31f
|
4
|
+
data.tar.gz: 0d507a032e778c40bc314fbd77e92b20e654004f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: edce51422f46f91269b531449998f8bdaaf1489b3ad168fed239c7155623577a3ed02a457d0556c6f0c134baab2da84d74f9e8a318fc77bfc93917c2150ca236
|
7
|
+
data.tar.gz: ad1c4c0eb4b7cb6663bcd48425399ddbe74cb12b2001a7a9229b0b6c81fe9eb06f09d2ca6b8279293c4252193308ddab6aabeb39d4d48f0f3d99fc613dc6e501
|
data/.rubocop.yml
ADDED
data/.rubocop_todo.yml
ADDED
@@ -0,0 +1,182 @@
|
|
1
|
+
# This configuration was generated by
|
2
|
+
# `rubocop --auto-gen-config`
|
3
|
+
# on 2016-01-07 10:02:02 +0100 using RuboCop version 0.35.1.
|
4
|
+
# The point is for the user to remove these configuration records
|
5
|
+
# one by one as the offenses are removed from the code base.
|
6
|
+
# Note that changes in the inspected code, or installation of new
|
7
|
+
# versions of RuboCop, may require this file to be generated again.
|
8
|
+
|
9
|
+
# Offense count: 2
|
10
|
+
Metrics/AbcSize:
|
11
|
+
Max: 29
|
12
|
+
|
13
|
+
# Offense count: 164
|
14
|
+
# Configuration parameters: AllowURI, URISchemes.
|
15
|
+
Metrics/LineLength:
|
16
|
+
Max: 198
|
17
|
+
|
18
|
+
# Offense count: 1
|
19
|
+
# Configuration parameters: CountComments.
|
20
|
+
Metrics/MethodLength:
|
21
|
+
Max: 32
|
22
|
+
|
23
|
+
# Offense count: 1
|
24
|
+
Style/AccessorMethodName:
|
25
|
+
Exclude:
|
26
|
+
- 'lib/wine_bouncer/oauth2.rb'
|
27
|
+
|
28
|
+
# Offense count: 1
|
29
|
+
# Cop supports --auto-correct.
|
30
|
+
Style/BlockComments:
|
31
|
+
Exclude:
|
32
|
+
- 'spec/spec_helper.rb'
|
33
|
+
|
34
|
+
# Offense count: 1
|
35
|
+
# Cop supports --auto-correct.
|
36
|
+
Style/CommentIndentation:
|
37
|
+
Exclude:
|
38
|
+
- 'spec/rails_helper.rb'
|
39
|
+
|
40
|
+
# Offense count: 14
|
41
|
+
# Configuration parameters: Exclude.
|
42
|
+
Style/Documentation:
|
43
|
+
Exclude:
|
44
|
+
- 'spec/**/*'
|
45
|
+
- 'test/**/*'
|
46
|
+
- 'lib/generators/wine_bouncer/initializer_generator.rb'
|
47
|
+
- 'lib/wine_bouncer.rb'
|
48
|
+
- 'lib/wine_bouncer/auth_methods/auth_methods.rb'
|
49
|
+
- 'lib/wine_bouncer/auth_strategies/default.rb'
|
50
|
+
- 'lib/wine_bouncer/auth_strategies/protected.rb'
|
51
|
+
- 'lib/wine_bouncer/auth_strategies/swagger.rb'
|
52
|
+
- 'lib/wine_bouncer/base_strategy.rb'
|
53
|
+
- 'lib/wine_bouncer/configuration.rb'
|
54
|
+
- 'lib/wine_bouncer/errors.rb'
|
55
|
+
- 'lib/wine_bouncer/extension.rb'
|
56
|
+
- 'lib/wine_bouncer/oauth2.rb'
|
57
|
+
- 'lib/wine_bouncer/version.rb'
|
58
|
+
|
59
|
+
# Offense count: 6
|
60
|
+
Style/DoubleNegation:
|
61
|
+
Exclude:
|
62
|
+
- 'lib/wine_bouncer/auth_methods/auth_methods.rb'
|
63
|
+
- 'lib/wine_bouncer/auth_strategies/default.rb'
|
64
|
+
- 'lib/wine_bouncer/auth_strategies/protected.rb'
|
65
|
+
- 'lib/wine_bouncer/auth_strategies/swagger.rb'
|
66
|
+
|
67
|
+
# Offense count: 4
|
68
|
+
# Cop supports --auto-correct.
|
69
|
+
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
70
|
+
Style/EmptyLinesAroundModuleBody:
|
71
|
+
Exclude:
|
72
|
+
- 'lib/wine_bouncer/configuration.rb'
|
73
|
+
- 'spec/dummy/app/api/default_api.rb'
|
74
|
+
- 'spec/dummy/app/api/protected_api.rb'
|
75
|
+
- 'spec/dummy/app/api/swagger_api.rb'
|
76
|
+
|
77
|
+
# Offense count: 14
|
78
|
+
# Cop supports --auto-correct.
|
79
|
+
# Configuration parameters: AllowForAlignment.
|
80
|
+
Style/ExtraSpacing:
|
81
|
+
Exclude:
|
82
|
+
- 'spec/dummy/bin/rails'
|
83
|
+
- 'spec/dummy/config.ru'
|
84
|
+
- 'spec/dummy/db/migrate/20140915160601_create_doorkeeper_tables.rb'
|
85
|
+
- 'spec/dummy/db/schema.rb'
|
86
|
+
|
87
|
+
# Offense count: 1
|
88
|
+
# Configuration parameters: MinBodyLength.
|
89
|
+
Style/GuardClause:
|
90
|
+
Exclude:
|
91
|
+
- 'lib/wine_bouncer/oauth2.rb'
|
92
|
+
|
93
|
+
# Offense count: 3
|
94
|
+
# Cop supports --auto-correct.
|
95
|
+
# Configuration parameters: Width.
|
96
|
+
Style/IndentationWidth:
|
97
|
+
Exclude:
|
98
|
+
- 'lib/wine_bouncer/auth_methods/auth_methods.rb'
|
99
|
+
- 'lib/wine_bouncer/auth_strategies/default.rb'
|
100
|
+
- 'lib/wine_bouncer/auth_strategies/swagger.rb'
|
101
|
+
|
102
|
+
# Offense count: 7
|
103
|
+
# Cop supports --auto-correct.
|
104
|
+
Style/LeadingCommentSpace:
|
105
|
+
Exclude:
|
106
|
+
- 'lib/wine_bouncer/oauth2.rb'
|
107
|
+
- 'spec/dummy/config/environments/test.rb'
|
108
|
+
- 'spec/intergration/oauth2_default_strategy_spec.rb'
|
109
|
+
- 'spec/intergration/oauth2_protected_strategy_spec.rb'
|
110
|
+
- 'spec/intergration/oauth2_swagger_strategy_spec.rb'
|
111
|
+
- 'spec/rails_helper.rb'
|
112
|
+
|
113
|
+
# Offense count: 21
|
114
|
+
# Cop supports --auto-correct.
|
115
|
+
Style/MethodCallParentheses:
|
116
|
+
Exclude:
|
117
|
+
- 'spec/lib/wine_bouncer/auth_strategies/default_spec.rb'
|
118
|
+
- 'spec/lib/wine_bouncer/auth_strategies/swagger_spec.rb'
|
119
|
+
|
120
|
+
# Offense count: 1
|
121
|
+
# Cop supports --auto-correct.
|
122
|
+
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
123
|
+
Style/MethodDefParentheses:
|
124
|
+
Enabled: false
|
125
|
+
|
126
|
+
# Offense count: 2
|
127
|
+
# Cop supports --auto-correct.
|
128
|
+
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
129
|
+
Style/MultilineOperationIndentation:
|
130
|
+
Enabled: false
|
131
|
+
|
132
|
+
# Offense count: 1
|
133
|
+
# Cop supports --auto-correct.
|
134
|
+
Style/NumericLiterals:
|
135
|
+
MinDigits: 15
|
136
|
+
|
137
|
+
# Offense count: 1
|
138
|
+
# Cop supports --auto-correct.
|
139
|
+
# Configuration parameters: PreferredDelimiters.
|
140
|
+
Style/PercentLiteralDelimiters:
|
141
|
+
Exclude:
|
142
|
+
- 'wine_bouncer.gemspec'
|
143
|
+
|
144
|
+
# Offense count: 7
|
145
|
+
# Configuration parameters: NamePrefix, NamePrefixBlacklist, NameWhitelist.
|
146
|
+
Style/PredicateName:
|
147
|
+
Exclude:
|
148
|
+
- 'lib/wine_bouncer/auth_methods/auth_methods.rb'
|
149
|
+
- 'lib/wine_bouncer/auth_strategies/default.rb'
|
150
|
+
- 'lib/wine_bouncer/auth_strategies/protected.rb'
|
151
|
+
- 'lib/wine_bouncer/auth_strategies/swagger.rb'
|
152
|
+
|
153
|
+
# Offense count: 1
|
154
|
+
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
155
|
+
Style/RaiseArgs:
|
156
|
+
Enabled: false
|
157
|
+
|
158
|
+
# Offense count: 2
|
159
|
+
# Cop supports --auto-correct.
|
160
|
+
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
161
|
+
Style/SignalException:
|
162
|
+
Exclude:
|
163
|
+
- 'lib/wine_bouncer/oauth2.rb'
|
164
|
+
|
165
|
+
# Offense count: 1
|
166
|
+
# Cop supports --auto-correct.
|
167
|
+
Style/SpaceAfterComma:
|
168
|
+
Exclude:
|
169
|
+
- 'spec/lib/wine_bouncer/auth_strategies/swagger_spec.rb'
|
170
|
+
|
171
|
+
# Offense count: 1
|
172
|
+
# Cop supports --auto-correct.
|
173
|
+
# Configuration parameters: IgnoredMethods.
|
174
|
+
Style/SymbolProc:
|
175
|
+
Exclude:
|
176
|
+
- 'lib/wine_bouncer/extension.rb'
|
177
|
+
|
178
|
+
# Offense count: 1
|
179
|
+
# Cop supports --auto-correct.
|
180
|
+
Style/UnneededPercentQ:
|
181
|
+
Exclude:
|
182
|
+
- 'wine_bouncer.gemspec'
|
data/.travis.yml
CHANGED
@@ -5,16 +5,17 @@ before_install:
|
|
5
5
|
language: ruby
|
6
6
|
cache: bundler
|
7
7
|
rvm:
|
8
|
-
- 2.0
|
9
|
-
- 2.1
|
10
|
-
- 2.2
|
8
|
+
- 2.0.0
|
9
|
+
- 2.1.0
|
10
|
+
- 2.2.0
|
11
|
+
- 2.3.0
|
11
12
|
env:
|
12
13
|
- rails=4.1.1 grape=0.12.0 doorkeeper=2.0.1
|
13
|
-
- rails=4.1.1 grape=0.
|
14
|
+
- rails=4.1.1 grape=0.13.0 doorkeeper=2.1.4
|
14
15
|
- rails=4.2.0 grape=0.10.0 doorkeeper=2.2.1
|
15
|
-
- rails=4.2.0 grape=0.11.0 doorkeeper=3.
|
16
|
-
- rails=4.2.0 grape=0.
|
17
|
-
- rails=4.2.0 grape=0.
|
16
|
+
- rails=4.2.0 grape=0.11.0 doorkeeper=3.1.0
|
17
|
+
- rails=4.2.0 grape=0.13.0 doorkeeper=3.1.0
|
18
|
+
- rails=4.2.0 grape=0.14.0 doorkeeper=3.1.0
|
18
19
|
addons:
|
19
20
|
code_climate:
|
20
21
|
repo_token: ab1b6ce5f973da033f80ae2e99fadbb32b2f9c37892703956d8ef954c8e8134e
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
Changelog
|
2
2
|
=========
|
3
|
-
##
|
3
|
+
## 0.5.1
|
4
|
+
* [#56](https://github.com/antek-drzewiecki/wine_bouncer/pull/57): Removed locks for doorkeeper
|
5
|
+
* [#56](https://github.com/antek-drzewiecki/wine_bouncer/pull/56): Grape 0.14.x support, removed locks.
|
6
|
+
* Tested against ruby 2.3.0
|
4
7
|
|
5
8
|
## 0.5.0
|
6
9
|
* [#50](https://github.com/antek-drzewiecki/wine_bouncer/pull/50): Grape 0.13.x support
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -3,6 +3,7 @@
|
|
3
3
|
[![Build Status](https://travis-ci.org/antek-drzewiecki/wine_bouncer.svg?branch=master)](https://travis-ci.org/antek-drzewiecki/wine_bouncer)
|
4
4
|
[![Code Climate](https://codeclimate.com/github/antek-drzewiecki/wine_bouncer/badges/gpa.svg)](https://codeclimate.com/github/antek-drzewiecki/wine_bouncer)
|
5
5
|
[![Gem Version](https://badge.fury.io/rb/wine_bouncer.svg)](http://badge.fury.io/rb/wine_bouncer)
|
6
|
+
[![Documentation](https://inch-ci.org/github/antek-drzewiecki/wine_bouncer.svg)](https://inch-ci.org/github/antek-drzewiecki/wine_bouncer)
|
6
7
|
|
7
8
|
Protect your precious Grape API with Doorkeeper.
|
8
9
|
WineBouncer uses minimal modification, to make the magic happen.
|
@@ -28,15 +29,16 @@ Table of Contents
|
|
28
29
|
|
29
30
|
## Requirements
|
30
31
|
- Ruby > 2.0
|
31
|
-
- Doorkeeper > 1.4.0 and <
|
32
|
-
- Grape > 0.10 and < 0
|
32
|
+
- Doorkeeper > 1.4.0 and < 4.0
|
33
|
+
- Grape > 0.10 and < 1.0
|
34
|
+
Please submit pull requests and Travis env bumps for newer dependency versions.
|
33
35
|
|
34
36
|
## Installation
|
35
37
|
|
36
38
|
Add this line to your application's Gemfile:
|
37
39
|
|
38
40
|
```ruby
|
39
|
-
gem 'wine_bouncer', '~> 0.5.
|
41
|
+
gem 'wine_bouncer', '~> 0.5.1'
|
40
42
|
```
|
41
43
|
|
42
44
|
And then execute:
|
@@ -158,13 +160,12 @@ Then you can start protecting your API like the example below.
|
|
158
160
|
|
159
161
|
``` ruby
|
160
162
|
desc 'This method needs the public or private scope.',
|
161
|
-
:
|
162
|
-
|
163
|
-
[200, 'OK', Api::Entities::Response],
|
163
|
+
success: Api::Entities::Response,
|
164
|
+
failure: [
|
164
165
|
[401, 'Unauthorized', Api::Entities::Error],
|
165
166
|
[403, 'Forbidden', Api::Entities::Error]
|
166
167
|
],
|
167
|
-
:
|
168
|
+
notes: <<-NOTE
|
168
169
|
Marked down notes!
|
169
170
|
NOTE
|
170
171
|
oauth2 'public', 'write'
|
data/Rakefile
CHANGED
@@ -1,10 +1,9 @@
|
|
1
|
-
require
|
1
|
+
require 'bundler/gem_tasks'
|
2
2
|
|
3
3
|
require 'rspec/core/rake_task'
|
4
4
|
|
5
|
-
|
6
5
|
desc 'Default: Run all specs.'
|
7
|
-
task :
|
6
|
+
task default: :spec
|
8
7
|
|
9
|
-
desc
|
10
|
-
RSpec::Core::RakeTask.new(:spec)
|
8
|
+
desc 'Run all specs'
|
9
|
+
RSpec::Core::RakeTask.new(:spec)
|
@@ -3,7 +3,7 @@ module WineBouncer
|
|
3
3
|
attr_accessor :doorkeeper_access_token
|
4
4
|
|
5
5
|
def protected_endpoint=(protected)
|
6
|
-
@protected_endpoint= protected
|
6
|
+
@protected_endpoint = protected
|
7
7
|
end
|
8
8
|
|
9
9
|
def protected_endpoint?
|
@@ -27,7 +27,7 @@ module WineBouncer
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def has_doorkeeper_token?
|
30
|
-
|
30
|
+
!@_doorkeeper_access_token.nil?
|
31
31
|
end
|
32
32
|
|
33
33
|
def has_resource_owner?
|
@@ -1,14 +1,13 @@
|
|
1
1
|
module WineBouncer
|
2
2
|
module AuthStrategies
|
3
3
|
class Default < ::WineBouncer::BaseStrategy
|
4
|
-
|
5
4
|
def endpoint_protected?
|
6
5
|
!!endpoint_authorizations
|
7
6
|
end
|
8
7
|
|
9
8
|
def has_auth_scopes?
|
10
9
|
!!endpoint_authorizations &&
|
11
|
-
endpoint_authorizations.
|
10
|
+
endpoint_authorizations.key?(:scopes) &&
|
12
11
|
!endpoint_authorizations[:scopes].empty?
|
13
12
|
end
|
14
13
|
|
@@ -1,14 +1,13 @@
|
|
1
1
|
module WineBouncer
|
2
2
|
module AuthStrategies
|
3
3
|
class Protected < WineBouncer::BaseStrategy
|
4
|
-
|
5
4
|
def endpoint_protected?
|
6
5
|
has_authorizations?
|
7
6
|
end
|
8
7
|
|
9
8
|
def has_auth_scopes?
|
10
9
|
endpoint_authorizations &&
|
11
|
-
endpoint_authorizations.
|
10
|
+
endpoint_authorizations.key?(:scopes) &&
|
12
11
|
endpoint_authorizations[:scopes].any?
|
13
12
|
end
|
14
13
|
|
@@ -22,7 +21,6 @@ module WineBouncer
|
|
22
21
|
endpoint_authorizations.nil?
|
23
22
|
end
|
24
23
|
|
25
|
-
|
26
24
|
# returns true if an authorization hash has been found
|
27
25
|
# First it checks for the old syntax, then for the new.
|
28
26
|
def has_authorizations?
|
@@ -5,13 +5,9 @@ module WineBouncer
|
|
5
5
|
end
|
6
6
|
|
7
7
|
class Configuration
|
8
|
-
|
9
8
|
attr_accessor :auth_strategy
|
10
9
|
attr_accessor :defined_resource_owner
|
11
|
-
|
12
|
-
def auth_strategy=(strategy)
|
13
|
-
@auth_strategy= strategy
|
14
|
-
end
|
10
|
+
attr_writer :auth_strategy
|
15
11
|
|
16
12
|
def auth_strategy
|
17
13
|
@auth_strategy || :default
|
@@ -42,12 +38,12 @@ module WineBouncer
|
|
42
38
|
end
|
43
39
|
end
|
44
40
|
|
45
|
-
|
41
|
+
def self.configuration
|
46
42
|
@configuration || fail(Errors::UnconfiguredError.new)
|
47
43
|
end
|
48
44
|
|
49
45
|
def self.configuration=(config)
|
50
|
-
@configuration= config
|
46
|
+
@configuration = config
|
51
47
|
@configuration.require_strategies
|
52
48
|
end
|
53
49
|
|
@@ -3,15 +3,15 @@ module WineBouncer
|
|
3
3
|
def oauth2(*scopes)
|
4
4
|
scopes = Doorkeeper.configuration.default_scopes.all if scopes.all? { |x| x.nil? }
|
5
5
|
description = if respond_to?(:route_setting) # >= grape-0.10.0
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
6
|
+
route_setting(:description) || route_setting(:description, {})
|
7
|
+
else
|
8
|
+
@last_description ||= {}
|
9
|
+
end
|
10
10
|
# case WineBouncer.configuration.auth_strategy
|
11
11
|
# when :default
|
12
12
|
description[:auth] = { scopes: scopes }
|
13
13
|
# when :swagger
|
14
|
-
description[:authorizations] = { oauth2: scopes.map{|x| {scope: x}} }
|
14
|
+
description[:authorizations] = { oauth2: scopes.map { |x| { scope: x } } }
|
15
15
|
# end
|
16
16
|
end
|
17
17
|
|
data/lib/wine_bouncer/oauth2.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
module WineBouncer
|
2
2
|
class OAuth2 < Grape::Middleware::Base
|
3
|
-
|
4
3
|
include Doorkeeper::Helpers::Controller
|
5
4
|
###
|
6
5
|
# returns the api context
|
@@ -86,23 +85,20 @@ module WineBouncer
|
|
86
85
|
context.extend(WineBouncer::AuthMethods)
|
87
86
|
context.protected_endpoint = endpoint_protected?
|
88
87
|
return unless context.protected_endpoint?
|
89
|
-
self.doorkeeper_request= env # set request for later use.
|
90
|
-
doorkeeper_authorize!
|
88
|
+
self.doorkeeper_request = env # set request for later use.
|
89
|
+
doorkeeper_authorize!(*auth_scopes)
|
91
90
|
context.doorkeeper_access_token = doorkeeper_token
|
92
91
|
end
|
93
92
|
|
94
93
|
###
|
95
94
|
# Strategy
|
96
95
|
###
|
97
|
-
|
98
|
-
@auth_strategy
|
99
|
-
end
|
96
|
+
attr_reader :auth_strategy
|
100
97
|
|
101
98
|
private
|
102
99
|
|
103
100
|
def set_auth_strategy(strategy)
|
104
101
|
@auth_strategy = WineBouncer::AuthStrategies.const_get("#{strategy.to_s.capitalize}").new
|
105
102
|
end
|
106
|
-
|
107
103
|
end
|
108
104
|
end
|
data/lib/wine_bouncer/version.rb
CHANGED
@@ -33,7 +33,6 @@ module Api
|
|
33
33
|
{ hello: 'non described world' }
|
34
34
|
end
|
35
35
|
|
36
|
-
|
37
36
|
desc 'oauth2 dsl'
|
38
37
|
oauth2 'public'
|
39
38
|
get '/oauth2_dsl' do
|
@@ -49,7 +48,6 @@ module Api
|
|
49
48
|
get '/oauth2_dsl_custom_scopes' do
|
50
49
|
{ hello: 'oauth dsl custom scopes' }
|
51
50
|
end
|
52
|
-
|
53
51
|
end
|
54
52
|
|
55
53
|
class SwaggerApiUnderTest < Grape::API
|
@@ -1,18 +1,17 @@
|
|
1
1
|
require File.expand_path('../boot', __FILE__)
|
2
2
|
|
3
3
|
# Pick the frameworks you want:
|
4
|
-
require
|
5
|
-
require
|
6
|
-
require
|
7
|
-
require
|
8
|
-
require
|
4
|
+
require 'active_record/railtie'
|
5
|
+
require 'action_controller/railtie'
|
6
|
+
require 'action_mailer/railtie'
|
7
|
+
require 'action_view/railtie'
|
8
|
+
require 'sprockets/railtie'
|
9
9
|
|
10
|
-
require
|
10
|
+
require 'wine_bouncer'
|
11
11
|
# require "rails/test_unit/railtie"
|
12
12
|
|
13
13
|
Bundler.require(*Rails.groups)
|
14
14
|
|
15
|
-
|
16
15
|
module Dummy
|
17
16
|
class Application < Rails::Application
|
18
17
|
# Settings in config/environments/* take precedence over those specified here.
|
@@ -28,4 +27,3 @@ module Dummy
|
|
28
27
|
# config.i18n.default_locale = :de
|
29
28
|
end
|
30
29
|
end
|
31
|
-
|
@@ -41,7 +41,7 @@ Doorkeeper.configure do
|
|
41
41
|
# Define access token scopes for your provider
|
42
42
|
# For more information go to
|
43
43
|
# https://github.com/doorkeeper-gem/doorkeeper/wiki/Using-Scopes
|
44
|
-
default_scopes
|
44
|
+
default_scopes :public, :default
|
45
45
|
optional_scopes :write, :update
|
46
46
|
|
47
47
|
# Change the way client credentials are retrieved from the request object.
|
@@ -1 +1 @@
|
|
1
|
-
Dummy::Application.config.secret_token = 'c65fd1ffec8275651d1fd06ec3a4914ba644bbeb87729594a3b35fb4b7ad4cccd298d77baf63f7a6513d437e5b95eef9637f9c37a9691c3ed41143d8b5f9a5ef'
|
1
|
+
Dummy::Application.config.secret_token = 'c65fd1ffec8275651d1fd06ec3a4914ba644bbeb87729594a3b35fb4b7ad4cccd298d77baf63f7a6513d437e5b95eef9637f9c37a9691c3ed41143d8b5f9a5ef'
|
@@ -1,37 +1,37 @@
|
|
1
1
|
class CreateDoorkeeperTables < ActiveRecord::Migration
|
2
2
|
def change
|
3
3
|
create_table :oauth_applications do |t|
|
4
|
-
t.string
|
5
|
-
t.string
|
6
|
-
t.string
|
7
|
-
t.text
|
4
|
+
t.string :name, null: false
|
5
|
+
t.string :uid, null: false
|
6
|
+
t.string :secret, null: false
|
7
|
+
t.text :redirect_uri, null: false
|
8
8
|
t.timestamps
|
9
9
|
end
|
10
10
|
|
11
11
|
add_index :oauth_applications, :uid, unique: true
|
12
12
|
|
13
13
|
create_table :oauth_access_grants do |t|
|
14
|
-
t.integer
|
15
|
-
t.integer
|
16
|
-
t.string
|
17
|
-
t.integer
|
18
|
-
t.text
|
14
|
+
t.integer :resource_owner_id, null: false
|
15
|
+
t.integer :application_id, null: false
|
16
|
+
t.string :token, null: false
|
17
|
+
t.integer :expires_in, null: false
|
18
|
+
t.text :redirect_uri, null: false
|
19
19
|
t.datetime :created_at, null: false
|
20
20
|
t.datetime :revoked_at
|
21
|
-
t.string
|
21
|
+
t.string :scopes
|
22
22
|
end
|
23
23
|
|
24
24
|
add_index :oauth_access_grants, :token, unique: true
|
25
25
|
|
26
26
|
create_table :oauth_access_tokens do |t|
|
27
|
-
t.integer
|
28
|
-
t.integer
|
29
|
-
t.string
|
30
|
-
t.string
|
31
|
-
t.integer
|
27
|
+
t.integer :resource_owner_id
|
28
|
+
t.integer :application_id
|
29
|
+
t.string :token, null: false
|
30
|
+
t.string :refresh_token
|
31
|
+
t.integer :expires_in
|
32
32
|
t.datetime :revoked_at
|
33
33
|
t.datetime :created_at, null: false
|
34
|
-
t.string
|
34
|
+
t.string :scopes
|
35
35
|
end
|
36
36
|
|
37
37
|
add_index :oauth_access_tokens, :token, unique: true
|
data/spec/dummy/db/schema.rb
CHANGED
@@ -12,50 +12,48 @@
|
|
12
12
|
# It's strongly recommended that you check this file into your version control system.
|
13
13
|
|
14
14
|
ActiveRecord::Schema.define(version: 20140915160601) do
|
15
|
-
|
16
|
-
|
17
|
-
t.integer
|
18
|
-
t.
|
19
|
-
t.
|
20
|
-
t.
|
21
|
-
t.
|
22
|
-
t.datetime
|
23
|
-
t.
|
24
|
-
t.string "scopes"
|
15
|
+
create_table 'oauth_access_grants', force: true do |t|
|
16
|
+
t.integer 'resource_owner_id', null: false
|
17
|
+
t.integer 'application_id', null: false
|
18
|
+
t.string 'token', null: false
|
19
|
+
t.integer 'expires_in', null: false
|
20
|
+
t.text 'redirect_uri', null: false
|
21
|
+
t.datetime 'created_at', null: false
|
22
|
+
t.datetime 'revoked_at'
|
23
|
+
t.string 'scopes'
|
25
24
|
end
|
26
25
|
|
27
|
-
add_index
|
28
|
-
|
29
|
-
create_table
|
30
|
-
t.integer
|
31
|
-
t.integer
|
32
|
-
t.string
|
33
|
-
t.string
|
34
|
-
t.integer
|
35
|
-
t.datetime
|
36
|
-
t.datetime
|
37
|
-
t.string
|
26
|
+
add_index 'oauth_access_grants', ['token'], name: 'index_oauth_access_grants_on_token', unique: true
|
27
|
+
|
28
|
+
create_table 'oauth_access_tokens', force: true do |t|
|
29
|
+
t.integer 'resource_owner_id'
|
30
|
+
t.integer 'application_id'
|
31
|
+
t.string 'token', null: false
|
32
|
+
t.string 'refresh_token'
|
33
|
+
t.integer 'expires_in'
|
34
|
+
t.datetime 'revoked_at'
|
35
|
+
t.datetime 'created_at', null: false
|
36
|
+
t.string 'scopes'
|
38
37
|
end
|
39
38
|
|
40
|
-
add_index
|
41
|
-
add_index
|
42
|
-
add_index
|
43
|
-
|
44
|
-
create_table
|
45
|
-
t.string
|
46
|
-
t.string
|
47
|
-
t.string
|
48
|
-
t.text
|
49
|
-
t.datetime
|
50
|
-
t.datetime
|
39
|
+
add_index 'oauth_access_tokens', ['refresh_token'], name: 'index_oauth_access_tokens_on_refresh_token', unique: true
|
40
|
+
add_index 'oauth_access_tokens', ['resource_owner_id'], name: 'index_oauth_access_tokens_on_resource_owner_id'
|
41
|
+
add_index 'oauth_access_tokens', ['token'], name: 'index_oauth_access_tokens_on_token', unique: true
|
42
|
+
|
43
|
+
create_table 'oauth_applications', force: true do |t|
|
44
|
+
t.string 'name', null: false
|
45
|
+
t.string 'uid', null: false
|
46
|
+
t.string 'secret', null: false
|
47
|
+
t.text 'redirect_uri', null: false
|
48
|
+
t.datetime 'created_at'
|
49
|
+
t.datetime 'updated_at'
|
51
50
|
end
|
52
51
|
|
53
|
-
add_index
|
52
|
+
add_index 'oauth_applications', ['uid'], name: 'index_oauth_applications_on_uid', unique: true
|
54
53
|
|
55
|
-
create_table
|
56
|
-
t.string
|
57
|
-
t.datetime
|
58
|
-
t.datetime
|
54
|
+
create_table 'users', force: true do |t|
|
55
|
+
t.string 'name'
|
56
|
+
t.datetime 'created_at'
|
57
|
+
t.datetime 'updated_at'
|
59
58
|
end
|
60
|
-
|
61
59
|
end
|
data/spec/factories/user.rb
CHANGED
@@ -2,13 +2,12 @@ require 'rails_helper'
|
|
2
2
|
require 'json'
|
3
3
|
|
4
4
|
describe Api::MountedDefaultApiUnderTest, type: :api do
|
5
|
-
|
6
5
|
let(:user) { FactoryGirl.create :user }
|
7
6
|
let(:token) { FactoryGirl.create :clientless_access_token, resource_owner_id: user.id, scopes: 'public' }
|
8
7
|
let(:unscoped_token) { FactoryGirl.create :clientless_access_token, resource_owner_id: user.id, scopes: '' }
|
9
8
|
let(:custom_scope) { FactoryGirl.create :clientless_access_token, resource_owner_id: user.id, scopes: 'custom_scope' } #not a default scope
|
10
9
|
|
11
|
-
before
|
10
|
+
before(:example) do
|
12
11
|
WineBouncer.configure do |c|
|
13
12
|
c.auth_strategy = :default
|
14
13
|
|
@@ -71,7 +70,6 @@ describe Api::MountedDefaultApiUnderTest, type: :api do
|
|
71
70
|
end
|
72
71
|
|
73
72
|
context 'protected_without_scopes' do
|
74
|
-
|
75
73
|
it 'allows to call an protected endpoint without scopes' do
|
76
74
|
get '/default_api/protected_without_scope', nil, 'HTTP_AUTHORIZATION' => "Bearer #{token.token}"
|
77
75
|
|
@@ -141,7 +139,6 @@ describe Api::MountedDefaultApiUnderTest, type: :api do
|
|
141
139
|
end
|
142
140
|
|
143
141
|
context 'oauth2_dsl_multiple_scopes' do
|
144
|
-
|
145
142
|
it 'allows call on the first scope' do
|
146
143
|
scope_token = FactoryGirl.create :clientless_access_token, resource_owner_id: user.id, scopes: 'multiple'
|
147
144
|
get '/default_api/oauth2_dsl_multiple_scopes', nil, 'HTTP_AUTHORIZATION' => "Bearer #{scope_token.token}"
|
@@ -163,7 +160,6 @@ describe Api::MountedDefaultApiUnderTest, type: :api do
|
|
163
160
|
it 'raises an error scope does not match any of the scopes' do
|
164
161
|
expect { get '/default_api/oauth2_dsl_multiple_scopes' }.to raise_exception(WineBouncer::Errors::OAuthUnauthorizedError)
|
165
162
|
end
|
166
|
-
|
167
163
|
end
|
168
164
|
end
|
169
165
|
|
@@ -2,13 +2,12 @@ require 'rails_helper'
|
|
2
2
|
require 'json'
|
3
3
|
|
4
4
|
describe Api::MountedProtectedApiUnderTest, type: :api do
|
5
|
-
|
6
5
|
let(:user) { FactoryGirl.create :user }
|
7
6
|
let(:token) { FactoryGirl.create :clientless_access_token, resource_owner_id: user.id, scopes: 'public' }
|
8
7
|
let(:unscoped_token) { FactoryGirl.create :clientless_access_token, resource_owner_id: user.id, scopes: '' }
|
9
8
|
let(:custom_scope) { FactoryGirl.create :clientless_access_token, resource_owner_id: user.id, scopes: 'custom_scope' } #not a default scope
|
10
9
|
|
11
|
-
before
|
10
|
+
before(:example) do
|
12
11
|
WineBouncer.configure do |c|
|
13
12
|
c.auth_strategy = :protected
|
14
13
|
|
@@ -2,14 +2,12 @@ require 'rails_helper'
|
|
2
2
|
require 'json'
|
3
3
|
|
4
4
|
describe Api::MountedSwaggerApiUnderTest, type: :api do
|
5
|
-
|
6
5
|
let(:user) { FactoryGirl.create :user }
|
7
6
|
let(:token) { FactoryGirl.create :clientless_access_token, resource_owner_id: user.id, scopes: 'public' }
|
8
7
|
let(:unscoped_token) { FactoryGirl.create :clientless_access_token, resource_owner_id: user.id, scopes: '' }
|
9
8
|
let(:custom_scope) { FactoryGirl.create :clientless_access_token, resource_owner_id: user.id, scopes: 'custom_scope' } #not a default scope
|
10
9
|
|
11
|
-
|
12
|
-
before (:example) do
|
10
|
+
before(:example) do
|
13
11
|
WineBouncer.configure do |c|
|
14
12
|
c.auth_strategy = :swagger
|
15
13
|
|
@@ -21,7 +19,6 @@ describe Api::MountedSwaggerApiUnderTest, type: :api do
|
|
21
19
|
|
22
20
|
context 'tokens and scopes' do
|
23
21
|
it 'gives access when the token and scope are correct' do
|
24
|
-
|
25
22
|
get '/swagger_api/protected', nil, 'HTTP_AUTHORIZATION' => "Bearer #{token.token}"
|
26
23
|
|
27
24
|
expect(last_response.status).to eq(200)
|
@@ -64,7 +61,6 @@ describe Api::MountedSwaggerApiUnderTest, type: :api do
|
|
64
61
|
end
|
65
62
|
|
66
63
|
context 'protected_without_scopes' do
|
67
|
-
|
68
64
|
it 'allows to call an protected endpoint without scopes' do
|
69
65
|
get '/swagger_api/protected_without_scope', nil, 'HTTP_AUTHORIZATION' => "Bearer #{token.token}"
|
70
66
|
|
@@ -155,5 +151,4 @@ describe Api::MountedSwaggerApiUnderTest, type: :api do
|
|
155
151
|
expect(json['hello']).to eq(user.name)
|
156
152
|
end
|
157
153
|
end
|
158
|
-
|
159
154
|
end
|
@@ -1,7 +1,6 @@
|
|
1
1
|
require 'rails_helper'
|
2
2
|
|
3
3
|
describe ::WineBouncer::AuthMethods do
|
4
|
-
|
5
4
|
let(:tested_class) do
|
6
5
|
Class.new do
|
7
6
|
include ::WineBouncer::AuthMethods
|
@@ -25,7 +24,6 @@ describe ::WineBouncer::AuthMethods do
|
|
25
24
|
end
|
26
25
|
|
27
26
|
it 'gives false when the class an no token' do
|
28
|
-
|
29
27
|
expect(tested_class.has_resource_owner?).to be false
|
30
28
|
end
|
31
29
|
|
@@ -63,19 +61,19 @@ describe ::WineBouncer::AuthMethods do
|
|
63
61
|
|
64
62
|
it 'return false if the token has a resource_owner' do
|
65
63
|
token.resource_owner_id = 2
|
66
|
-
tested_class.doorkeeper_access_token= token
|
64
|
+
tested_class.doorkeeper_access_token = token
|
67
65
|
expect(tested_class.client_credential_token?).to be false
|
68
66
|
end
|
69
67
|
end
|
70
68
|
|
71
69
|
context 'protected_endpoint?' do
|
72
70
|
it 'when set true it returns true' do
|
73
|
-
tested_class.protected_endpoint= true
|
71
|
+
tested_class.protected_endpoint = true
|
74
72
|
expect(tested_class.protected_endpoint?).to be true
|
75
73
|
end
|
76
74
|
|
77
75
|
it 'when set false it returns false' do
|
78
|
-
tested_class.protected_endpoint= false
|
76
|
+
tested_class.protected_endpoint = false
|
79
77
|
expect(tested_class.protected_endpoint?).to be false
|
80
78
|
end
|
81
79
|
|
@@ -84,22 +82,21 @@ describe ::WineBouncer::AuthMethods do
|
|
84
82
|
end
|
85
83
|
end
|
86
84
|
|
87
|
-
|
88
85
|
context 'resource_owner' do
|
89
86
|
it 'runs the configured block' do
|
90
87
|
result = 'called block'
|
91
|
-
foo =
|
88
|
+
foo = proc { result }
|
92
89
|
|
93
90
|
WineBouncer.configure do |c|
|
94
91
|
c.auth_strategy = :default
|
95
|
-
c.define_resource_owner
|
92
|
+
c.define_resource_owner(&foo)
|
96
93
|
end
|
97
94
|
|
98
95
|
expect(tested_class.resource_owner).to be(result)
|
99
96
|
end
|
100
97
|
|
101
98
|
it 'raises an argument error when the block is not configured' do
|
102
|
-
WineBouncer.configuration= WineBouncer::Configuration.new
|
99
|
+
WineBouncer.configuration = WineBouncer::Configuration.new
|
103
100
|
expect { tested_class.resource_owner }.to raise_error(WineBouncer::Errors::UnconfiguredError)
|
104
101
|
end
|
105
102
|
end
|
@@ -8,7 +8,6 @@ describe ::WineBouncer::AuthStrategies::Default do
|
|
8
8
|
let(:scopes_hash) { { scopes: scopes } }
|
9
9
|
let(:auth_context) { { route_options: { auth: scopes_hash } } }
|
10
10
|
|
11
|
-
|
12
11
|
context 'endpoint_authorizations' do
|
13
12
|
it 'returns the auth key of the authentication hash.' do
|
14
13
|
context_double = double()
|
@@ -57,7 +56,6 @@ describe ::WineBouncer::AuthStrategies::Default do
|
|
57
56
|
end
|
58
57
|
|
59
58
|
it 'returns false when the auth scopes contain a blank scope array' do
|
60
|
-
|
61
59
|
context_double = double()
|
62
60
|
allow(context_double).to receive(:options) { { route_options: { auth: { scopes: [] } } } }
|
63
61
|
klass.api_context = context_double
|
@@ -8,7 +8,6 @@ describe ::WineBouncer::AuthStrategies::Swagger do
|
|
8
8
|
let(:scopes_map) { { oauth2: scopes } }
|
9
9
|
let(:auth_context) { { route_options: { authorizations: scopes_map } } }
|
10
10
|
|
11
|
-
|
12
11
|
context 'endpoint_authorizations' do
|
13
12
|
it 'returns the auth key of the authentication hash.' do
|
14
13
|
context_double = double()
|
data/spec/rails_helper.rb
CHANGED
@@ -55,11 +55,10 @@ RSpec.configure do |config|
|
|
55
55
|
# instead of true.
|
56
56
|
|
57
57
|
config.include FactoryGirl::Syntax::Methods
|
58
|
-
config.include ApiHelper, :
|
58
|
+
config.include ApiHelper, type: :api
|
59
59
|
|
60
60
|
config.use_transactional_fixtures = false
|
61
61
|
|
62
|
-
|
63
62
|
config.infer_spec_type_from_file_location!
|
64
63
|
|
65
64
|
config.infer_base_class_for_anonymous_controllers = false
|
@@ -76,5 +75,3 @@ RSpec.configure do |config|
|
|
76
75
|
|
77
76
|
config.order = 'random'
|
78
77
|
end
|
79
|
-
|
80
|
-
|
@@ -1,2 +1,2 @@
|
|
1
1
|
ActiveRecord::Migration.verbose = false
|
2
|
-
load Rails.root + 'db/schema.rb'
|
2
|
+
load Rails.root + 'db/schema.rb'
|
data/spec/spec_helper.rb
CHANGED
data/wine_bouncer.gemspec
CHANGED
@@ -4,28 +4,30 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
require 'wine_bouncer/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
|
-
spec.name =
|
7
|
+
spec.name = 'wine_bouncer'
|
8
8
|
spec.version = WineBouncer::VERSION
|
9
|
-
spec.authors = [
|
10
|
-
spec.email = [
|
9
|
+
spec.authors = ['Antek Drzewiecki']
|
10
|
+
spec.email = ['antek.drzewiecki@altran.com']
|
11
11
|
spec.summary = %q{A Ruby gem that allows Oauth2 protection with Doorkeeper for Grape Api's}
|
12
|
-
spec.homepage =
|
13
|
-
spec.license =
|
12
|
+
spec.homepage = ''
|
13
|
+
spec.license = 'MIT'
|
14
14
|
|
15
15
|
spec.files = `git ls-files -z`.split("\x0")
|
16
16
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
17
17
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
18
|
-
spec.require_paths = [
|
18
|
+
spec.require_paths = ['lib']
|
19
19
|
|
20
|
-
spec.add_runtime_dependency 'grape', '~> 0.10', '< 0
|
21
|
-
spec.add_runtime_dependency 'doorkeeper', '>= 1.4', '<
|
20
|
+
spec.add_runtime_dependency 'grape', '~> 0.10', '< 1.0'
|
21
|
+
spec.add_runtime_dependency 'doorkeeper', '>= 1.4', '< 4.0'
|
22
22
|
|
23
|
-
spec.add_development_dependency
|
24
|
-
spec.add_development_dependency
|
25
|
-
spec.add_development_dependency
|
26
|
-
spec.add_development_dependency
|
23
|
+
spec.add_development_dependency 'railties'
|
24
|
+
spec.add_development_dependency 'bundler', '~> 1.7'
|
25
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
26
|
+
spec.add_development_dependency 'rspec-rails', '~> 3.2.0'
|
27
27
|
spec.add_development_dependency 'factory_girl', '~> 4.4.0'
|
28
|
-
spec.add_development_dependency
|
29
|
-
spec.add_development_dependency
|
30
|
-
spec.add_development_dependency
|
28
|
+
spec.add_development_dependency 'generator_spec', '~> 0.9.0'
|
29
|
+
spec.add_development_dependency 'sqlite3'
|
30
|
+
spec.add_development_dependency 'database_cleaner', '~> 1.3.0'
|
31
|
+
spec.add_development_dependency 'rubocop', '0.35.1'
|
32
|
+
spec.add_development_dependency 'yard', '~> 0.8.7'
|
31
33
|
end
|
metadata
CHANGED
@@ -1,167 +1,195 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wine_bouncer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
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: 2016-01-14 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: '0
|
22
|
+
version: '1.0'
|
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: '0
|
32
|
+
version: '1.0'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: doorkeeper
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
|
-
- -
|
37
|
+
- - ">="
|
38
38
|
- !ruby/object:Gem::Version
|
39
39
|
version: '1.4'
|
40
|
-
- - <
|
40
|
+
- - "<"
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version: '
|
42
|
+
version: '4.0'
|
43
43
|
type: :runtime
|
44
44
|
prerelease: false
|
45
45
|
version_requirements: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
|
-
- -
|
47
|
+
- - ">="
|
48
48
|
- !ruby/object:Gem::Version
|
49
49
|
version: '1.4'
|
50
|
-
- - <
|
50
|
+
- - "<"
|
51
51
|
- !ruby/object:Gem::Version
|
52
|
-
version: '
|
52
|
+
version: '4.0'
|
53
53
|
- !ruby/object:Gem::Dependency
|
54
54
|
name: railties
|
55
55
|
requirement: !ruby/object:Gem::Requirement
|
56
56
|
requirements:
|
57
|
-
- -
|
57
|
+
- - ">="
|
58
58
|
- !ruby/object:Gem::Version
|
59
59
|
version: '0'
|
60
60
|
type: :development
|
61
61
|
prerelease: false
|
62
62
|
version_requirements: !ruby/object:Gem::Requirement
|
63
63
|
requirements:
|
64
|
-
- -
|
64
|
+
- - ">="
|
65
65
|
- !ruby/object:Gem::Version
|
66
66
|
version: '0'
|
67
67
|
- !ruby/object:Gem::Dependency
|
68
68
|
name: bundler
|
69
69
|
requirement: !ruby/object:Gem::Requirement
|
70
70
|
requirements:
|
71
|
-
- - ~>
|
71
|
+
- - "~>"
|
72
72
|
- !ruby/object:Gem::Version
|
73
73
|
version: '1.7'
|
74
74
|
type: :development
|
75
75
|
prerelease: false
|
76
76
|
version_requirements: !ruby/object:Gem::Requirement
|
77
77
|
requirements:
|
78
|
-
- - ~>
|
78
|
+
- - "~>"
|
79
79
|
- !ruby/object:Gem::Version
|
80
80
|
version: '1.7'
|
81
81
|
- !ruby/object:Gem::Dependency
|
82
82
|
name: rake
|
83
83
|
requirement: !ruby/object:Gem::Requirement
|
84
84
|
requirements:
|
85
|
-
- - ~>
|
85
|
+
- - "~>"
|
86
86
|
- !ruby/object:Gem::Version
|
87
87
|
version: '10.0'
|
88
88
|
type: :development
|
89
89
|
prerelease: false
|
90
90
|
version_requirements: !ruby/object:Gem::Requirement
|
91
91
|
requirements:
|
92
|
-
- - ~>
|
92
|
+
- - "~>"
|
93
93
|
- !ruby/object:Gem::Version
|
94
94
|
version: '10.0'
|
95
95
|
- !ruby/object:Gem::Dependency
|
96
96
|
name: rspec-rails
|
97
97
|
requirement: !ruby/object:Gem::Requirement
|
98
98
|
requirements:
|
99
|
-
- - ~>
|
99
|
+
- - "~>"
|
100
100
|
- !ruby/object:Gem::Version
|
101
101
|
version: 3.2.0
|
102
102
|
type: :development
|
103
103
|
prerelease: false
|
104
104
|
version_requirements: !ruby/object:Gem::Requirement
|
105
105
|
requirements:
|
106
|
-
- - ~>
|
106
|
+
- - "~>"
|
107
107
|
- !ruby/object:Gem::Version
|
108
108
|
version: 3.2.0
|
109
109
|
- !ruby/object:Gem::Dependency
|
110
110
|
name: factory_girl
|
111
111
|
requirement: !ruby/object:Gem::Requirement
|
112
112
|
requirements:
|
113
|
-
- - ~>
|
113
|
+
- - "~>"
|
114
114
|
- !ruby/object:Gem::Version
|
115
115
|
version: 4.4.0
|
116
116
|
type: :development
|
117
117
|
prerelease: false
|
118
118
|
version_requirements: !ruby/object:Gem::Requirement
|
119
119
|
requirements:
|
120
|
-
- - ~>
|
120
|
+
- - "~>"
|
121
121
|
- !ruby/object:Gem::Version
|
122
122
|
version: 4.4.0
|
123
123
|
- !ruby/object:Gem::Dependency
|
124
124
|
name: generator_spec
|
125
125
|
requirement: !ruby/object:Gem::Requirement
|
126
126
|
requirements:
|
127
|
-
- - ~>
|
127
|
+
- - "~>"
|
128
128
|
- !ruby/object:Gem::Version
|
129
129
|
version: 0.9.0
|
130
130
|
type: :development
|
131
131
|
prerelease: false
|
132
132
|
version_requirements: !ruby/object:Gem::Requirement
|
133
133
|
requirements:
|
134
|
-
- - ~>
|
134
|
+
- - "~>"
|
135
135
|
- !ruby/object:Gem::Version
|
136
136
|
version: 0.9.0
|
137
137
|
- !ruby/object:Gem::Dependency
|
138
138
|
name: sqlite3
|
139
139
|
requirement: !ruby/object:Gem::Requirement
|
140
140
|
requirements:
|
141
|
-
- -
|
141
|
+
- - ">="
|
142
142
|
- !ruby/object:Gem::Version
|
143
143
|
version: '0'
|
144
144
|
type: :development
|
145
145
|
prerelease: false
|
146
146
|
version_requirements: !ruby/object:Gem::Requirement
|
147
147
|
requirements:
|
148
|
-
- -
|
148
|
+
- - ">="
|
149
149
|
- !ruby/object:Gem::Version
|
150
150
|
version: '0'
|
151
151
|
- !ruby/object:Gem::Dependency
|
152
152
|
name: database_cleaner
|
153
153
|
requirement: !ruby/object:Gem::Requirement
|
154
154
|
requirements:
|
155
|
-
- - ~>
|
155
|
+
- - "~>"
|
156
156
|
- !ruby/object:Gem::Version
|
157
157
|
version: 1.3.0
|
158
158
|
type: :development
|
159
159
|
prerelease: false
|
160
160
|
version_requirements: !ruby/object:Gem::Requirement
|
161
161
|
requirements:
|
162
|
-
- - ~>
|
162
|
+
- - "~>"
|
163
163
|
- !ruby/object:Gem::Version
|
164
164
|
version: 1.3.0
|
165
|
+
- !ruby/object:Gem::Dependency
|
166
|
+
name: rubocop
|
167
|
+
requirement: !ruby/object:Gem::Requirement
|
168
|
+
requirements:
|
169
|
+
- - '='
|
170
|
+
- !ruby/object:Gem::Version
|
171
|
+
version: 0.35.1
|
172
|
+
type: :development
|
173
|
+
prerelease: false
|
174
|
+
version_requirements: !ruby/object:Gem::Requirement
|
175
|
+
requirements:
|
176
|
+
- - '='
|
177
|
+
- !ruby/object:Gem::Version
|
178
|
+
version: 0.35.1
|
179
|
+
- !ruby/object:Gem::Dependency
|
180
|
+
name: yard
|
181
|
+
requirement: !ruby/object:Gem::Requirement
|
182
|
+
requirements:
|
183
|
+
- - "~>"
|
184
|
+
- !ruby/object:Gem::Version
|
185
|
+
version: 0.8.7
|
186
|
+
type: :development
|
187
|
+
prerelease: false
|
188
|
+
version_requirements: !ruby/object:Gem::Requirement
|
189
|
+
requirements:
|
190
|
+
- - "~>"
|
191
|
+
- !ruby/object:Gem::Version
|
192
|
+
version: 0.8.7
|
165
193
|
description:
|
166
194
|
email:
|
167
195
|
- antek.drzewiecki@altran.com
|
@@ -169,9 +197,11 @@ executables: []
|
|
169
197
|
extensions: []
|
170
198
|
extra_rdoc_files: []
|
171
199
|
files:
|
172
|
-
- .gitignore
|
173
|
-
- .rspec
|
174
|
-
- .
|
200
|
+
- ".gitignore"
|
201
|
+
- ".rspec"
|
202
|
+
- ".rubocop.yml"
|
203
|
+
- ".rubocop_todo.yml"
|
204
|
+
- ".travis.yml"
|
175
205
|
- CHANGELOG.md
|
176
206
|
- CONTRIBUTING.md
|
177
207
|
- Gemfile
|
@@ -266,17 +296,17 @@ require_paths:
|
|
266
296
|
- lib
|
267
297
|
required_ruby_version: !ruby/object:Gem::Requirement
|
268
298
|
requirements:
|
269
|
-
- -
|
299
|
+
- - ">="
|
270
300
|
- !ruby/object:Gem::Version
|
271
301
|
version: '0'
|
272
302
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
273
303
|
requirements:
|
274
|
-
- -
|
304
|
+
- - ">="
|
275
305
|
- !ruby/object:Gem::Version
|
276
306
|
version: '0'
|
277
307
|
requirements: []
|
278
308
|
rubyforge_project:
|
279
|
-
rubygems_version: 2.
|
309
|
+
rubygems_version: 2.5.1
|
280
310
|
signing_key:
|
281
311
|
specification_version: 4
|
282
312
|
summary: A Ruby gem that allows Oauth2 protection with Doorkeeper for Grape Api's
|
@@ -344,3 +374,4 @@ test_files:
|
|
344
374
|
- spec/rails_helper.rb
|
345
375
|
- spec/shared/orm/active_record.rb
|
346
376
|
- spec/spec_helper.rb
|
377
|
+
has_rdoc:
|