master_api_key 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/app/controllers/master_api_key/api_keys_controller.rb +54 -0
- data/app/controllers/master_api_key/application_controller.rb +11 -0
- data/app/models/master_api_key/api_key.rb +16 -0
- data/config/master_api_key.gemversion +1 -0
- data/config/routes.rb +5 -0
- data/db/migrate/20160329212147_create_master_api_key_api_keys.rb +9 -0
- data/db/migrate/20160330160153_add_group_column.rb +5 -0
- data/db/migrate/20160407194542_require_group_attribute.rb +5 -0
- data/db/migrate/20160411152807_create_master_key.rb +11 -0
- data/db/seeds.rb +10 -0
- data/lib/master_api_key.rb +4 -0
- data/lib/master_api_key/api_gatekeeper.rb +56 -0
- data/lib/master_api_key/engine.rb +14 -0
- data/lib/master_api_key/version.rb +9 -0
- data/spec/controllers/master_api_key/api_keys_controller_spec.rb +130 -0
- data/spec/dummy/Rakefile +6 -0
- data/spec/dummy/app/controllers/application_controller.rb +5 -0
- data/spec/dummy/app/controllers/empty_group_controller.rb +7 -0
- data/spec/dummy/app/controllers/nil_group_controller.rb +7 -0
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/bin/setup +29 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +29 -0
- data/spec/dummy/config/boot.rb +4 -0
- data/spec/dummy/config/database.yml +23 -0
- data/spec/dummy/config/environment.rb +6 -0
- data/spec/dummy/config/environments/development.rb +41 -0
- data/spec/dummy/config/environments/production.rb +79 -0
- data/spec/dummy/config/environments/test.rb +42 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +16 -0
- data/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/spec/dummy/config/initializers/session_store.rb +3 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +23 -0
- data/spec/dummy/config/routes.rb +6 -0
- data/spec/dummy/config/secrets.yml +22 -0
- data/spec/dummy/db/schema.rb +23 -0
- data/spec/dummy/db/seeds.rb +8 -0
- data/spec/dummy/log/development.log +17 -0
- data/spec/dummy/log/test.log +14668 -0
- data/spec/master_api_key/api_gatekeeper_spec.rb +94 -0
- data/spec/rails_helper.rb +57 -0
- data/spec/requests/master_api_key/integration_spec.rb +17 -0
- data/spec/requests/master_api_key/master_api_key_api_keys_spec.rb +98 -0
- data/spec/spec_helper.rb +92 -0
- metadata +258 -0
- metadata.gz.sig +1 -0
@@ -0,0 +1,94 @@
|
|
1
|
+
require 'rails_helper'
|
2
|
+
require 'master_api_key/api_gatekeeper'
|
3
|
+
|
4
|
+
RSpec.describe ApplicationController, :type => :controller do
|
5
|
+
context 'with fully configured controller' do
|
6
|
+
controller do
|
7
|
+
belongs_to_api_group(:allowed_group)
|
8
|
+
|
9
|
+
def index
|
10
|
+
authorize_action do
|
11
|
+
head(:ok)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
before(:each) do
|
17
|
+
end
|
18
|
+
|
19
|
+
context 'Without API TOKEN' do
|
20
|
+
it "should return 401 (:unauthorized) if 'X-API-TOKEN' isn't available" do
|
21
|
+
expect(controller).to receive(:on_authentication_failure)
|
22
|
+
|
23
|
+
controller.index
|
24
|
+
end
|
25
|
+
|
26
|
+
it 'should render a response as unauthorized by default' do
|
27
|
+
expect(controller).to receive(:head).with(:unauthorized)
|
28
|
+
|
29
|
+
controller.index
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
context 'With API Token' do
|
34
|
+
before(:each) do
|
35
|
+
@api_key = MasterApiKey::ApiKey.create!(:group => 'allowed_group')
|
36
|
+
controller.request.headers['X-API-TOKEN'] = @api_key.api_token
|
37
|
+
end
|
38
|
+
|
39
|
+
it "should return 401 (:unauthorized) if the token can't be authenticated" do
|
40
|
+
controller.request.headers['X-API-TOKEN'] = @api_key.api_token + '_missing'
|
41
|
+
|
42
|
+
expect(controller).to receive(:on_authentication_failure)
|
43
|
+
|
44
|
+
controller.index
|
45
|
+
end
|
46
|
+
|
47
|
+
it "should return 403 (:forbidden) if the api token isn't authorized to access the group" do
|
48
|
+
restricted_api_key = MasterApiKey::ApiKey.create!(:group => 'not_allowed_group')
|
49
|
+
controller.request.headers['X-API-TOKEN'] = restricted_api_key.api_token
|
50
|
+
|
51
|
+
expect(controller).to receive(:on_forbidden_request).and_call_original
|
52
|
+
expect(controller).to receive(:head).with(:forbidden)
|
53
|
+
|
54
|
+
controller.index
|
55
|
+
end
|
56
|
+
|
57
|
+
it 'should return 200 if the token is authenticated and authorized to access the controller' do
|
58
|
+
expect(controller).to receive(:head).with(:ok)
|
59
|
+
|
60
|
+
controller.index
|
61
|
+
end
|
62
|
+
|
63
|
+
it 'should return 200 even if the group is defined with a different character case' do
|
64
|
+
upper_case_api_key = MasterApiKey::ApiKey.create!(:group => 'ALLOWED_GROUP')
|
65
|
+
controller.request.headers['X-API-TOKEN'] = upper_case_api_key.api_token
|
66
|
+
expect(controller).to receive(:head).with(:ok)
|
67
|
+
|
68
|
+
controller.index
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
context 'with a controller without a group configured' do
|
74
|
+
controller do
|
75
|
+
|
76
|
+
def index
|
77
|
+
authorize_action do
|
78
|
+
head(:ok)
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
before(:each) do
|
84
|
+
@api_key = MasterApiKey::ApiKey.create!(:group => 'allowed_group')
|
85
|
+
controller.request.headers['X-API-TOKEN'] = @api_key.api_token
|
86
|
+
end
|
87
|
+
|
88
|
+
it 'should throw exception because the controller is not in a group but is using api authentication' do
|
89
|
+
expect{
|
90
|
+
controller.index
|
91
|
+
}.to raise_error(ArgumentError)
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
# This file is copied to spec/ when you run 'rails generate rspec:install'
|
2
|
+
ENV['RAILS_ENV'] ||= 'test'
|
3
|
+
require File.expand_path('../dummy/config/environment.rb', __FILE__)
|
4
|
+
# Prevent database truncation if the environment is production
|
5
|
+
abort('The Rails environment is running in production mode!') if Rails.env.production?
|
6
|
+
require 'spec_helper'
|
7
|
+
require 'rspec/rails'
|
8
|
+
# Add additional requires below this line. Rails is not loaded until this point!
|
9
|
+
|
10
|
+
# Requires supporting ruby files with custom matchers and macros, etc, in
|
11
|
+
# spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
|
12
|
+
# run as spec files by default. This means that files in spec/support that end
|
13
|
+
# in _spec.rb will both be required and run as specs, causing the specs to be
|
14
|
+
# run twice. It is recommended that you do not name files matching this glob to
|
15
|
+
# end with _spec.rb. You can configure this pattern with the --pattern
|
16
|
+
# option on the command line or in ~/.rspec, .rspec or `.rspec-local`.
|
17
|
+
#
|
18
|
+
# The following line is provided for convenience purposes. It has the downside
|
19
|
+
# of increasing the boot-up time by auto-requiring all files in the support
|
20
|
+
# directory. Alternatively, in the individual `*_spec.rb` files, manually
|
21
|
+
# require only the support files necessary.
|
22
|
+
#
|
23
|
+
# Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f }
|
24
|
+
|
25
|
+
# Checks for pending migration and applies them before tests are run.
|
26
|
+
# If you are not using ActiveRecord, you can remove this line.
|
27
|
+
ActiveRecord::Migration.maintain_test_schema!
|
28
|
+
|
29
|
+
RSpec.configure do |config|
|
30
|
+
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
|
31
|
+
config.fixture_path = "#{::Rails.root}/spec/fixtures"
|
32
|
+
|
33
|
+
# If you're not using ActiveRecord, or you'd prefer not to run each of your
|
34
|
+
# examples within a transaction, remove the following line or assign false
|
35
|
+
# instead of true.
|
36
|
+
config.use_transactional_fixtures = true
|
37
|
+
|
38
|
+
# RSpec Rails can automatically mix in different behaviours to your tests
|
39
|
+
# based on their file location, for example enabling you to call `get` and
|
40
|
+
# `post` in specs under `spec/controllers`.
|
41
|
+
#
|
42
|
+
# You can disable this behaviour by removing the line below, and instead
|
43
|
+
# explicitly tag your specs with their type, e.g.:
|
44
|
+
#
|
45
|
+
# RSpec.describe UsersController, :type => :controller do
|
46
|
+
# # ...
|
47
|
+
# end
|
48
|
+
#
|
49
|
+
# The different available types are documented in the features, such as in
|
50
|
+
# https://relishapp.com/rspec/rspec-rails/docs
|
51
|
+
config.infer_spec_type_from_file_location!
|
52
|
+
|
53
|
+
# Filter lines from Rails gems in backtraces.
|
54
|
+
config.filter_rails_from_backtrace!
|
55
|
+
# arbitrary gems may also be filtered via:
|
56
|
+
# config.filter_gems_from_backtrace("gem name")
|
57
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'rails_helper'
|
2
|
+
|
3
|
+
RSpec.describe 'Integration', type: :request do
|
4
|
+
describe 'error cases' do
|
5
|
+
it 'should raise error with nil group configuration' do
|
6
|
+
expect {
|
7
|
+
get '/nil_group'
|
8
|
+
}.to raise_error(ArgumentError)
|
9
|
+
end
|
10
|
+
|
11
|
+
it 'should raise error with empty group configuration' do
|
12
|
+
expect {
|
13
|
+
get '/empty_group'
|
14
|
+
}.to raise_error(ArgumentError)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,98 @@
|
|
1
|
+
require 'rails_helper'
|
2
|
+
|
3
|
+
RSpec.describe 'ApiKeys', type: :request do
|
4
|
+
describe 'POST /master_api_key/api_keys' do
|
5
|
+
before(:each) do
|
6
|
+
master_key = MasterApiKey::ApiKey.create!(:group => :master_key)
|
7
|
+
@headers = {
|
8
|
+
'X-API-TOKEN' => master_key.api_token
|
9
|
+
}
|
10
|
+
end
|
11
|
+
|
12
|
+
it 'should return 200 with properly formatted request' do
|
13
|
+
post '/master_api_key/api_keys', {:group => 'group_1'}, @headers
|
14
|
+
json_object = JSON.parse response.body
|
15
|
+
|
16
|
+
expect(response).to have_http_status(200)
|
17
|
+
expect(response.content_type).to eq 'application/json'
|
18
|
+
|
19
|
+
hash_verifier = {'group' => 'group_1'}
|
20
|
+
expect(json_object).to include 'apiKey'
|
21
|
+
expect(json_object['apiKey']).to include hash_verifier
|
22
|
+
expect(json_object['apiKey']).to include 'id', 'api_token'
|
23
|
+
expect(json_object['apiKey']['id']).to be_an(Integer)
|
24
|
+
expect(json_object['apiKey']['api_token']).to be_a(String)
|
25
|
+
end
|
26
|
+
|
27
|
+
it 'should return 400 with nil group' do
|
28
|
+
post '/master_api_key/api_keys', {:group => nil}, @headers
|
29
|
+
expect(response).to have_http_status(400)
|
30
|
+
end
|
31
|
+
|
32
|
+
it 'should return 400 if group param is missing' do
|
33
|
+
post '/master_api_key/api_keys', {}, @headers
|
34
|
+
expect(response).to have_http_status(400)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
describe 'DELETE /master_api_key/api_keys/#id' do
|
39
|
+
before(:each) do
|
40
|
+
master_key = MasterApiKey::ApiKey.create!(:group => :master_key)
|
41
|
+
@headers = {
|
42
|
+
'X-API-TOKEN' => master_key.api_token
|
43
|
+
}
|
44
|
+
end
|
45
|
+
|
46
|
+
it 'should return 200 with properly formatted request' do
|
47
|
+
post '/master_api_key/api_keys', {:group => 'group_1'}, @headers
|
48
|
+
expect(response).to have_http_status(200)
|
49
|
+
|
50
|
+
json_object = JSON.parse response.body
|
51
|
+
|
52
|
+
id = json_object['apiKey']['id']
|
53
|
+
|
54
|
+
delete "/master_api_key/api_keys/#{id}", {}, @headers
|
55
|
+
expect(response).to have_http_status(200)
|
56
|
+
end
|
57
|
+
|
58
|
+
it 'should return 200 when there is nothing to remove' do
|
59
|
+
delete '/master_api_key/api_keys/100', {}, @headers
|
60
|
+
expect(response).to have_http_status(200)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
describe 'DELETE /master_api_key/api_keys' do
|
65
|
+
before(:each) do
|
66
|
+
master_key = MasterApiKey::ApiKey.create!(:group => :master_key)
|
67
|
+
@headers = {
|
68
|
+
'X-API-TOKEN' => master_key.api_token
|
69
|
+
}
|
70
|
+
end
|
71
|
+
|
72
|
+
it 'should return 200 with properly formatted request' do
|
73
|
+
post '/master_api_key/api_keys', {:group => 'group_1'}, @headers
|
74
|
+
expect(response).to have_http_status(200)
|
75
|
+
|
76
|
+
json_object = JSON.parse response.body
|
77
|
+
api_token = json_object['apiKey']['api_token']
|
78
|
+
|
79
|
+
delete '/master_api_key/api_keys', {:api_token => api_token}, @headers
|
80
|
+
expect(response).to have_http_status(200)
|
81
|
+
end
|
82
|
+
|
83
|
+
it 'should return 200 when there is nothing to remove' do
|
84
|
+
delete '/master_api_key/api_keys' , {:api_token => 'nothing_to_see_here'}, @headers
|
85
|
+
expect(response).to have_http_status(200)
|
86
|
+
end
|
87
|
+
|
88
|
+
it 'should return 400 when the api_token is nil' do
|
89
|
+
delete '/master_api_key/api_keys' , {:api_token => nil}, @headers
|
90
|
+
expect(response).to have_http_status(400)
|
91
|
+
end
|
92
|
+
|
93
|
+
it 'should return 400 when the api_token param is missing' do
|
94
|
+
delete '/master_api_key/api_keys', {}, @headers
|
95
|
+
expect(response).to have_http_status(400)
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,92 @@
|
|
1
|
+
# This file was generated by the `rails generate rspec:install` command. Conventionally, all
|
2
|
+
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
3
|
+
# The generated `.rspec` file contains `--require spec_helper` which will cause
|
4
|
+
# this file to always be loaded, without a need to explicitly require it in any
|
5
|
+
# files.
|
6
|
+
#
|
7
|
+
# Given that it is always loaded, you are encouraged to keep this file as
|
8
|
+
# light-weight as possible. Requiring heavyweight dependencies from this file
|
9
|
+
# will add to the boot time of your test suite on EVERY test run, even for an
|
10
|
+
# individual file that may not need all of that loaded. Instead, consider making
|
11
|
+
# a separate helper file that requires the additional dependencies and performs
|
12
|
+
# the additional setup, and require it from the spec files that actually need
|
13
|
+
# it.
|
14
|
+
#
|
15
|
+
# The `.rspec` file also contains a few flags that are not defaults but that
|
16
|
+
# users commonly want.
|
17
|
+
#
|
18
|
+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
19
|
+
RSpec.configure do |config|
|
20
|
+
# rspec-expectations config goes here. You can use an alternate
|
21
|
+
# assertion/expectation library such as wrong or the stdlib/minitest
|
22
|
+
# assertions if you prefer.
|
23
|
+
config.expect_with :rspec do |expectations|
|
24
|
+
# This option will default to `true` in RSpec 4. It makes the `description`
|
25
|
+
# and `failure_message` of custom matchers include text for helper methods
|
26
|
+
# defined using `chain`, e.g.:
|
27
|
+
# be_bigger_than(2).and_smaller_than(4).description
|
28
|
+
# # => "be bigger than 2 and smaller than 4"
|
29
|
+
# ...rather than:
|
30
|
+
# # => "be bigger than 2"
|
31
|
+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
32
|
+
end
|
33
|
+
|
34
|
+
# rspec-mocks config goes here. You can use an alternate test double
|
35
|
+
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
36
|
+
config.mock_with :rspec do |mocks|
|
37
|
+
# Prevents you from mocking or stubbing a method that does not exist on
|
38
|
+
# a real object. This is generally recommended, and will default to
|
39
|
+
# `true` in RSpec 4.
|
40
|
+
mocks.verify_partial_doubles = true
|
41
|
+
end
|
42
|
+
|
43
|
+
# The settings below are suggested to provide a good initial experience
|
44
|
+
# with RSpec, but feel free to customize to your heart's content.
|
45
|
+
=begin
|
46
|
+
# These two settings work together to allow you to limit a spec run
|
47
|
+
# to individual examples or groups you care about by tagging them with
|
48
|
+
# `:focus` metadata. When nothing is tagged with `:focus`, all examples
|
49
|
+
# get run.
|
50
|
+
config.filter_run :focus
|
51
|
+
config.run_all_when_everything_filtered = true
|
52
|
+
|
53
|
+
# Allows RSpec to persist some state between runs in order to support
|
54
|
+
# the `--only-failures` and `--next-failure` CLI options. We recommend
|
55
|
+
# you configure your source control system to ignore this file.
|
56
|
+
config.example_status_persistence_file_path = "spec/examples.txt"
|
57
|
+
|
58
|
+
# Limits the available syntax to the non-monkey patched syntax that is
|
59
|
+
# recommended. For more details, see:
|
60
|
+
# - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/
|
61
|
+
# - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
|
62
|
+
# - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode
|
63
|
+
config.disable_monkey_patching!
|
64
|
+
|
65
|
+
# Many RSpec users commonly either run the entire suite or an individual
|
66
|
+
# file, and it's useful to allow more verbose output when running an
|
67
|
+
# individual spec file.
|
68
|
+
if config.files_to_run.one?
|
69
|
+
# Use the documentation formatter for detailed output,
|
70
|
+
# unless a formatter has already been configured
|
71
|
+
# (e.g. via a command-line flag).
|
72
|
+
config.default_formatter = 'doc'
|
73
|
+
end
|
74
|
+
|
75
|
+
# Print the 10 slowest examples and example groups at the
|
76
|
+
# end of the spec run, to help surface which specs are running
|
77
|
+
# particularly slow.
|
78
|
+
config.profile_examples = 10
|
79
|
+
|
80
|
+
# Run specs in random order to surface order dependencies. If you find an
|
81
|
+
# order dependency and want to debug it, you can fix the order by providing
|
82
|
+
# the seed, which is printed after each run.
|
83
|
+
# --seed 1234
|
84
|
+
config.order = :random
|
85
|
+
|
86
|
+
# Seed global randomization in this process using the `--seed` CLI option.
|
87
|
+
# Setting this allows you to use `--seed` to deterministically reproduce
|
88
|
+
# test failures related to randomization by passing the same `--seed` value
|
89
|
+
# as the one that triggered the failure.
|
90
|
+
Kernel.srand config.seed
|
91
|
+
=end
|
92
|
+
end
|
metadata
ADDED
@@ -0,0 +1,258 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: master_api_key
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Flynn Jones
|
8
|
+
- Prak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N/0fktfVzQYUsHnZ4=
|
75
|
+
-----END CERTIFICATE-----
|
76
|
+
date: 2016-04-14 00:00:00.000000000 Z
|
77
|
+
dependencies:
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: rails
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
requirements:
|
82
|
+
- - ">="
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
version: '4.0'
|
85
|
+
- - "<"
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '5.0'
|
88
|
+
type: :runtime
|
89
|
+
prerelease: false
|
90
|
+
version_requirements: !ruby/object:Gem::Requirement
|
91
|
+
requirements:
|
92
|
+
- - ">="
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: '4.0'
|
95
|
+
- - "<"
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: '5.0'
|
98
|
+
- !ruby/object:Gem::Dependency
|
99
|
+
name: rspec
|
100
|
+
requirement: !ruby/object:Gem::Requirement
|
101
|
+
requirements:
|
102
|
+
- - "~>"
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: '3.4'
|
105
|
+
type: :development
|
106
|
+
prerelease: false
|
107
|
+
version_requirements: !ruby/object:Gem::Requirement
|
108
|
+
requirements:
|
109
|
+
- - "~>"
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: '3.4'
|
112
|
+
- !ruby/object:Gem::Dependency
|
113
|
+
name: rspec-rails
|
114
|
+
requirement: !ruby/object:Gem::Requirement
|
115
|
+
requirements:
|
116
|
+
- - "~>"
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: '3.4'
|
119
|
+
type: :development
|
120
|
+
prerelease: false
|
121
|
+
version_requirements: !ruby/object:Gem::Requirement
|
122
|
+
requirements:
|
123
|
+
- - "~>"
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '3.4'
|
126
|
+
- !ruby/object:Gem::Dependency
|
127
|
+
name: activerecord-jdbcmysql-adapter
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
129
|
+
requirements:
|
130
|
+
- - "~>"
|
131
|
+
- !ruby/object:Gem::Version
|
132
|
+
version: '1.3'
|
133
|
+
type: :development
|
134
|
+
prerelease: false
|
135
|
+
version_requirements: !ruby/object:Gem::Requirement
|
136
|
+
requirements:
|
137
|
+
- - "~>"
|
138
|
+
- !ruby/object:Gem::Version
|
139
|
+
version: '1.3'
|
140
|
+
description: This gem gives a developer a set of tools to provide authorized access
|
141
|
+
their endpoints.
|
142
|
+
email:
|
143
|
+
- flynn.jones@outlook.com
|
144
|
+
- pvadrevu@amplify.com
|
145
|
+
- 'sgurram@amplify.com '
|
146
|
+
executables: []
|
147
|
+
extensions: []
|
148
|
+
extra_rdoc_files: []
|
149
|
+
files:
|
150
|
+
- app/controllers/master_api_key/api_keys_controller.rb
|
151
|
+
- app/controllers/master_api_key/application_controller.rb
|
152
|
+
- app/models/master_api_key/api_key.rb
|
153
|
+
- config/master_api_key.gemversion
|
154
|
+
- config/routes.rb
|
155
|
+
- db/migrate/20160329212147_create_master_api_key_api_keys.rb
|
156
|
+
- db/migrate/20160330160153_add_group_column.rb
|
157
|
+
- db/migrate/20160407194542_require_group_attribute.rb
|
158
|
+
- db/migrate/20160411152807_create_master_key.rb
|
159
|
+
- db/seeds.rb
|
160
|
+
- lib/master_api_key.rb
|
161
|
+
- lib/master_api_key/api_gatekeeper.rb
|
162
|
+
- lib/master_api_key/engine.rb
|
163
|
+
- lib/master_api_key/version.rb
|
164
|
+
- spec/controllers/master_api_key/api_keys_controller_spec.rb
|
165
|
+
- spec/dummy/Rakefile
|
166
|
+
- spec/dummy/app/controllers/application_controller.rb
|
167
|
+
- spec/dummy/app/controllers/empty_group_controller.rb
|
168
|
+
- spec/dummy/app/controllers/nil_group_controller.rb
|
169
|
+
- spec/dummy/bin/bundle
|
170
|
+
- spec/dummy/bin/rails
|
171
|
+
- spec/dummy/bin/rake
|
172
|
+
- spec/dummy/bin/setup
|
173
|
+
- spec/dummy/config.ru
|
174
|
+
- spec/dummy/config/application.rb
|
175
|
+
- spec/dummy/config/boot.rb
|
176
|
+
- spec/dummy/config/database.yml
|
177
|
+
- spec/dummy/config/environment.rb
|
178
|
+
- spec/dummy/config/environments/development.rb
|
179
|
+
- spec/dummy/config/environments/production.rb
|
180
|
+
- spec/dummy/config/environments/test.rb
|
181
|
+
- spec/dummy/config/initializers/backtrace_silencers.rb
|
182
|
+
- spec/dummy/config/initializers/filter_parameter_logging.rb
|
183
|
+
- spec/dummy/config/initializers/inflections.rb
|
184
|
+
- spec/dummy/config/initializers/mime_types.rb
|
185
|
+
- spec/dummy/config/initializers/session_store.rb
|
186
|
+
- spec/dummy/config/initializers/wrap_parameters.rb
|
187
|
+
- spec/dummy/config/locales/en.yml
|
188
|
+
- spec/dummy/config/routes.rb
|
189
|
+
- spec/dummy/config/secrets.yml
|
190
|
+
- spec/dummy/db/schema.rb
|
191
|
+
- spec/dummy/db/seeds.rb
|
192
|
+
- spec/dummy/log/development.log
|
193
|
+
- spec/dummy/log/test.log
|
194
|
+
- spec/master_api_key/api_gatekeeper_spec.rb
|
195
|
+
- spec/rails_helper.rb
|
196
|
+
- spec/requests/master_api_key/integration_spec.rb
|
197
|
+
- spec/requests/master_api_key/master_api_key_api_keys_spec.rb
|
198
|
+
- spec/spec_helper.rb
|
199
|
+
homepage: https://github.com/amplify-holding/master_api_key
|
200
|
+
licenses:
|
201
|
+
- MIT
|
202
|
+
metadata: {}
|
203
|
+
post_install_message:
|
204
|
+
rdoc_options: []
|
205
|
+
require_paths:
|
206
|
+
- lib
|
207
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
208
|
+
requirements:
|
209
|
+
- - ">="
|
210
|
+
- !ruby/object:Gem::Version
|
211
|
+
version: '0'
|
212
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
213
|
+
requirements:
|
214
|
+
- - ">="
|
215
|
+
- !ruby/object:Gem::Version
|
216
|
+
version: '0'
|
217
|
+
requirements: []
|
218
|
+
rubyforge_project:
|
219
|
+
rubygems_version: 2.4.5.1
|
220
|
+
signing_key:
|
221
|
+
specification_version: 4
|
222
|
+
summary: Secure Access of API with API Keys.
|
223
|
+
test_files:
|
224
|
+
- spec/controllers/master_api_key/api_keys_controller_spec.rb
|
225
|
+
- spec/dummy/app/controllers/application_controller.rb
|
226
|
+
- spec/dummy/app/controllers/empty_group_controller.rb
|
227
|
+
- spec/dummy/app/controllers/nil_group_controller.rb
|
228
|
+
- spec/dummy/bin/bundle
|
229
|
+
- spec/dummy/bin/rails
|
230
|
+
- spec/dummy/bin/rake
|
231
|
+
- spec/dummy/bin/setup
|
232
|
+
- spec/dummy/config/application.rb
|
233
|
+
- spec/dummy/config/boot.rb
|
234
|
+
- spec/dummy/config/database.yml
|
235
|
+
- spec/dummy/config/environment.rb
|
236
|
+
- spec/dummy/config/environments/development.rb
|
237
|
+
- spec/dummy/config/environments/production.rb
|
238
|
+
- spec/dummy/config/environments/test.rb
|
239
|
+
- spec/dummy/config/initializers/backtrace_silencers.rb
|
240
|
+
- spec/dummy/config/initializers/filter_parameter_logging.rb
|
241
|
+
- spec/dummy/config/initializers/inflections.rb
|
242
|
+
- spec/dummy/config/initializers/mime_types.rb
|
243
|
+
- spec/dummy/config/initializers/session_store.rb
|
244
|
+
- spec/dummy/config/initializers/wrap_parameters.rb
|
245
|
+
- spec/dummy/config/locales/en.yml
|
246
|
+
- spec/dummy/config/routes.rb
|
247
|
+
- spec/dummy/config/secrets.yml
|
248
|
+
- spec/dummy/config.ru
|
249
|
+
- spec/dummy/db/schema.rb
|
250
|
+
- spec/dummy/db/seeds.rb
|
251
|
+
- spec/dummy/log/development.log
|
252
|
+
- spec/dummy/log/test.log
|
253
|
+
- spec/dummy/Rakefile
|
254
|
+
- spec/master_api_key/api_gatekeeper_spec.rb
|
255
|
+
- spec/rails_helper.rb
|
256
|
+
- spec/requests/master_api_key/integration_spec.rb
|
257
|
+
- spec/requests/master_api_key/master_api_key_api_keys_spec.rb
|
258
|
+
- spec/spec_helper.rb
|