grape-security 0.8.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 +7 -0
- data/.gitignore +45 -0
- data/.rspec +2 -0
- data/.rubocop.yml +70 -0
- data/.travis.yml +18 -0
- data/.yardopts +2 -0
- data/CHANGELOG.md +314 -0
- data/CONTRIBUTING.md +118 -0
- data/Gemfile +21 -0
- data/Guardfile +14 -0
- data/LICENSE +20 -0
- data/README.md +1777 -0
- data/RELEASING.md +105 -0
- data/Rakefile +69 -0
- data/UPGRADING.md +124 -0
- data/grape-security.gemspec +39 -0
- data/grape.png +0 -0
- data/lib/grape.rb +99 -0
- data/lib/grape/api.rb +646 -0
- data/lib/grape/cookies.rb +39 -0
- data/lib/grape/endpoint.rb +533 -0
- data/lib/grape/error_formatter/base.rb +31 -0
- data/lib/grape/error_formatter/json.rb +15 -0
- data/lib/grape/error_formatter/txt.rb +16 -0
- data/lib/grape/error_formatter/xml.rb +15 -0
- data/lib/grape/exceptions/base.rb +66 -0
- data/lib/grape/exceptions/incompatible_option_values.rb +10 -0
- data/lib/grape/exceptions/invalid_formatter.rb +10 -0
- data/lib/grape/exceptions/invalid_versioner_option.rb +10 -0
- data/lib/grape/exceptions/invalid_with_option_for_represent.rb +10 -0
- data/lib/grape/exceptions/missing_mime_type.rb +10 -0
- data/lib/grape/exceptions/missing_option.rb +10 -0
- data/lib/grape/exceptions/missing_vendor_option.rb +10 -0
- data/lib/grape/exceptions/unknown_options.rb +10 -0
- data/lib/grape/exceptions/unknown_validator.rb +10 -0
- data/lib/grape/exceptions/validation.rb +26 -0
- data/lib/grape/exceptions/validation_errors.rb +43 -0
- data/lib/grape/formatter/base.rb +31 -0
- data/lib/grape/formatter/json.rb +12 -0
- data/lib/grape/formatter/serializable_hash.rb +35 -0
- data/lib/grape/formatter/txt.rb +11 -0
- data/lib/grape/formatter/xml.rb +12 -0
- data/lib/grape/http/request.rb +26 -0
- data/lib/grape/locale/en.yml +32 -0
- data/lib/grape/middleware/auth/base.rb +30 -0
- data/lib/grape/middleware/auth/basic.rb +13 -0
- data/lib/grape/middleware/auth/digest.rb +13 -0
- data/lib/grape/middleware/auth/oauth2.rb +83 -0
- data/lib/grape/middleware/base.rb +62 -0
- data/lib/grape/middleware/error.rb +89 -0
- data/lib/grape/middleware/filter.rb +17 -0
- data/lib/grape/middleware/formatter.rb +150 -0
- data/lib/grape/middleware/globals.rb +13 -0
- data/lib/grape/middleware/versioner.rb +32 -0
- data/lib/grape/middleware/versioner/accept_version_header.rb +67 -0
- data/lib/grape/middleware/versioner/header.rb +132 -0
- data/lib/grape/middleware/versioner/param.rb +42 -0
- data/lib/grape/middleware/versioner/path.rb +52 -0
- data/lib/grape/namespace.rb +23 -0
- data/lib/grape/parser/base.rb +29 -0
- data/lib/grape/parser/json.rb +11 -0
- data/lib/grape/parser/xml.rb +11 -0
- data/lib/grape/path.rb +70 -0
- data/lib/grape/route.rb +27 -0
- data/lib/grape/util/content_types.rb +18 -0
- data/lib/grape/util/deep_merge.rb +23 -0
- data/lib/grape/util/hash_stack.rb +120 -0
- data/lib/grape/validations.rb +322 -0
- data/lib/grape/validations/coerce.rb +63 -0
- data/lib/grape/validations/default.rb +25 -0
- data/lib/grape/validations/exactly_one_of.rb +26 -0
- data/lib/grape/validations/mutual_exclusion.rb +25 -0
- data/lib/grape/validations/presence.rb +16 -0
- data/lib/grape/validations/regexp.rb +12 -0
- data/lib/grape/validations/values.rb +23 -0
- data/lib/grape/version.rb +3 -0
- data/spec/grape/api_spec.rb +2571 -0
- data/spec/grape/endpoint_spec.rb +784 -0
- data/spec/grape/entity_spec.rb +324 -0
- data/spec/grape/exceptions/invalid_formatter_spec.rb +18 -0
- data/spec/grape/exceptions/invalid_versioner_option_spec.rb +18 -0
- data/spec/grape/exceptions/missing_mime_type_spec.rb +18 -0
- data/spec/grape/exceptions/missing_option_spec.rb +18 -0
- data/spec/grape/exceptions/unknown_options_spec.rb +18 -0
- data/spec/grape/exceptions/unknown_validator_spec.rb +18 -0
- data/spec/grape/exceptions/validation_errors_spec.rb +19 -0
- data/spec/grape/middleware/auth/basic_spec.rb +31 -0
- data/spec/grape/middleware/auth/digest_spec.rb +47 -0
- data/spec/grape/middleware/auth/oauth2_spec.rb +135 -0
- data/spec/grape/middleware/base_spec.rb +58 -0
- data/spec/grape/middleware/error_spec.rb +45 -0
- data/spec/grape/middleware/exception_spec.rb +184 -0
- data/spec/grape/middleware/formatter_spec.rb +258 -0
- data/spec/grape/middleware/versioner/accept_version_header_spec.rb +121 -0
- data/spec/grape/middleware/versioner/header_spec.rb +302 -0
- data/spec/grape/middleware/versioner/param_spec.rb +58 -0
- data/spec/grape/middleware/versioner/path_spec.rb +44 -0
- data/spec/grape/middleware/versioner_spec.rb +22 -0
- data/spec/grape/path_spec.rb +229 -0
- data/spec/grape/util/hash_stack_spec.rb +132 -0
- data/spec/grape/validations/coerce_spec.rb +208 -0
- data/spec/grape/validations/default_spec.rb +123 -0
- data/spec/grape/validations/exactly_one_of_spec.rb +71 -0
- data/spec/grape/validations/mutual_exclusion_spec.rb +61 -0
- data/spec/grape/validations/presence_spec.rb +142 -0
- data/spec/grape/validations/regexp_spec.rb +40 -0
- data/spec/grape/validations/values_spec.rb +152 -0
- data/spec/grape/validations/zh-CN.yml +10 -0
- data/spec/grape/validations_spec.rb +994 -0
- data/spec/shared/versioning_examples.rb +121 -0
- data/spec/spec_helper.rb +26 -0
- data/spec/support/basic_auth_encode_helpers.rb +3 -0
- data/spec/support/content_type_helpers.rb +11 -0
- data/spec/support/versioned_helpers.rb +50 -0
- metadata +421 -0
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
shared_examples_for 'versioning' do
|
|
2
|
+
it 'sets the API version' do
|
|
3
|
+
subject.format :txt
|
|
4
|
+
subject.version 'v1', macro_options
|
|
5
|
+
subject.get :hello do
|
|
6
|
+
"Version: #{request.env['api.version'] }"
|
|
7
|
+
end
|
|
8
|
+
versioned_get '/hello', 'v1', macro_options
|
|
9
|
+
expect(last_response.body).to eql "Version: v1"
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
it 'adds the prefix before the API version' do
|
|
13
|
+
subject.format :txt
|
|
14
|
+
subject.prefix 'api'
|
|
15
|
+
subject.version 'v1', macro_options
|
|
16
|
+
subject.get :hello do
|
|
17
|
+
"Version: #{request.env['api.version'] }"
|
|
18
|
+
end
|
|
19
|
+
versioned_get '/hello', 'v1', macro_options.merge(prefix: 'api')
|
|
20
|
+
expect(last_response.body).to eql "Version: v1"
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
it 'is able to specify version as a nesting' do
|
|
24
|
+
subject.version 'v2', macro_options
|
|
25
|
+
subject.get '/awesome' do
|
|
26
|
+
"Radical"
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
subject.version 'v1', macro_options do
|
|
30
|
+
get '/legacy' do
|
|
31
|
+
"Totally"
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
versioned_get '/awesome', 'v1', macro_options
|
|
36
|
+
expect(last_response.status).to eql 404
|
|
37
|
+
|
|
38
|
+
versioned_get '/awesome', 'v2', macro_options
|
|
39
|
+
expect(last_response.status).to eql 200
|
|
40
|
+
versioned_get '/legacy', 'v1', macro_options
|
|
41
|
+
expect(last_response.status).to eql 200
|
|
42
|
+
versioned_get '/legacy', 'v2', macro_options
|
|
43
|
+
expect(last_response.status).to eql 404
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
it 'is able to specify multiple versions' do
|
|
47
|
+
subject.version 'v1', 'v2', macro_options
|
|
48
|
+
subject.get 'awesome' do
|
|
49
|
+
"I exist"
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
versioned_get '/awesome', 'v1', macro_options
|
|
53
|
+
expect(last_response.status).to eql 200
|
|
54
|
+
versioned_get '/awesome', 'v2', macro_options
|
|
55
|
+
expect(last_response.status).to eql 200
|
|
56
|
+
versioned_get '/awesome', 'v3', macro_options
|
|
57
|
+
expect(last_response.status).to eql 404
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
context 'with different versions for the same endpoint' do
|
|
61
|
+
context 'without a prefix' do
|
|
62
|
+
it 'allows the same endpoint to be implemented' do
|
|
63
|
+
subject.format :txt
|
|
64
|
+
subject.version 'v2', macro_options
|
|
65
|
+
subject.get 'version' do
|
|
66
|
+
request.env['api.version']
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
subject.version 'v1', macro_options do
|
|
70
|
+
get 'version' do
|
|
71
|
+
"version " + request.env['api.version']
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
versioned_get '/version', 'v2', macro_options
|
|
76
|
+
expect(last_response.status).to eq(200)
|
|
77
|
+
expect(last_response.body).to eq('v2')
|
|
78
|
+
versioned_get '/version', 'v1', macro_options
|
|
79
|
+
expect(last_response.status).to eq(200)
|
|
80
|
+
expect(last_response.body).to eq('version v1')
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
context 'with a prefix' do
|
|
85
|
+
it 'allows the same endpoint to be implemented' do
|
|
86
|
+
subject.format :txt
|
|
87
|
+
subject.prefix 'api'
|
|
88
|
+
subject.version 'v2', macro_options
|
|
89
|
+
subject.get 'version' do
|
|
90
|
+
request.env['api.version']
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
subject.version 'v1', macro_options do
|
|
94
|
+
get 'version' do
|
|
95
|
+
"version " + request.env['api.version']
|
|
96
|
+
end
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
versioned_get '/version', 'v1', macro_options.merge(prefix: subject.prefix)
|
|
100
|
+
expect(last_response.status).to eq(200)
|
|
101
|
+
expect(last_response.body).to eq('version v1')
|
|
102
|
+
|
|
103
|
+
versioned_get '/version', 'v2', macro_options.merge(prefix: subject.prefix)
|
|
104
|
+
expect(last_response.status).to eq(200)
|
|
105
|
+
expect(last_response.body).to eq('v2')
|
|
106
|
+
end
|
|
107
|
+
end
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
it 'does not overwrite version parameter with API version' do
|
|
111
|
+
subject.format :txt
|
|
112
|
+
subject.version 'v1', macro_options
|
|
113
|
+
subject.params { requires :version }
|
|
114
|
+
subject.get :api_version_with_version_param do
|
|
115
|
+
params[:version]
|
|
116
|
+
end
|
|
117
|
+
versioned_get '/api_version_with_version_param?version=1', 'v1', macro_options
|
|
118
|
+
expect(last_response.body).to eql '1'
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
end
|
data/spec/spec_helper.rb
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
|
2
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
|
3
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), 'support'))
|
|
4
|
+
|
|
5
|
+
require 'grape'
|
|
6
|
+
|
|
7
|
+
require 'rubygems'
|
|
8
|
+
require 'bundler'
|
|
9
|
+
Bundler.setup :default, :test
|
|
10
|
+
|
|
11
|
+
require 'json'
|
|
12
|
+
require 'rack/test'
|
|
13
|
+
require 'base64'
|
|
14
|
+
require 'cookiejar'
|
|
15
|
+
require 'json'
|
|
16
|
+
require 'mime/types'
|
|
17
|
+
|
|
18
|
+
Dir["#{File.dirname(__FILE__)}/support/*.rb"].each do |file|
|
|
19
|
+
require file
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
I18n.enforce_available_locales = false
|
|
23
|
+
|
|
24
|
+
RSpec.configure do |config|
|
|
25
|
+
config.include Rack::Test::Methods
|
|
26
|
+
end
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
module ContentTypeHelpers
|
|
2
|
+
%w(put patch post delete).each do |method|
|
|
3
|
+
define_method :"#{method}_with_json" do |uri, params = {}, env = {}, &block|
|
|
4
|
+
params = params.to_json
|
|
5
|
+
env["CONTENT_TYPE"] ||= "application/json"
|
|
6
|
+
send(method, uri, params, env, &block)
|
|
7
|
+
end
|
|
8
|
+
end
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
include(ContentTypeHelpers)
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Versioning
|
|
2
|
+
|
|
3
|
+
# Returns the path with options[:version] prefixed if options[:using] is :path.
|
|
4
|
+
# Returns normal path otherwise.
|
|
5
|
+
def versioned_path(options = {})
|
|
6
|
+
case options[:using]
|
|
7
|
+
when :path
|
|
8
|
+
File.join('/', options[:prefix] || '', options[:version], options[:path])
|
|
9
|
+
when :param
|
|
10
|
+
File.join('/', options[:prefix] || '', options[:path])
|
|
11
|
+
when :header
|
|
12
|
+
File.join('/', options[:prefix] || '', options[:path])
|
|
13
|
+
when :accept_version_header
|
|
14
|
+
File.join('/', options[:prefix] || '', options[:path])
|
|
15
|
+
else
|
|
16
|
+
raise ArgumentError.new("unknown versioning strategy: #{options[:using]}")
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def versioned_headers(options)
|
|
21
|
+
case options[:using]
|
|
22
|
+
when :path
|
|
23
|
+
{} # no-op
|
|
24
|
+
when :param
|
|
25
|
+
{} # no-op
|
|
26
|
+
when :header
|
|
27
|
+
{
|
|
28
|
+
'HTTP_ACCEPT' => [
|
|
29
|
+
"application/vnd.#{options[:vendor] }-#{options[:version] }",
|
|
30
|
+
options[:format]
|
|
31
|
+
].compact.join("+")
|
|
32
|
+
}
|
|
33
|
+
when :accept_version_header
|
|
34
|
+
{
|
|
35
|
+
'HTTP_ACCEPT_VERSION' => "#{options[:version] }"
|
|
36
|
+
}
|
|
37
|
+
else
|
|
38
|
+
raise ArgumentError.new("unknown versioning strategy: #{options[:using]}")
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def versioned_get(path, version_name, version_options = {})
|
|
43
|
+
path = versioned_path(version_options.merge(version: version_name, path: path))
|
|
44
|
+
headers = versioned_headers(version_options.merge(version: version_name))
|
|
45
|
+
params = {}
|
|
46
|
+
if version_options[:using] == :param
|
|
47
|
+
params = { version_options[:parameter] => version_name }
|
|
48
|
+
end
|
|
49
|
+
get path, params, headers
|
|
50
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,421 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: grape-security
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.8.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Michael Bleigh
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2019-02-01 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: rack
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - ">="
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: 1.3.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.3.0
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: rack-mount
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - ">="
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '0'
|
|
34
|
+
type: :runtime
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - ">="
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '0'
|
|
41
|
+
- !ruby/object:Gem::Dependency
|
|
42
|
+
name: rack-accept
|
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
|
44
|
+
requirements:
|
|
45
|
+
- - ">="
|
|
46
|
+
- !ruby/object:Gem::Version
|
|
47
|
+
version: '0'
|
|
48
|
+
type: :runtime
|
|
49
|
+
prerelease: false
|
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
+
requirements:
|
|
52
|
+
- - ">="
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: '0'
|
|
55
|
+
- !ruby/object:Gem::Dependency
|
|
56
|
+
name: activesupport
|
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
|
58
|
+
requirements:
|
|
59
|
+
- - ">="
|
|
60
|
+
- !ruby/object:Gem::Version
|
|
61
|
+
version: '0'
|
|
62
|
+
type: :runtime
|
|
63
|
+
prerelease: false
|
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
65
|
+
requirements:
|
|
66
|
+
- - ">="
|
|
67
|
+
- !ruby/object:Gem::Version
|
|
68
|
+
version: '0'
|
|
69
|
+
- !ruby/object:Gem::Dependency
|
|
70
|
+
name: multi_json
|
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
|
72
|
+
requirements:
|
|
73
|
+
- - ">="
|
|
74
|
+
- !ruby/object:Gem::Version
|
|
75
|
+
version: 1.3.2
|
|
76
|
+
type: :runtime
|
|
77
|
+
prerelease: false
|
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
79
|
+
requirements:
|
|
80
|
+
- - ">="
|
|
81
|
+
- !ruby/object:Gem::Version
|
|
82
|
+
version: 1.3.2
|
|
83
|
+
- !ruby/object:Gem::Dependency
|
|
84
|
+
name: multi_xml
|
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
|
86
|
+
requirements:
|
|
87
|
+
- - ">="
|
|
88
|
+
- !ruby/object:Gem::Version
|
|
89
|
+
version: 0.5.2
|
|
90
|
+
type: :runtime
|
|
91
|
+
prerelease: false
|
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
93
|
+
requirements:
|
|
94
|
+
- - ">="
|
|
95
|
+
- !ruby/object:Gem::Version
|
|
96
|
+
version: 0.5.2
|
|
97
|
+
- !ruby/object:Gem::Dependency
|
|
98
|
+
name: hashie
|
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
|
100
|
+
requirements:
|
|
101
|
+
- - ">="
|
|
102
|
+
- !ruby/object:Gem::Version
|
|
103
|
+
version: 2.1.0
|
|
104
|
+
type: :runtime
|
|
105
|
+
prerelease: false
|
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
107
|
+
requirements:
|
|
108
|
+
- - ">="
|
|
109
|
+
- !ruby/object:Gem::Version
|
|
110
|
+
version: 2.1.0
|
|
111
|
+
- !ruby/object:Gem::Dependency
|
|
112
|
+
name: virtus
|
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
|
114
|
+
requirements:
|
|
115
|
+
- - ">="
|
|
116
|
+
- !ruby/object:Gem::Version
|
|
117
|
+
version: 1.0.0
|
|
118
|
+
type: :runtime
|
|
119
|
+
prerelease: false
|
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
121
|
+
requirements:
|
|
122
|
+
- - ">="
|
|
123
|
+
- !ruby/object:Gem::Version
|
|
124
|
+
version: 1.0.0
|
|
125
|
+
- !ruby/object:Gem::Dependency
|
|
126
|
+
name: builder
|
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
|
128
|
+
requirements:
|
|
129
|
+
- - ">="
|
|
130
|
+
- !ruby/object:Gem::Version
|
|
131
|
+
version: '0'
|
|
132
|
+
type: :runtime
|
|
133
|
+
prerelease: false
|
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
135
|
+
requirements:
|
|
136
|
+
- - ">="
|
|
137
|
+
- !ruby/object:Gem::Version
|
|
138
|
+
version: '0'
|
|
139
|
+
- !ruby/object:Gem::Dependency
|
|
140
|
+
name: grape-entity
|
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
|
142
|
+
requirements:
|
|
143
|
+
- - ">="
|
|
144
|
+
- !ruby/object:Gem::Version
|
|
145
|
+
version: 0.2.0
|
|
146
|
+
type: :development
|
|
147
|
+
prerelease: false
|
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
149
|
+
requirements:
|
|
150
|
+
- - ">="
|
|
151
|
+
- !ruby/object:Gem::Version
|
|
152
|
+
version: 0.2.0
|
|
153
|
+
- !ruby/object:Gem::Dependency
|
|
154
|
+
name: rake
|
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
|
156
|
+
requirements:
|
|
157
|
+
- - ">="
|
|
158
|
+
- !ruby/object:Gem::Version
|
|
159
|
+
version: '0'
|
|
160
|
+
type: :development
|
|
161
|
+
prerelease: false
|
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
163
|
+
requirements:
|
|
164
|
+
- - ">="
|
|
165
|
+
- !ruby/object:Gem::Version
|
|
166
|
+
version: '0'
|
|
167
|
+
- !ruby/object:Gem::Dependency
|
|
168
|
+
name: maruku
|
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
|
170
|
+
requirements:
|
|
171
|
+
- - ">="
|
|
172
|
+
- !ruby/object:Gem::Version
|
|
173
|
+
version: '0'
|
|
174
|
+
type: :development
|
|
175
|
+
prerelease: false
|
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
177
|
+
requirements:
|
|
178
|
+
- - ">="
|
|
179
|
+
- !ruby/object:Gem::Version
|
|
180
|
+
version: '0'
|
|
181
|
+
- !ruby/object:Gem::Dependency
|
|
182
|
+
name: yard
|
|
183
|
+
requirement: !ruby/object:Gem::Requirement
|
|
184
|
+
requirements:
|
|
185
|
+
- - ">="
|
|
186
|
+
- !ruby/object:Gem::Version
|
|
187
|
+
version: '0'
|
|
188
|
+
type: :development
|
|
189
|
+
prerelease: false
|
|
190
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
191
|
+
requirements:
|
|
192
|
+
- - ">="
|
|
193
|
+
- !ruby/object:Gem::Version
|
|
194
|
+
version: '0'
|
|
195
|
+
- !ruby/object:Gem::Dependency
|
|
196
|
+
name: rack-test
|
|
197
|
+
requirement: !ruby/object:Gem::Requirement
|
|
198
|
+
requirements:
|
|
199
|
+
- - ">="
|
|
200
|
+
- !ruby/object:Gem::Version
|
|
201
|
+
version: '0'
|
|
202
|
+
type: :development
|
|
203
|
+
prerelease: false
|
|
204
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
205
|
+
requirements:
|
|
206
|
+
- - ">="
|
|
207
|
+
- !ruby/object:Gem::Version
|
|
208
|
+
version: '0'
|
|
209
|
+
- !ruby/object:Gem::Dependency
|
|
210
|
+
name: rspec
|
|
211
|
+
requirement: !ruby/object:Gem::Requirement
|
|
212
|
+
requirements:
|
|
213
|
+
- - "~>"
|
|
214
|
+
- !ruby/object:Gem::Version
|
|
215
|
+
version: '2.9'
|
|
216
|
+
type: :development
|
|
217
|
+
prerelease: false
|
|
218
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
219
|
+
requirements:
|
|
220
|
+
- - "~>"
|
|
221
|
+
- !ruby/object:Gem::Version
|
|
222
|
+
version: '2.9'
|
|
223
|
+
- !ruby/object:Gem::Dependency
|
|
224
|
+
name: bundler
|
|
225
|
+
requirement: !ruby/object:Gem::Requirement
|
|
226
|
+
requirements:
|
|
227
|
+
- - ">="
|
|
228
|
+
- !ruby/object:Gem::Version
|
|
229
|
+
version: '0'
|
|
230
|
+
type: :development
|
|
231
|
+
prerelease: false
|
|
232
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
233
|
+
requirements:
|
|
234
|
+
- - ">="
|
|
235
|
+
- !ruby/object:Gem::Version
|
|
236
|
+
version: '0'
|
|
237
|
+
description: "[Backported security patched version] A Ruby framework for rapid API
|
|
238
|
+
development with great conventions."
|
|
239
|
+
email:
|
|
240
|
+
- michael@intridea.com
|
|
241
|
+
executables: []
|
|
242
|
+
extensions: []
|
|
243
|
+
extra_rdoc_files: []
|
|
244
|
+
files:
|
|
245
|
+
- ".gitignore"
|
|
246
|
+
- ".rspec"
|
|
247
|
+
- ".rubocop.yml"
|
|
248
|
+
- ".travis.yml"
|
|
249
|
+
- ".yardopts"
|
|
250
|
+
- CHANGELOG.md
|
|
251
|
+
- CONTRIBUTING.md
|
|
252
|
+
- Gemfile
|
|
253
|
+
- Guardfile
|
|
254
|
+
- LICENSE
|
|
255
|
+
- README.md
|
|
256
|
+
- RELEASING.md
|
|
257
|
+
- Rakefile
|
|
258
|
+
- UPGRADING.md
|
|
259
|
+
- grape-security.gemspec
|
|
260
|
+
- grape.png
|
|
261
|
+
- lib/grape.rb
|
|
262
|
+
- lib/grape/api.rb
|
|
263
|
+
- lib/grape/cookies.rb
|
|
264
|
+
- lib/grape/endpoint.rb
|
|
265
|
+
- lib/grape/error_formatter/base.rb
|
|
266
|
+
- lib/grape/error_formatter/json.rb
|
|
267
|
+
- lib/grape/error_formatter/txt.rb
|
|
268
|
+
- lib/grape/error_formatter/xml.rb
|
|
269
|
+
- lib/grape/exceptions/base.rb
|
|
270
|
+
- lib/grape/exceptions/incompatible_option_values.rb
|
|
271
|
+
- lib/grape/exceptions/invalid_formatter.rb
|
|
272
|
+
- lib/grape/exceptions/invalid_versioner_option.rb
|
|
273
|
+
- lib/grape/exceptions/invalid_with_option_for_represent.rb
|
|
274
|
+
- lib/grape/exceptions/missing_mime_type.rb
|
|
275
|
+
- lib/grape/exceptions/missing_option.rb
|
|
276
|
+
- lib/grape/exceptions/missing_vendor_option.rb
|
|
277
|
+
- lib/grape/exceptions/unknown_options.rb
|
|
278
|
+
- lib/grape/exceptions/unknown_validator.rb
|
|
279
|
+
- lib/grape/exceptions/validation.rb
|
|
280
|
+
- lib/grape/exceptions/validation_errors.rb
|
|
281
|
+
- lib/grape/formatter/base.rb
|
|
282
|
+
- lib/grape/formatter/json.rb
|
|
283
|
+
- lib/grape/formatter/serializable_hash.rb
|
|
284
|
+
- lib/grape/formatter/txt.rb
|
|
285
|
+
- lib/grape/formatter/xml.rb
|
|
286
|
+
- lib/grape/http/request.rb
|
|
287
|
+
- lib/grape/locale/en.yml
|
|
288
|
+
- lib/grape/middleware/auth/base.rb
|
|
289
|
+
- lib/grape/middleware/auth/basic.rb
|
|
290
|
+
- lib/grape/middleware/auth/digest.rb
|
|
291
|
+
- lib/grape/middleware/auth/oauth2.rb
|
|
292
|
+
- lib/grape/middleware/base.rb
|
|
293
|
+
- lib/grape/middleware/error.rb
|
|
294
|
+
- lib/grape/middleware/filter.rb
|
|
295
|
+
- lib/grape/middleware/formatter.rb
|
|
296
|
+
- lib/grape/middleware/globals.rb
|
|
297
|
+
- lib/grape/middleware/versioner.rb
|
|
298
|
+
- lib/grape/middleware/versioner/accept_version_header.rb
|
|
299
|
+
- lib/grape/middleware/versioner/header.rb
|
|
300
|
+
- lib/grape/middleware/versioner/param.rb
|
|
301
|
+
- lib/grape/middleware/versioner/path.rb
|
|
302
|
+
- lib/grape/namespace.rb
|
|
303
|
+
- lib/grape/parser/base.rb
|
|
304
|
+
- lib/grape/parser/json.rb
|
|
305
|
+
- lib/grape/parser/xml.rb
|
|
306
|
+
- lib/grape/path.rb
|
|
307
|
+
- lib/grape/route.rb
|
|
308
|
+
- lib/grape/util/content_types.rb
|
|
309
|
+
- lib/grape/util/deep_merge.rb
|
|
310
|
+
- lib/grape/util/hash_stack.rb
|
|
311
|
+
- lib/grape/validations.rb
|
|
312
|
+
- lib/grape/validations/coerce.rb
|
|
313
|
+
- lib/grape/validations/default.rb
|
|
314
|
+
- lib/grape/validations/exactly_one_of.rb
|
|
315
|
+
- lib/grape/validations/mutual_exclusion.rb
|
|
316
|
+
- lib/grape/validations/presence.rb
|
|
317
|
+
- lib/grape/validations/regexp.rb
|
|
318
|
+
- lib/grape/validations/values.rb
|
|
319
|
+
- lib/grape/version.rb
|
|
320
|
+
- spec/grape/api_spec.rb
|
|
321
|
+
- spec/grape/endpoint_spec.rb
|
|
322
|
+
- spec/grape/entity_spec.rb
|
|
323
|
+
- spec/grape/exceptions/invalid_formatter_spec.rb
|
|
324
|
+
- spec/grape/exceptions/invalid_versioner_option_spec.rb
|
|
325
|
+
- spec/grape/exceptions/missing_mime_type_spec.rb
|
|
326
|
+
- spec/grape/exceptions/missing_option_spec.rb
|
|
327
|
+
- spec/grape/exceptions/unknown_options_spec.rb
|
|
328
|
+
- spec/grape/exceptions/unknown_validator_spec.rb
|
|
329
|
+
- spec/grape/exceptions/validation_errors_spec.rb
|
|
330
|
+
- spec/grape/middleware/auth/basic_spec.rb
|
|
331
|
+
- spec/grape/middleware/auth/digest_spec.rb
|
|
332
|
+
- spec/grape/middleware/auth/oauth2_spec.rb
|
|
333
|
+
- spec/grape/middleware/base_spec.rb
|
|
334
|
+
- spec/grape/middleware/error_spec.rb
|
|
335
|
+
- spec/grape/middleware/exception_spec.rb
|
|
336
|
+
- spec/grape/middleware/formatter_spec.rb
|
|
337
|
+
- spec/grape/middleware/versioner/accept_version_header_spec.rb
|
|
338
|
+
- spec/grape/middleware/versioner/header_spec.rb
|
|
339
|
+
- spec/grape/middleware/versioner/param_spec.rb
|
|
340
|
+
- spec/grape/middleware/versioner/path_spec.rb
|
|
341
|
+
- spec/grape/middleware/versioner_spec.rb
|
|
342
|
+
- spec/grape/path_spec.rb
|
|
343
|
+
- spec/grape/util/hash_stack_spec.rb
|
|
344
|
+
- spec/grape/validations/coerce_spec.rb
|
|
345
|
+
- spec/grape/validations/default_spec.rb
|
|
346
|
+
- spec/grape/validations/exactly_one_of_spec.rb
|
|
347
|
+
- spec/grape/validations/mutual_exclusion_spec.rb
|
|
348
|
+
- spec/grape/validations/presence_spec.rb
|
|
349
|
+
- spec/grape/validations/regexp_spec.rb
|
|
350
|
+
- spec/grape/validations/values_spec.rb
|
|
351
|
+
- spec/grape/validations/zh-CN.yml
|
|
352
|
+
- spec/grape/validations_spec.rb
|
|
353
|
+
- spec/shared/versioning_examples.rb
|
|
354
|
+
- spec/spec_helper.rb
|
|
355
|
+
- spec/support/basic_auth_encode_helpers.rb
|
|
356
|
+
- spec/support/content_type_helpers.rb
|
|
357
|
+
- spec/support/versioned_helpers.rb
|
|
358
|
+
homepage: https://github.com/intridea/grape
|
|
359
|
+
licenses:
|
|
360
|
+
- MIT
|
|
361
|
+
metadata: {}
|
|
362
|
+
post_install_message:
|
|
363
|
+
rdoc_options: []
|
|
364
|
+
require_paths:
|
|
365
|
+
- lib
|
|
366
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
367
|
+
requirements:
|
|
368
|
+
- - ">="
|
|
369
|
+
- !ruby/object:Gem::Version
|
|
370
|
+
version: '0'
|
|
371
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
372
|
+
requirements:
|
|
373
|
+
- - ">="
|
|
374
|
+
- !ruby/object:Gem::Version
|
|
375
|
+
version: '0'
|
|
376
|
+
requirements: []
|
|
377
|
+
rubyforge_project: grape
|
|
378
|
+
rubygems_version: 2.6.14
|
|
379
|
+
signing_key:
|
|
380
|
+
specification_version: 4
|
|
381
|
+
summary: Backported security patched version] A simple Ruby framework for building
|
|
382
|
+
REST-like APIs.
|
|
383
|
+
test_files:
|
|
384
|
+
- spec/grape/api_spec.rb
|
|
385
|
+
- spec/grape/endpoint_spec.rb
|
|
386
|
+
- spec/grape/entity_spec.rb
|
|
387
|
+
- spec/grape/exceptions/invalid_formatter_spec.rb
|
|
388
|
+
- spec/grape/exceptions/invalid_versioner_option_spec.rb
|
|
389
|
+
- spec/grape/exceptions/missing_mime_type_spec.rb
|
|
390
|
+
- spec/grape/exceptions/missing_option_spec.rb
|
|
391
|
+
- spec/grape/exceptions/unknown_options_spec.rb
|
|
392
|
+
- spec/grape/exceptions/unknown_validator_spec.rb
|
|
393
|
+
- spec/grape/exceptions/validation_errors_spec.rb
|
|
394
|
+
- spec/grape/middleware/auth/basic_spec.rb
|
|
395
|
+
- spec/grape/middleware/auth/digest_spec.rb
|
|
396
|
+
- spec/grape/middleware/auth/oauth2_spec.rb
|
|
397
|
+
- spec/grape/middleware/base_spec.rb
|
|
398
|
+
- spec/grape/middleware/error_spec.rb
|
|
399
|
+
- spec/grape/middleware/exception_spec.rb
|
|
400
|
+
- spec/grape/middleware/formatter_spec.rb
|
|
401
|
+
- spec/grape/middleware/versioner/accept_version_header_spec.rb
|
|
402
|
+
- spec/grape/middleware/versioner/header_spec.rb
|
|
403
|
+
- spec/grape/middleware/versioner/param_spec.rb
|
|
404
|
+
- spec/grape/middleware/versioner/path_spec.rb
|
|
405
|
+
- spec/grape/middleware/versioner_spec.rb
|
|
406
|
+
- spec/grape/path_spec.rb
|
|
407
|
+
- spec/grape/util/hash_stack_spec.rb
|
|
408
|
+
- spec/grape/validations/coerce_spec.rb
|
|
409
|
+
- spec/grape/validations/default_spec.rb
|
|
410
|
+
- spec/grape/validations/exactly_one_of_spec.rb
|
|
411
|
+
- spec/grape/validations/mutual_exclusion_spec.rb
|
|
412
|
+
- spec/grape/validations/presence_spec.rb
|
|
413
|
+
- spec/grape/validations/regexp_spec.rb
|
|
414
|
+
- spec/grape/validations/values_spec.rb
|
|
415
|
+
- spec/grape/validations/zh-CN.yml
|
|
416
|
+
- spec/grape/validations_spec.rb
|
|
417
|
+
- spec/shared/versioning_examples.rb
|
|
418
|
+
- spec/spec_helper.rb
|
|
419
|
+
- spec/support/basic_auth_encode_helpers.rb
|
|
420
|
+
- spec/support/content_type_helpers.rb
|
|
421
|
+
- spec/support/versioned_helpers.rb
|