knock 1.4.2 → 1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/app/controllers/knock/application_controller.rb +1 -1
- data/app/controllers/knock/auth_token_controller.rb +32 -7
- data/app/model/knock/auth_token.rb +31 -7
- data/lib/generators/knock/token_controller_generator.rb +25 -0
- data/lib/generators/templates/entity_token_controller.rb.erb +2 -0
- data/lib/generators/templates/knock.rb +25 -3
- data/lib/knock.rb +7 -0
- data/lib/knock/authenticable.rb +45 -6
- data/lib/knock/version.rb +1 -1
- data/test/controllers/knock/auth_token_controller_test.rb +11 -0
- data/test/dummy/app/controllers/admin_protected_controller.rb +7 -0
- data/test/dummy/app/controllers/admin_token_controller.rb +2 -0
- data/test/dummy/app/controllers/composite_name_entity_protected_controller.rb +7 -0
- data/test/dummy/app/controllers/vendor_protected_controller.rb +11 -0
- data/test/dummy/app/controllers/vendor_token_controller.rb +2 -0
- data/test/dummy/app/models/admin.rb +16 -0
- data/test/dummy/app/models/composite_name_entity.rb +3 -0
- data/test/dummy/app/models/vendor.rb +3 -0
- data/test/dummy/config/initializers/knock.rb +10 -0
- data/test/dummy/config/routes.rb +8 -0
- data/test/dummy/db/migrate/20160519075733_create_admins.rb +10 -0
- data/test/dummy/db/migrate/20160522051816_create_vendors.rb +10 -0
- data/test/dummy/db/migrate/20160522181712_create_composite_name_entities.rb +10 -0
- data/test/dummy/db/schema.rb +22 -1
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/test.log +333 -91
- data/test/dummy/test/controllers/admin_protected_controller_test.rb +49 -0
- data/test/dummy/test/controllers/admin_token_controller_test.rb +22 -0
- data/test/dummy/test/controllers/composite_name_entity_protected_controller_test.rb +49 -0
- data/test/dummy/test/controllers/vendor_protected_controller_test.rb +55 -0
- data/test/dummy/test/controllers/vendor_token_controller_test.rb +22 -0
- data/test/dummy/test/models/admin_test.rb +7 -0
- data/test/dummy/test/models/vendor_test.rb +7 -0
- data/test/{dummy/test/fixtures/users.yml → fixtures/admins.yml} +1 -5
- data/test/fixtures/composite_name_entities.yml +5 -0
- data/test/fixtures/vendors.yml +5 -0
- data/test/generators/token_controller_generator_test.rb +31 -0
- data/test/model/knock/auth_token_test.rb +33 -9
- data/test/support/generators_test_helper.rb +9 -0
- data/test/test_helper.rb +9 -0
- data/test/tmp/app/controllers/admin_token_controller.rb +2 -0
- data/test/tmp/app/controllers/admin_user_token_controller.rb +2 -0
- data/test/tmp/app/controllers/user_admin_token_controller.rb +2 -0
- data/test/tmp/app/controllers/user_token_controller.rb +2 -0
- data/test/tmp/config/routes.rb +17 -0
- metadata +76 -6
- data/test/tmp/config/initializers/knock.rb +0 -86
@@ -0,0 +1,49 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class AdminProtectedControllerTest < ActionController::TestCase
|
4
|
+
def valid_auth
|
5
|
+
@admin = admins(:one)
|
6
|
+
@token = Knock::AuthToken.new(payload: { sub: @admin.id }).token
|
7
|
+
@request.env['HTTP_AUTHORIZATION'] = "Bearer #{@token}"
|
8
|
+
end
|
9
|
+
|
10
|
+
def invalid_token_auth
|
11
|
+
@token = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9'
|
12
|
+
@request.env['HTTP_AUTHORIZATION'] = "Bearer #{@token}"
|
13
|
+
end
|
14
|
+
|
15
|
+
def invalid_entity_auth
|
16
|
+
@token = Knock::AuthToken.new(payload: { sub: 0 }).token
|
17
|
+
@request.env['HTTP_AUTHORIZATION'] = "Bearer #{@token}"
|
18
|
+
end
|
19
|
+
|
20
|
+
test "responds with unauthorized" do
|
21
|
+
get :index
|
22
|
+
assert_response :unauthorized
|
23
|
+
end
|
24
|
+
|
25
|
+
test "responds with unauthorized to invalid token" do
|
26
|
+
invalid_token_auth
|
27
|
+
get :index
|
28
|
+
assert_response :unauthorized
|
29
|
+
end
|
30
|
+
|
31
|
+
test "responds with unauthorized to invalid entity" do
|
32
|
+
invalid_entity_auth
|
33
|
+
get :index
|
34
|
+
assert_response :unauthorized
|
35
|
+
end
|
36
|
+
|
37
|
+
test "responds with success if authenticated" do
|
38
|
+
valid_auth
|
39
|
+
get :index
|
40
|
+
assert_response :success
|
41
|
+
end
|
42
|
+
|
43
|
+
test "has a current_admin after authentication" do
|
44
|
+
valid_auth
|
45
|
+
get :index
|
46
|
+
assert_response :success
|
47
|
+
assert @controller.current_admin.id == @admin.id
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class AdminTokenControllerTest < ActionController::TestCase
|
4
|
+
def setup
|
5
|
+
@admin = admins(:one)
|
6
|
+
end
|
7
|
+
|
8
|
+
test "responds with 404 if user does not exist" do
|
9
|
+
post :create, auth: { email: 'wrong@example.net', password: '' }
|
10
|
+
assert_response :not_found
|
11
|
+
end
|
12
|
+
|
13
|
+
test "responds with 404 if password is invalid" do
|
14
|
+
post :create, auth: { email: @admin.email, password: 'wrong' }
|
15
|
+
assert_response :not_found
|
16
|
+
end
|
17
|
+
|
18
|
+
test "responds with 201" do
|
19
|
+
post :create, auth: { email: @admin.email, password: 'secret' }
|
20
|
+
assert_response :created
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class CompositeNameEntityProtectedControllerTest < ActionController::TestCase
|
4
|
+
def valid_auth
|
5
|
+
@composite_name_entity = composite_name_entities(:one)
|
6
|
+
@token = Knock::AuthToken.new(payload: { sub: @composite_name_entity.id }).token
|
7
|
+
@request.env['HTTP_AUTHORIZATION'] = "Bearer #{@token}"
|
8
|
+
end
|
9
|
+
|
10
|
+
def invalid_token_auth
|
11
|
+
@token = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9'
|
12
|
+
@request.env['HTTP_AUTHORIZATION'] = "Bearer #{@token}"
|
13
|
+
end
|
14
|
+
|
15
|
+
def invalid_entity_auth
|
16
|
+
@token = Knock::AuthToken.new(payload: { sub: 0 }).token
|
17
|
+
@request.env['HTTP_AUTHORIZATION'] = "Bearer #{@token}"
|
18
|
+
end
|
19
|
+
|
20
|
+
test "responds with unauthorized" do
|
21
|
+
get :index
|
22
|
+
assert_response :unauthorized
|
23
|
+
end
|
24
|
+
|
25
|
+
test "responds with unauthorized to invalid token" do
|
26
|
+
invalid_token_auth
|
27
|
+
get :index
|
28
|
+
assert_response :unauthorized
|
29
|
+
end
|
30
|
+
|
31
|
+
test "responds with unauthorized to invalid entity" do
|
32
|
+
invalid_entity_auth
|
33
|
+
get :index
|
34
|
+
assert_response :unauthorized
|
35
|
+
end
|
36
|
+
|
37
|
+
test "responds with success if authenticated" do
|
38
|
+
valid_auth
|
39
|
+
get :index
|
40
|
+
assert_response :success
|
41
|
+
end
|
42
|
+
|
43
|
+
test "has a current_composite_name_entity after authentication" do
|
44
|
+
valid_auth
|
45
|
+
get :index
|
46
|
+
assert_response :success
|
47
|
+
assert @controller.current_composite_name_entity.id == @composite_name_entity.id
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class VendorProtectedControllerTest < ActionController::TestCase
|
4
|
+
def valid_auth
|
5
|
+
@vendor = vendors(:one)
|
6
|
+
@token = Knock::AuthToken.new(payload: { sub: @vendor.id }).token
|
7
|
+
@request.env['HTTP_AUTHORIZATION'] = "Bearer #{@token}"
|
8
|
+
end
|
9
|
+
|
10
|
+
def invalid_token_auth
|
11
|
+
@token = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9'
|
12
|
+
@request.env['HTTP_AUTHORIZATION'] = "Bearer #{@token}"
|
13
|
+
end
|
14
|
+
|
15
|
+
def invalid_entity_auth
|
16
|
+
@token = Knock::AuthToken.new(payload: { sub: 0 }).token
|
17
|
+
@request.env['HTTP_AUTHORIZATION'] = "Bearer #{@token}"
|
18
|
+
end
|
19
|
+
|
20
|
+
test "responds with unauthorized" do
|
21
|
+
get :index
|
22
|
+
assert_response :unauthorized
|
23
|
+
end
|
24
|
+
|
25
|
+
test "responds with unauthorized to invalid token" do
|
26
|
+
invalid_token_auth
|
27
|
+
get :index
|
28
|
+
assert_response :unauthorized
|
29
|
+
end
|
30
|
+
|
31
|
+
test "responds with unauthorized to invalid entity" do
|
32
|
+
invalid_entity_auth
|
33
|
+
get :index
|
34
|
+
assert_response :unauthorized
|
35
|
+
end
|
36
|
+
|
37
|
+
test "responds with success if authenticated" do
|
38
|
+
valid_auth
|
39
|
+
get :index
|
40
|
+
assert_response :success
|
41
|
+
end
|
42
|
+
|
43
|
+
test "has a current_vendor after authentication" do
|
44
|
+
valid_auth
|
45
|
+
get :index
|
46
|
+
assert_response :success
|
47
|
+
assert @controller.current_vendor.id == @vendor.id
|
48
|
+
end
|
49
|
+
|
50
|
+
test "raises method missing error appropriately" do
|
51
|
+
assert_raises(NoMethodError) do
|
52
|
+
get :show, id: 1
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class VendorTokenControllerTest < ActionController::TestCase
|
4
|
+
def setup
|
5
|
+
@vendor = vendors(:one)
|
6
|
+
end
|
7
|
+
|
8
|
+
test "responds with 404 if user does not exist" do
|
9
|
+
post :create, auth: { email: 'wrong@example.net', password: '' }
|
10
|
+
assert_response :not_found
|
11
|
+
end
|
12
|
+
|
13
|
+
test "responds with 404 if password is invalid" do
|
14
|
+
post :create, auth: { email: @vendor.email, password: 'wrong' }
|
15
|
+
assert_response :not_found
|
16
|
+
end
|
17
|
+
|
18
|
+
test "responds with 201" do
|
19
|
+
post :create, auth: { email: @vendor.email, password: 'secret' }
|
20
|
+
assert_response :created
|
21
|
+
end
|
22
|
+
end
|
@@ -1,9 +1,5 @@
|
|
1
1
|
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
2
2
|
|
3
3
|
one:
|
4
|
-
email: one@example.net
|
5
|
-
password_digest: <%= BCrypt::Password.create('secret', cost: 4) %>
|
6
|
-
|
7
|
-
two:
|
8
|
-
email: two@example.net
|
4
|
+
email: admin.one@example.net
|
9
5
|
password_digest: <%= BCrypt::Password.create('secret', cost: 4) %>
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require "test_helper"
|
2
|
+
|
3
|
+
class TokenControllerGeneratorTest < Rails::Generators::TestCase
|
4
|
+
include GeneratorsTestHelper
|
5
|
+
|
6
|
+
tests Knock::TokenControllerGenerator
|
7
|
+
destination File.expand_path("../tmp", File.dirname(__FILE__))
|
8
|
+
|
9
|
+
setup :prepare_destination
|
10
|
+
setup :copy_routes
|
11
|
+
|
12
|
+
test "assert all files are properly created" do
|
13
|
+
run_generator ['User']
|
14
|
+
assert_file "app/controllers/user_token_controller.rb"
|
15
|
+
|
16
|
+
run_generator ['Admin']
|
17
|
+
assert_file "app/controllers/user_token_controller.rb"
|
18
|
+
|
19
|
+
run_generator ['AdminUser']
|
20
|
+
assert_file "app/controllers/admin_user_token_controller.rb"
|
21
|
+
|
22
|
+
require File.join(destination_root, "app/controllers/admin_user_token_controller.rb")
|
23
|
+
assert Object.const_defined?('AdminUserTokenController'), 'uninitialized constant AdminUserTokenController'
|
24
|
+
|
25
|
+
run_generator ['user_admin']
|
26
|
+
assert_file "app/controllers/user_admin_token_controller.rb"
|
27
|
+
|
28
|
+
require File.join(destination_root, "app/controllers/user_admin_token_controller.rb")
|
29
|
+
assert Object.const_defined?('UserAdminTokenController'), 'uninitialized constant UserAdminTokenController'
|
30
|
+
end
|
31
|
+
end
|
@@ -1,26 +1,28 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
require 'jwt'
|
3
|
+
require 'timecop'
|
3
4
|
|
4
5
|
module Knock
|
5
6
|
class AuthTokenTest < ActiveSupport::TestCase
|
6
|
-
|
7
|
-
Knock.token_signature_algorithm = 'RS256'
|
7
|
+
setup do
|
8
8
|
key = Knock.token_secret_signature_key.call
|
9
|
+
@token = JWT.encode({sub: '1'}, key, 'HS256')
|
10
|
+
end
|
9
11
|
|
10
|
-
|
12
|
+
test "verify algorithm" do
|
13
|
+
Knock.token_signature_algorithm = 'RS256'
|
11
14
|
|
12
15
|
assert_raises(JWT::IncorrectAlgorithm) {
|
13
|
-
AuthToken.new(token: token)
|
16
|
+
AuthToken.new(token: @token)
|
14
17
|
}
|
15
18
|
end
|
16
19
|
|
17
20
|
test "decode RSA encoded tokens" do
|
18
|
-
user = users(:one)
|
19
21
|
rsa_private = OpenSSL::PKey::RSA.generate 2048
|
20
22
|
Knock.token_public_key = rsa_private.public_key
|
21
23
|
Knock.token_signature_algorithm = 'RS256'
|
22
24
|
|
23
|
-
token = JWT.encode({sub:
|
25
|
+
token = JWT.encode({sub: "1"}, rsa_private, 'RS256')
|
24
26
|
|
25
27
|
assert_nothing_raised { AuthToken.new(token: token) }
|
26
28
|
end
|
@@ -41,11 +43,33 @@ module Knock
|
|
41
43
|
Knock.token_audience = -> { 'bar' }
|
42
44
|
key = Knock.token_secret_signature_key.call
|
43
45
|
|
44
|
-
token = JWT.encode({sub: 'foo'}, key, 'HS256')
|
45
|
-
|
46
46
|
assert_raises(JWT::InvalidAudError) {
|
47
|
-
AuthToken.new token: token
|
47
|
+
AuthToken.new token: @token
|
48
48
|
}
|
49
49
|
end
|
50
|
+
|
51
|
+
test "validate expiration claim by default" do
|
52
|
+
token = Knock::AuthToken.new(payload: { sub: 'foo' }).token
|
53
|
+
Timecop.travel(25.hours.from_now) do
|
54
|
+
assert_raises(JWT::ExpiredSignature) {
|
55
|
+
Knock::AuthToken.new(token: token)
|
56
|
+
}
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
test "does not validate expiration claim with a nil token_lifetime" do
|
61
|
+
Knock.token_lifetime = nil
|
62
|
+
|
63
|
+
token = Knock::AuthToken.new(payload: { sub: 'foo' }).token
|
64
|
+
Timecop.travel(10.years.from_now) do
|
65
|
+
assert_not Knock::AuthToken.new(token: token).payload.has_key?('exp')
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
test "is serializable" do
|
70
|
+
auth_token = AuthToken.new token: @token
|
71
|
+
|
72
|
+
assert_equal("{\"jwt\":\"#{@token}\"}", auth_token.to_json)
|
73
|
+
end
|
50
74
|
end
|
51
75
|
end
|
data/test/test_helper.rb
CHANGED
@@ -1,4 +1,7 @@
|
|
1
|
+
require 'simplecov'
|
1
2
|
require "codeclimate-test-reporter"
|
3
|
+
|
4
|
+
SimpleCov.start
|
2
5
|
CodeClimate::TestReporter.start
|
3
6
|
|
4
7
|
# Configure Rails Environment
|
@@ -22,6 +25,11 @@ if ActiveSupport::TestCase.respond_to?(:fixture_path=)
|
|
22
25
|
ActiveSupport::TestCase.fixtures :all
|
23
26
|
end
|
24
27
|
|
28
|
+
module Knock
|
29
|
+
class MyCustomException < StandardError
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
25
33
|
# Make sure knock global configuration is reset before every tests
|
26
34
|
# to avoid order dependent failures.
|
27
35
|
class ActiveSupport::TestCase
|
@@ -34,5 +42,6 @@ class ActiveSupport::TestCase
|
|
34
42
|
Knock.token_secret_signature_key = -> { Rails.application.secrets.secret_key_base }
|
35
43
|
Knock.token_public_key = nil
|
36
44
|
Knock.token_audience = nil
|
45
|
+
Knock.token_lifetime = 1.day
|
37
46
|
end
|
38
47
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
Rails.application.routes.draw do
|
2
|
+
post 'user_admin_token' => 'user_admin_token#create'
|
3
|
+
post 'admin_user_token' => 'admin_user_token#create'
|
4
|
+
post 'admin_token' => 'admin_token#create'
|
5
|
+
post 'user_token' => 'user_token#create'
|
6
|
+
post 'admin_token' => 'admin_token#create'
|
7
|
+
post 'vendor_token' => 'vendor_token#create'
|
8
|
+
|
9
|
+
resources :protected_resources
|
10
|
+
resource :current_user
|
11
|
+
|
12
|
+
resources :admin_protected
|
13
|
+
resources :composite_name_entity_protected
|
14
|
+
resources :vendor_protected
|
15
|
+
|
16
|
+
mount Knock::Engine => "/knock"
|
17
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: knock
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: '1.5'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arnaud MESUREUR
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-05-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -67,6 +67,20 @@ dependencies:
|
|
67
67
|
- - ~>
|
68
68
|
- !ruby/object:Gem::Version
|
69
69
|
version: '1.3'
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: timecop
|
72
|
+
requirement: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - ~>
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: 0.8.0
|
77
|
+
type: :development
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - ~>
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: 0.8.0
|
70
84
|
description: Authentication solution for Rails based on JWT
|
71
85
|
email:
|
72
86
|
- arnaud.mesureur@gmail.com
|
@@ -81,6 +95,8 @@ files:
|
|
81
95
|
- app/model/knock/auth_token.rb
|
82
96
|
- config/routes.rb
|
83
97
|
- lib/generators/knock/install_generator.rb
|
98
|
+
- lib/generators/knock/token_controller_generator.rb
|
99
|
+
- lib/generators/templates/entity_token_controller.rb.erb
|
84
100
|
- lib/generators/templates/knock.rb
|
85
101
|
- lib/knock.rb
|
86
102
|
- lib/knock/authenticable.rb
|
@@ -92,11 +108,19 @@ files:
|
|
92
108
|
- test/dummy/Rakefile
|
93
109
|
- test/dummy/app/assets/javascripts/application.js
|
94
110
|
- test/dummy/app/assets/stylesheets/application.css
|
111
|
+
- test/dummy/app/controllers/admin_protected_controller.rb
|
112
|
+
- test/dummy/app/controllers/admin_token_controller.rb
|
95
113
|
- test/dummy/app/controllers/application_controller.rb
|
114
|
+
- test/dummy/app/controllers/composite_name_entity_protected_controller.rb
|
96
115
|
- test/dummy/app/controllers/current_users_controller.rb
|
97
116
|
- test/dummy/app/controllers/protected_resources_controller.rb
|
117
|
+
- test/dummy/app/controllers/vendor_protected_controller.rb
|
118
|
+
- test/dummy/app/controllers/vendor_token_controller.rb
|
98
119
|
- test/dummy/app/helpers/application_helper.rb
|
120
|
+
- test/dummy/app/models/admin.rb
|
121
|
+
- test/dummy/app/models/composite_name_entity.rb
|
99
122
|
- test/dummy/app/models/user.rb
|
123
|
+
- test/dummy/app/models/vendor.rb
|
100
124
|
- test/dummy/app/views/layouts/application.html.erb
|
101
125
|
- test/dummy/bin/bundle
|
102
126
|
- test/dummy/bin/rails
|
@@ -115,6 +139,7 @@ files:
|
|
115
139
|
- test/dummy/config/initializers/cookies_serializer.rb
|
116
140
|
- test/dummy/config/initializers/filter_parameter_logging.rb
|
117
141
|
- test/dummy/config/initializers/inflections.rb
|
142
|
+
- test/dummy/config/initializers/knock.rb
|
118
143
|
- test/dummy/config/initializers/mime_types.rb
|
119
144
|
- test/dummy/config/initializers/session_store.rb
|
120
145
|
- test/dummy/config/initializers/wrap_parameters.rb
|
@@ -122,6 +147,9 @@ files:
|
|
122
147
|
- test/dummy/config/routes.rb
|
123
148
|
- test/dummy/config/secrets.yml
|
124
149
|
- test/dummy/db/migrate/20150713101607_create_users.rb
|
150
|
+
- test/dummy/db/migrate/20160519075733_create_admins.rb
|
151
|
+
- test/dummy/db/migrate/20160522051816_create_vendors.rb
|
152
|
+
- test/dummy/db/migrate/20160522181712_create_composite_name_entities.rb
|
125
153
|
- test/dummy/db/schema.rb
|
126
154
|
- test/dummy/db/test.sqlite3
|
127
155
|
- test/dummy/log/test.log
|
@@ -129,16 +157,31 @@ files:
|
|
129
157
|
- test/dummy/public/422.html
|
130
158
|
- test/dummy/public/500.html
|
131
159
|
- test/dummy/public/favicon.ico
|
160
|
+
- test/dummy/test/controllers/admin_protected_controller_test.rb
|
161
|
+
- test/dummy/test/controllers/admin_token_controller_test.rb
|
162
|
+
- test/dummy/test/controllers/composite_name_entity_protected_controller_test.rb
|
132
163
|
- test/dummy/test/controllers/current_users_controller_test.rb
|
133
164
|
- test/dummy/test/controllers/protected_resources_controller_test.rb
|
134
|
-
- test/dummy/test/
|
165
|
+
- test/dummy/test/controllers/vendor_protected_controller_test.rb
|
166
|
+
- test/dummy/test/controllers/vendor_token_controller_test.rb
|
167
|
+
- test/dummy/test/models/admin_test.rb
|
135
168
|
- test/dummy/test/models/user_test.rb
|
169
|
+
- test/dummy/test/models/vendor_test.rb
|
170
|
+
- test/fixtures/admins.yml
|
171
|
+
- test/fixtures/composite_name_entities.yml
|
136
172
|
- test/fixtures/users.yml
|
173
|
+
- test/fixtures/vendors.yml
|
137
174
|
- test/generators/install_generator_test.rb
|
175
|
+
- test/generators/token_controller_generator_test.rb
|
138
176
|
- test/knock_test.rb
|
139
177
|
- test/model/knock/auth_token_test.rb
|
178
|
+
- test/support/generators_test_helper.rb
|
140
179
|
- test/test_helper.rb
|
141
|
-
- test/tmp/
|
180
|
+
- test/tmp/app/controllers/admin_token_controller.rb
|
181
|
+
- test/tmp/app/controllers/admin_user_token_controller.rb
|
182
|
+
- test/tmp/app/controllers/user_admin_token_controller.rb
|
183
|
+
- test/tmp/app/controllers/user_token_controller.rb
|
184
|
+
- test/tmp/config/routes.rb
|
142
185
|
homepage: https://github.com/nsarno/knock
|
143
186
|
licenses:
|
144
187
|
- MIT
|
@@ -169,11 +212,19 @@ test_files:
|
|
169
212
|
- test/dummy/Rakefile
|
170
213
|
- test/dummy/app/assets/javascripts/application.js
|
171
214
|
- test/dummy/app/assets/stylesheets/application.css
|
215
|
+
- test/dummy/app/controllers/admin_protected_controller.rb
|
216
|
+
- test/dummy/app/controllers/admin_token_controller.rb
|
172
217
|
- test/dummy/app/controllers/application_controller.rb
|
218
|
+
- test/dummy/app/controllers/composite_name_entity_protected_controller.rb
|
173
219
|
- test/dummy/app/controllers/current_users_controller.rb
|
174
220
|
- test/dummy/app/controllers/protected_resources_controller.rb
|
221
|
+
- test/dummy/app/controllers/vendor_protected_controller.rb
|
222
|
+
- test/dummy/app/controllers/vendor_token_controller.rb
|
175
223
|
- test/dummy/app/helpers/application_helper.rb
|
224
|
+
- test/dummy/app/models/admin.rb
|
225
|
+
- test/dummy/app/models/composite_name_entity.rb
|
176
226
|
- test/dummy/app/models/user.rb
|
227
|
+
- test/dummy/app/models/vendor.rb
|
177
228
|
- test/dummy/app/views/layouts/application.html.erb
|
178
229
|
- test/dummy/bin/bundle
|
179
230
|
- test/dummy/bin/rails
|
@@ -192,6 +243,7 @@ test_files:
|
|
192
243
|
- test/dummy/config/initializers/cookies_serializer.rb
|
193
244
|
- test/dummy/config/initializers/filter_parameter_logging.rb
|
194
245
|
- test/dummy/config/initializers/inflections.rb
|
246
|
+
- test/dummy/config/initializers/knock.rb
|
195
247
|
- test/dummy/config/initializers/mime_types.rb
|
196
248
|
- test/dummy/config/initializers/session_store.rb
|
197
249
|
- test/dummy/config/initializers/wrap_parameters.rb
|
@@ -199,6 +251,9 @@ test_files:
|
|
199
251
|
- test/dummy/config/routes.rb
|
200
252
|
- test/dummy/config/secrets.yml
|
201
253
|
- test/dummy/db/migrate/20150713101607_create_users.rb
|
254
|
+
- test/dummy/db/migrate/20160519075733_create_admins.rb
|
255
|
+
- test/dummy/db/migrate/20160522051816_create_vendors.rb
|
256
|
+
- test/dummy/db/migrate/20160522181712_create_composite_name_entities.rb
|
202
257
|
- test/dummy/db/schema.rb
|
203
258
|
- test/dummy/db/test.sqlite3
|
204
259
|
- test/dummy/log/test.log
|
@@ -206,13 +261,28 @@ test_files:
|
|
206
261
|
- test/dummy/public/422.html
|
207
262
|
- test/dummy/public/500.html
|
208
263
|
- test/dummy/public/favicon.ico
|
264
|
+
- test/dummy/test/controllers/admin_protected_controller_test.rb
|
265
|
+
- test/dummy/test/controllers/admin_token_controller_test.rb
|
266
|
+
- test/dummy/test/controllers/composite_name_entity_protected_controller_test.rb
|
209
267
|
- test/dummy/test/controllers/current_users_controller_test.rb
|
210
268
|
- test/dummy/test/controllers/protected_resources_controller_test.rb
|
211
|
-
- test/dummy/test/
|
269
|
+
- test/dummy/test/controllers/vendor_protected_controller_test.rb
|
270
|
+
- test/dummy/test/controllers/vendor_token_controller_test.rb
|
271
|
+
- test/dummy/test/models/admin_test.rb
|
212
272
|
- test/dummy/test/models/user_test.rb
|
273
|
+
- test/dummy/test/models/vendor_test.rb
|
274
|
+
- test/fixtures/admins.yml
|
275
|
+
- test/fixtures/composite_name_entities.yml
|
213
276
|
- test/fixtures/users.yml
|
277
|
+
- test/fixtures/vendors.yml
|
214
278
|
- test/generators/install_generator_test.rb
|
279
|
+
- test/generators/token_controller_generator_test.rb
|
215
280
|
- test/knock_test.rb
|
216
281
|
- test/model/knock/auth_token_test.rb
|
282
|
+
- test/support/generators_test_helper.rb
|
217
283
|
- test/test_helper.rb
|
218
|
-
- test/tmp/config/
|
284
|
+
- test/tmp/config/routes.rb
|
285
|
+
- test/tmp/app/controllers/user_token_controller.rb
|
286
|
+
- test/tmp/app/controllers/admin_token_controller.rb
|
287
|
+
- test/tmp/app/controllers/admin_user_token_controller.rb
|
288
|
+
- test/tmp/app/controllers/user_admin_token_controller.rb
|