knock 1.0.0 → 1.1.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/model/knock/auth_token.rb +16 -14
- data/lib/generators/knock/install_generator.rb +11 -0
- data/lib/generators/templates/knock.rb +36 -0
- data/lib/knock.rb +15 -0
- data/lib/knock/version.rb +1 -1
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/development.log +0 -0
- data/test/dummy/log/test.log +665 -0
- data/test/generators/install_generator_test.rb +12 -0
- data/test/knock_test.rb +5 -0
- data/test/tmp/config/initializers/knock.rb +36 -0
- metadata +12 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34a5224d9f1ba673a4e1c7f7fb086273c411807b
|
4
|
+
data.tar.gz: 01793137d8e2c8c8eadc4a9798eda8cdf7af2b28
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a91b399a74e0d7f5954483fd7c07b46e47bf6406b1985f5b39142c930a66a858373d437dcc746eb7f069abd62ec82238333ff1c20f6b4e3bcd4927b46007409
|
7
|
+
data.tar.gz: db32aa96f986f5294b8d2ad8a8e6606b3d1469bc26c73e58a6ec82bb966e30bb672ea58ee7a581de12c07c80556ccdbeb0457895ee0b8982acd63c1a01eadc7a
|
@@ -1,31 +1,33 @@
|
|
1
1
|
require 'jwt'
|
2
2
|
|
3
3
|
module Knock
|
4
|
-
cattr_accessor :token_lifetime
|
5
|
-
|
6
|
-
def self.token_lifetime
|
7
|
-
@token_lifetime || 1.day
|
8
|
-
end
|
9
|
-
|
10
4
|
class AuthToken
|
11
5
|
attr_reader :token
|
12
6
|
|
13
7
|
def initialize payload: {}, token: nil
|
14
|
-
|
15
|
-
@token = JWT.encode ({ exp: expiration_time }).merge(payload), Rails.application.secrets.secret_key_base, 'HS256'
|
16
|
-
else
|
17
|
-
@token = token
|
18
|
-
end
|
8
|
+
@token = token || JWT.encode(claims.merge(payload), key, 'HS256')
|
19
9
|
end
|
20
10
|
|
21
11
|
def validate!
|
22
|
-
JWT.decode @token,
|
12
|
+
JWT.decode @token, key, true, verify_claims
|
23
13
|
end
|
24
14
|
|
25
15
|
private
|
16
|
+
def key
|
17
|
+
Knock.token_secret_signature_key.call
|
18
|
+
end
|
19
|
+
|
20
|
+
def claims
|
21
|
+
{
|
22
|
+
exp: Knock.token_lifetime.from_now.to_i,
|
23
|
+
aud: Knock.token_audience
|
24
|
+
}
|
25
|
+
end
|
26
26
|
|
27
|
-
def
|
28
|
-
|
27
|
+
def verify_claims
|
28
|
+
{
|
29
|
+
aud: Knock.token_audience, verify_claims: Knock.token_audience.present?
|
30
|
+
}
|
29
31
|
end
|
30
32
|
end
|
31
33
|
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module Knock
|
2
|
+
class InstallGenerator < Rails::Generators::Base
|
3
|
+
source_root File.expand_path("../../templates", __FILE__)
|
4
|
+
|
5
|
+
desc "Creates a Knock initializer."
|
6
|
+
|
7
|
+
def copy_initializer
|
8
|
+
template 'knock.rb', 'config/initializers/knock.rb'
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
Knock.setup do |config|
|
2
|
+
|
3
|
+
## Expiration claim
|
4
|
+
## ----------------
|
5
|
+
##
|
6
|
+
## How long before a token is expired.
|
7
|
+
##
|
8
|
+
## Default:
|
9
|
+
# config.token_lifetime = 1.day
|
10
|
+
|
11
|
+
|
12
|
+
## Audience claim
|
13
|
+
## --------------
|
14
|
+
##
|
15
|
+
## Configure the audience claim to indentify the recipients that the token
|
16
|
+
## is intended for.
|
17
|
+
##
|
18
|
+
## Default:
|
19
|
+
# config.token_audience = nil
|
20
|
+
|
21
|
+
## If using Auth0, uncomment the line below
|
22
|
+
# config.token_audience = -> { Rails.application.secrets.auth0_client_id }
|
23
|
+
|
24
|
+
|
25
|
+
## Signature key
|
26
|
+
## -------------
|
27
|
+
##
|
28
|
+
## Configure the key used to sign tokens.
|
29
|
+
##
|
30
|
+
## Default:
|
31
|
+
# config.token_secret_signature_key = -> { Rails.application.secrets.secret_key_base }
|
32
|
+
|
33
|
+
## If using Auth0, uncomment the line below
|
34
|
+
# config.token_secret_signature_key = -> { Rails.application.secrets.auth0_client_secret }
|
35
|
+
|
36
|
+
end
|
data/lib/knock.rb
CHANGED
@@ -1,4 +1,19 @@
|
|
1
1
|
require "knock/engine"
|
2
2
|
|
3
3
|
module Knock
|
4
|
+
|
5
|
+
mattr_accessor :token_lifetime
|
6
|
+
self.token_lifetime = 1.day
|
7
|
+
|
8
|
+
mattr_accessor :token_audience
|
9
|
+
self.token_audience = nil
|
10
|
+
|
11
|
+
mattr_accessor :token_secret_signature_key
|
12
|
+
self.token_secret_signature_key = -> { Rails.application.secrets.secret_key_base }
|
13
|
+
|
14
|
+
# Default way to setup Knock. Run rails generate knock_install to create
|
15
|
+
# a fresh initializer with all configuration values.
|
16
|
+
def self.setup
|
17
|
+
yield self
|
18
|
+
end
|
4
19
|
end
|
data/lib/knock/version.rb
CHANGED
data/test/dummy/db/test.sqlite3
CHANGED
Binary file
|
File without changes
|
data/test/dummy/log/test.log
CHANGED
@@ -3037,3 +3037,668 @@ Processing by Knock::AuthTokenController#create as HTML
|
|
3037
3037
|
[1m[36mUser Load (0.0ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT 1[0m [["email", "one@example.net"]]
|
3038
3038
|
Completed 404 Not Found in 2ms (ActiveRecord: 0.0ms)
|
3039
3039
|
[1m[35m (0.1ms)[0m rollback transaction
|
3040
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.3ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
3041
|
+
[1m[35m (0.1ms)[0m begin transaction
|
3042
|
+
[1m[36mFixture Delete (0.6ms)[0m [1mDELETE FROM "users"[0m
|
3043
|
+
[1m[35mFixture Insert (0.4ms)[0m INSERT INTO "users" ("email", "password_digest", "created_at", "updated_at", "id") VALUES ('one@example.net', '$2a$04$Vh.dppWW2pQ48kP01lrdHuoMlT2HPDN0sDRv6f3Vya9CHaaLMbkvG', '2015-07-15 15:18:12', '2015-07-15 15:18:12', 980190962)
|
3044
|
+
[1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "users" ("email", "password_digest", "created_at", "updated_at", "id") VALUES ('two@example.net', '$2a$04$KRkMwj0qRbsiSSHeFH0M9OqV8ByqTzynVahzZVNUo4xR9RSqOcUqa', '2015-07-15 15:18:12', '2015-07-15 15:18:12', 298486374)[0m
|
3045
|
+
[1m[35m (0.7ms)[0m commit transaction
|
3046
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
3047
|
+
-----------------------------------------------------------------
|
3048
|
+
ProtectedResourcesControllerTest: test_responds_with_unauthorized
|
3049
|
+
-----------------------------------------------------------------
|
3050
|
+
Processing by ProtectedResourcesController#index as HTML
|
3051
|
+
Filter chain halted as :authenticate rendered or redirected
|
3052
|
+
Completed 401 Unauthorized in 0ms (ActiveRecord: 0.0ms)
|
3053
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
3054
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
3055
|
+
-----------------------------------------------------------------------------
|
3056
|
+
ProtectedResourcesControllerTest: test_responds_with_success_if_authenticated
|
3057
|
+
-----------------------------------------------------------------------------
|
3058
|
+
[1m[35mUser Load (0.2ms)[0m SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 980190962]]
|
3059
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
3060
|
+
[1m[35m (0.0ms)[0m begin transaction
|
3061
|
+
------------------------------------------------------------------------------
|
3062
|
+
ProtectedResourcesControllerTest: test_has_a_current_user_after_authentication
|
3063
|
+
------------------------------------------------------------------------------
|
3064
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1[0m [["id", 980190962]]
|
3065
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
3066
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
3067
|
+
-----------------------------------------------------------------------------
|
3068
|
+
Knock::AuthTokenControllerTest: test_responds_with_404_if_user_does_not_exist
|
3069
|
+
-----------------------------------------------------------------------------
|
3070
|
+
Processing by Knock::AuthTokenController#create as HTML
|
3071
|
+
Parameters: {"auth"=>{"email"=>"wrong@example.net", "password"=>"[FILTERED]"}}
|
3072
|
+
[1m[35mUser Load (0.1ms)[0m SELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT 1 [["email", "wrong@example.net"]]
|
3073
|
+
Completed 404 Not Found in 2ms (ActiveRecord: 0.1ms)
|
3074
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
3075
|
+
[1m[35m (0.0ms)[0m begin transaction
|
3076
|
+
------------------------------------------------------
|
3077
|
+
Knock::AuthTokenControllerTest: test_responds_with_201
|
3078
|
+
------------------------------------------------------
|
3079
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1[0m [["id", 980190962]]
|
3080
|
+
Processing by Knock::AuthTokenController#create as HTML
|
3081
|
+
Parameters: {"auth"=>{"email"=>"one@example.net", "password"=>"[FILTERED]"}}
|
3082
|
+
[1m[35mUser Load (0.0ms)[0m SELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT 1 [["email", "one@example.net"]]
|
3083
|
+
Completed 500 Internal Server Error in 2ms (ActiveRecord: 0.0ms)
|
3084
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
3085
|
+
[1m[35m (0.1ms)[0m begin transaction
|
3086
|
+
-----------------------------------------------------------------------------
|
3087
|
+
Knock::AuthTokenControllerTest: test_responds_with_404_if_password_is_invalid
|
3088
|
+
-----------------------------------------------------------------------------
|
3089
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1[0m [["id", 980190962]]
|
3090
|
+
Processing by Knock::AuthTokenController#create as HTML
|
3091
|
+
Parameters: {"auth"=>{"email"=>"one@example.net", "password"=>"[FILTERED]"}}
|
3092
|
+
[1m[35mUser Load (0.0ms)[0m SELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT 1 [["email", "one@example.net"]]
|
3093
|
+
Completed 404 Not Found in 2ms (ActiveRecord: 0.0ms)
|
3094
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
3095
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
3096
|
+
[1m[35m (0.1ms)[0m begin transaction
|
3097
|
+
[1m[36mFixture Delete (0.3ms)[0m [1mDELETE FROM "users"[0m
|
3098
|
+
[1m[35mFixture Insert (0.1ms)[0m INSERT INTO "users" ("email", "password_digest", "created_at", "updated_at", "id") VALUES ('one@example.net', '$2a$04$JA/c3tX2pzobkPi4aAUieOJ.B/TrkcodoPIWrUKSvcvfErhgG1PLy', '2015-07-15 15:22:16', '2015-07-15 15:22:16', 980190962)
|
3099
|
+
[1m[36mFixture Insert (0.0ms)[0m [1mINSERT INTO "users" ("email", "password_digest", "created_at", "updated_at", "id") VALUES ('two@example.net', '$2a$04$97PYmwJzgeb2f33/QMOdQ.p5GH/qrTDGgoQIzmWwnUi4duUgUW1xy', '2015-07-15 15:22:16', '2015-07-15 15:22:16', 298486374)[0m
|
3100
|
+
[1m[35m (1.4ms)[0m commit transaction
|
3101
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
3102
|
+
------------------------------------------------------
|
3103
|
+
Knock::AuthTokenControllerTest: test_responds_with_201
|
3104
|
+
------------------------------------------------------
|
3105
|
+
[1m[35mUser Load (0.2ms)[0m SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 980190962]]
|
3106
|
+
Processing by Knock::AuthTokenController#create as HTML
|
3107
|
+
Parameters: {"auth"=>{"email"=>"one@example.net", "password"=>"[FILTERED]"}}
|
3108
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT 1[0m [["email", "one@example.net"]]
|
3109
|
+
Completed 500 Internal Server Error in 5ms (ActiveRecord: 0.1ms)
|
3110
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
3111
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
3112
|
+
-----------------------------------------------------------------------------
|
3113
|
+
Knock::AuthTokenControllerTest: test_responds_with_404_if_password_is_invalid
|
3114
|
+
-----------------------------------------------------------------------------
|
3115
|
+
[1m[35mUser Load (0.1ms)[0m SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 980190962]]
|
3116
|
+
Processing by Knock::AuthTokenController#create as HTML
|
3117
|
+
Parameters: {"auth"=>{"email"=>"one@example.net", "password"=>"[FILTERED]"}}
|
3118
|
+
[1m[36mUser Load (0.0ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT 1[0m [["email", "one@example.net"]]
|
3119
|
+
Completed 404 Not Found in 2ms (ActiveRecord: 0.0ms)
|
3120
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
3121
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
3122
|
+
-----------------------------------------------------------------------------
|
3123
|
+
Knock::AuthTokenControllerTest: test_responds_with_404_if_user_does_not_exist
|
3124
|
+
-----------------------------------------------------------------------------
|
3125
|
+
Processing by Knock::AuthTokenController#create as HTML
|
3126
|
+
Parameters: {"auth"=>{"email"=>"wrong@example.net", "password"=>"[FILTERED]"}}
|
3127
|
+
[1m[35mUser Load (0.1ms)[0m SELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT 1 [["email", "wrong@example.net"]]
|
3128
|
+
Completed 404 Not Found in 0ms (ActiveRecord: 0.1ms)
|
3129
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
3130
|
+
[1m[35m (0.0ms)[0m begin transaction
|
3131
|
+
-----------------------------------------------------------------------------
|
3132
|
+
ProtectedResourcesControllerTest: test_responds_with_success_if_authenticated
|
3133
|
+
-----------------------------------------------------------------------------
|
3134
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1[0m [["id", 980190962]]
|
3135
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
3136
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
3137
|
+
------------------------------------------------------------------------------
|
3138
|
+
ProtectedResourcesControllerTest: test_has_a_current_user_after_authentication
|
3139
|
+
------------------------------------------------------------------------------
|
3140
|
+
[1m[35mUser Load (0.1ms)[0m SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 980190962]]
|
3141
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
3142
|
+
[1m[35m (0.1ms)[0m begin transaction
|
3143
|
+
-----------------------------------------------------------------
|
3144
|
+
ProtectedResourcesControllerTest: test_responds_with_unauthorized
|
3145
|
+
-----------------------------------------------------------------
|
3146
|
+
Processing by ProtectedResourcesController#index as HTML
|
3147
|
+
Filter chain halted as :authenticate rendered or redirected
|
3148
|
+
Completed 401 Unauthorized in 0ms (ActiveRecord: 0.0ms)
|
3149
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
3150
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
3151
|
+
[1m[35m (0.1ms)[0m begin transaction
|
3152
|
+
[1m[36mFixture Delete (0.2ms)[0m [1mDELETE FROM "users"[0m
|
3153
|
+
[1m[35mFixture Insert (0.1ms)[0m INSERT INTO "users" ("email", "password_digest", "created_at", "updated_at", "id") VALUES ('one@example.net', '$2a$04$Kn4Zr/SXViCsMoxESW1p9OlGqqoSmunb5fYYElgtScakdLV713k3a', '2015-07-15 15:22:51', '2015-07-15 15:22:51', 980190962)
|
3154
|
+
[1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "users" ("email", "password_digest", "created_at", "updated_at", "id") VALUES ('two@example.net', '$2a$04$c0mQYlFm3uH3.q4VFZ8H..gTkiLLBOV8KBWLFAsDtKV2uZkrfwvVO', '2015-07-15 15:22:51', '2015-07-15 15:22:51', 298486374)[0m
|
3155
|
+
[1m[35m (1.6ms)[0m commit transaction
|
3156
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
3157
|
+
-----------------------------------------------------------------------------
|
3158
|
+
Knock::AuthTokenControllerTest: test_responds_with_404_if_user_does_not_exist
|
3159
|
+
-----------------------------------------------------------------------------
|
3160
|
+
Processing by Knock::AuthTokenController#create as HTML
|
3161
|
+
Parameters: {"auth"=>{"email"=>"wrong@example.net", "password"=>"[FILTERED]"}}
|
3162
|
+
[1m[35mUser Load (0.4ms)[0m SELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT 1 [["email", "wrong@example.net"]]
|
3163
|
+
Completed 404 Not Found in 9ms (ActiveRecord: 0.4ms)
|
3164
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
3165
|
+
[1m[35m (0.1ms)[0m begin transaction
|
3166
|
+
-----------------------------------------------------------------------------
|
3167
|
+
Knock::AuthTokenControllerTest: test_responds_with_404_if_password_is_invalid
|
3168
|
+
-----------------------------------------------------------------------------
|
3169
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1[0m [["id", 980190962]]
|
3170
|
+
Processing by Knock::AuthTokenController#create as HTML
|
3171
|
+
Parameters: {"auth"=>{"email"=>"one@example.net", "password"=>"[FILTERED]"}}
|
3172
|
+
[1m[35mUser Load (0.1ms)[0m SELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT 1 [["email", "one@example.net"]]
|
3173
|
+
Completed 404 Not Found in 2ms (ActiveRecord: 0.1ms)
|
3174
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
3175
|
+
[1m[35m (0.1ms)[0m begin transaction
|
3176
|
+
------------------------------------------------------
|
3177
|
+
Knock::AuthTokenControllerTest: test_responds_with_201
|
3178
|
+
------------------------------------------------------
|
3179
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1[0m [["id", 980190962]]
|
3180
|
+
Processing by Knock::AuthTokenController#create as HTML
|
3181
|
+
Parameters: {"auth"=>{"email"=>"one@example.net", "password"=>"[FILTERED]"}}
|
3182
|
+
[1m[35mUser Load (0.0ms)[0m SELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT 1 [["email", "one@example.net"]]
|
3183
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT 1[0m [["email", "one@example.net"]]
|
3184
|
+
Completed 201 Created in 13ms (Views: 0.2ms | ActiveRecord: 0.1ms)
|
3185
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
3186
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
3187
|
+
------------------------------------------------------------------------------
|
3188
|
+
ProtectedResourcesControllerTest: test_has_a_current_user_after_authentication
|
3189
|
+
------------------------------------------------------------------------------
|
3190
|
+
[1m[35mUser Load (0.1ms)[0m SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 980190962]]
|
3191
|
+
Processing by ProtectedResourcesController#index as HTML
|
3192
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1[0m [["id", 980190962]]
|
3193
|
+
Completed 200 OK in 1ms (ActiveRecord: 0.1ms)
|
3194
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
3195
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
3196
|
+
-----------------------------------------------------------------
|
3197
|
+
ProtectedResourcesControllerTest: test_responds_with_unauthorized
|
3198
|
+
-----------------------------------------------------------------
|
3199
|
+
Processing by ProtectedResourcesController#index as HTML
|
3200
|
+
Filter chain halted as :authenticate rendered or redirected
|
3201
|
+
Completed 401 Unauthorized in 0ms (ActiveRecord: 0.0ms)
|
3202
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
3203
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
3204
|
+
-----------------------------------------------------------------------------
|
3205
|
+
ProtectedResourcesControllerTest: test_responds_with_success_if_authenticated
|
3206
|
+
-----------------------------------------------------------------------------
|
3207
|
+
[1m[35mUser Load (0.1ms)[0m SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 980190962]]
|
3208
|
+
Processing by ProtectedResourcesController#index as HTML
|
3209
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1[0m [["id", 980190962]]
|
3210
|
+
Completed 200 OK in 1ms (ActiveRecord: 0.1ms)
|
3211
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
3212
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
3213
|
+
[1m[35m (0.1ms)[0m begin transaction
|
3214
|
+
[1m[36mFixture Delete (0.3ms)[0m [1mDELETE FROM "users"[0m
|
3215
|
+
[1m[35mFixture Insert (0.1ms)[0m INSERT INTO "users" ("email", "password_digest", "created_at", "updated_at", "id") VALUES ('one@example.net', '$2a$04$lQ6dep8WROuC2WVuFMZNcu9haVkPTY.LPbJKnO.CZ47zwqrH0fYfm', '2015-07-15 15:25:07', '2015-07-15 15:25:07', 980190962)
|
3216
|
+
[1m[36mFixture Insert (0.0ms)[0m [1mINSERT INTO "users" ("email", "password_digest", "created_at", "updated_at", "id") VALUES ('two@example.net', '$2a$04$MRqP183P9yUjD5x8RQhjUOx6J7auUoBRJRfIfJBLTFCmEcG9UTKhO', '2015-07-15 15:25:07', '2015-07-15 15:25:07', 298486374)[0m
|
3217
|
+
[1m[35m (0.7ms)[0m commit transaction
|
3218
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
3219
|
+
------------------------------------------------------
|
3220
|
+
Knock::AuthTokenControllerTest: test_responds_with_201
|
3221
|
+
------------------------------------------------------
|
3222
|
+
[1m[35mUser Load (0.2ms)[0m SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 980190962]]
|
3223
|
+
Processing by Knock::AuthTokenController#create as HTML
|
3224
|
+
Parameters: {"auth"=>{"email"=>"one@example.net", "password"=>"[FILTERED]"}}
|
3225
|
+
[1m[36mUser Load (0.2ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT 1[0m [["email", "one@example.net"]]
|
3226
|
+
[1m[35mUser Load (0.1ms)[0m SELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT 1 [["email", "one@example.net"]]
|
3227
|
+
Completed 201 Created in 12ms (Views: 0.2ms | ActiveRecord: 0.3ms)
|
3228
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
3229
|
+
[1m[35m (0.1ms)[0m begin transaction
|
3230
|
+
-----------------------------------------------------------------------------
|
3231
|
+
Knock::AuthTokenControllerTest: test_responds_with_404_if_password_is_invalid
|
3232
|
+
-----------------------------------------------------------------------------
|
3233
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1[0m [["id", 980190962]]
|
3234
|
+
Processing by Knock::AuthTokenController#create as HTML
|
3235
|
+
Parameters: {"auth"=>{"email"=>"one@example.net", "password"=>"[FILTERED]"}}
|
3236
|
+
[1m[35mUser Load (0.0ms)[0m SELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT 1 [["email", "one@example.net"]]
|
3237
|
+
Completed 404 Not Found in 2ms (ActiveRecord: 0.0ms)
|
3238
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
3239
|
+
[1m[35m (0.0ms)[0m begin transaction
|
3240
|
+
-----------------------------------------------------------------------------
|
3241
|
+
Knock::AuthTokenControllerTest: test_responds_with_404_if_user_does_not_exist
|
3242
|
+
-----------------------------------------------------------------------------
|
3243
|
+
Processing by Knock::AuthTokenController#create as HTML
|
3244
|
+
Parameters: {"auth"=>{"email"=>"wrong@example.net", "password"=>"[FILTERED]"}}
|
3245
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT 1[0m [["email", "wrong@example.net"]]
|
3246
|
+
Completed 404 Not Found in 0ms (ActiveRecord: 0.1ms)
|
3247
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
3248
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
3249
|
+
-----------------------------------------------------------------
|
3250
|
+
ProtectedResourcesControllerTest: test_responds_with_unauthorized
|
3251
|
+
-----------------------------------------------------------------
|
3252
|
+
Processing by ProtectedResourcesController#index as HTML
|
3253
|
+
Filter chain halted as :authenticate rendered or redirected
|
3254
|
+
Completed 401 Unauthorized in 0ms (ActiveRecord: 0.0ms)
|
3255
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
3256
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
3257
|
+
-----------------------------------------------------------------------------
|
3258
|
+
ProtectedResourcesControllerTest: test_responds_with_success_if_authenticated
|
3259
|
+
-----------------------------------------------------------------------------
|
3260
|
+
[1m[35mUser Load (0.1ms)[0m SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 980190962]]
|
3261
|
+
Processing by ProtectedResourcesController#index as HTML
|
3262
|
+
[1m[36mUser Load (0.0ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1[0m [["id", 980190962]]
|
3263
|
+
Completed 200 OK in 1ms (ActiveRecord: 0.0ms)
|
3264
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
3265
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
3266
|
+
------------------------------------------------------------------------------
|
3267
|
+
ProtectedResourcesControllerTest: test_has_a_current_user_after_authentication
|
3268
|
+
------------------------------------------------------------------------------
|
3269
|
+
[1m[35mUser Load (0.1ms)[0m SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 980190962]]
|
3270
|
+
Processing by ProtectedResourcesController#index as HTML
|
3271
|
+
[1m[36mUser Load (0.0ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1[0m [["id", 980190962]]
|
3272
|
+
Completed 200 OK in 1ms (ActiveRecord: 0.0ms)
|
3273
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
3274
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.5ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
3275
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
3276
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
3277
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
3278
|
+
[1m[35m (0.1ms)[0m begin transaction
|
3279
|
+
[1m[36mFixture Delete (0.8ms)[0m [1mDELETE FROM "users"[0m
|
3280
|
+
[1m[35mFixture Insert (0.5ms)[0m INSERT INTO "users" ("email", "password_digest", "created_at", "updated_at", "id") VALUES ('one@example.net', '$2a$04$12chVEEM0IZUMTt6O2ynKOaFlfnfvBU/1i2zbgssze/RMcq6oFMPS', '2015-07-15 15:58:13', '2015-07-15 15:58:13', 980190962)
|
3281
|
+
[1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "users" ("email", "password_digest", "created_at", "updated_at", "id") VALUES ('two@example.net', '$2a$04$Ppavg2UpH39R7WuSrxjpku2z5m080vXfROtes0BYpWSFUo9V0Gi92', '2015-07-15 15:58:13', '2015-07-15 15:58:13', 298486374)[0m
|
3282
|
+
[1m[35m (0.9ms)[0m commit transaction
|
3283
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
3284
|
+
----------------------------------------------------------------
|
3285
|
+
InstallGeneratorTest: test_Assert_all_files_are_properly_created
|
3286
|
+
----------------------------------------------------------------
|
3287
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
3288
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
3289
|
+
[1m[35m (0.1ms)[0m begin transaction
|
3290
|
+
[1m[36mFixture Delete (0.3ms)[0m [1mDELETE FROM "users"[0m
|
3291
|
+
[1m[35mFixture Insert (0.1ms)[0m INSERT INTO "users" ("email", "password_digest", "created_at", "updated_at", "id") VALUES ('one@example.net', '$2a$04$jMqvvyPOfw.htkdb29BbZ.ozW4KCcDSyZRfooYXUBYW2W.Q0mSVs.', '2015-07-15 15:58:27', '2015-07-15 15:58:27', 980190962)
|
3292
|
+
[1m[36mFixture Insert (0.0ms)[0m [1mINSERT INTO "users" ("email", "password_digest", "created_at", "updated_at", "id") VALUES ('two@example.net', '$2a$04$e6lXwGBSU7QWwDL1D12V4.GXqhXWZU1sMSuWTDV44DxvCZqPMIrNu', '2015-07-15 15:58:27', '2015-07-15 15:58:27', 298486374)[0m
|
3293
|
+
[1m[35m (1.0ms)[0m commit transaction
|
3294
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
3295
|
+
------------------------------------------------------------------------------
|
3296
|
+
ProtectedResourcesControllerTest: test_has_a_current_user_after_authentication
|
3297
|
+
------------------------------------------------------------------------------
|
3298
|
+
[1m[35mUser Load (0.2ms)[0m SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 980190962]]
|
3299
|
+
Processing by ProtectedResourcesController#index as HTML
|
3300
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1[0m [["id", 980190962]]
|
3301
|
+
Completed 200 OK in 2ms (ActiveRecord: 0.1ms)
|
3302
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
3303
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
3304
|
+
-----------------------------------------------------------------
|
3305
|
+
ProtectedResourcesControllerTest: test_responds_with_unauthorized
|
3306
|
+
-----------------------------------------------------------------
|
3307
|
+
Processing by ProtectedResourcesController#index as HTML
|
3308
|
+
Filter chain halted as :authenticate rendered or redirected
|
3309
|
+
Completed 401 Unauthorized in 0ms (ActiveRecord: 0.0ms)
|
3310
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
3311
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
3312
|
+
-----------------------------------------------------------------------------
|
3313
|
+
ProtectedResourcesControllerTest: test_responds_with_success_if_authenticated
|
3314
|
+
-----------------------------------------------------------------------------
|
3315
|
+
[1m[35mUser Load (0.1ms)[0m SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 980190962]]
|
3316
|
+
Processing by ProtectedResourcesController#index as HTML
|
3317
|
+
[1m[36mUser Load (0.0ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1[0m [["id", 980190962]]
|
3318
|
+
Completed 200 OK in 0ms (ActiveRecord: 0.0ms)
|
3319
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
3320
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
3321
|
+
-----------------------------------------------------------------------------
|
3322
|
+
Knock::AuthTokenControllerTest: test_responds_with_404_if_password_is_invalid
|
3323
|
+
-----------------------------------------------------------------------------
|
3324
|
+
[1m[35mUser Load (0.1ms)[0m SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 980190962]]
|
3325
|
+
Processing by Knock::AuthTokenController#create as HTML
|
3326
|
+
Parameters: {"auth"=>{"email"=>"one@example.net", "password"=>"[FILTERED]"}}
|
3327
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT 1[0m [["email", "one@example.net"]]
|
3328
|
+
Completed 404 Not Found in 2ms (ActiveRecord: 0.1ms)
|
3329
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
3330
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
3331
|
+
-----------------------------------------------------------------------------
|
3332
|
+
Knock::AuthTokenControllerTest: test_responds_with_404_if_user_does_not_exist
|
3333
|
+
-----------------------------------------------------------------------------
|
3334
|
+
Processing by Knock::AuthTokenController#create as HTML
|
3335
|
+
Parameters: {"auth"=>{"email"=>"wrong@example.net", "password"=>"[FILTERED]"}}
|
3336
|
+
[1m[35mUser Load (0.1ms)[0m SELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT 1 [["email", "wrong@example.net"]]
|
3337
|
+
Completed 404 Not Found in 0ms (ActiveRecord: 0.1ms)
|
3338
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
3339
|
+
[1m[35m (0.0ms)[0m begin transaction
|
3340
|
+
------------------------------------------------------
|
3341
|
+
Knock::AuthTokenControllerTest: test_responds_with_201
|
3342
|
+
------------------------------------------------------
|
3343
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1[0m [["id", 980190962]]
|
3344
|
+
Processing by Knock::AuthTokenController#create as HTML
|
3345
|
+
Parameters: {"auth"=>{"email"=>"one@example.net", "password"=>"[FILTERED]"}}
|
3346
|
+
[1m[35mUser Load (0.0ms)[0m SELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT 1 [["email", "one@example.net"]]
|
3347
|
+
[1m[36mUser Load (0.0ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT 1[0m [["email", "one@example.net"]]
|
3348
|
+
Completed 201 Created in 2ms (Views: 0.1ms | ActiveRecord: 0.1ms)
|
3349
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
3350
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
3351
|
+
----------------------------------------------------------------
|
3352
|
+
InstallGeneratorTest: test_Assert_all_files_are_properly_created
|
3353
|
+
----------------------------------------------------------------
|
3354
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
3355
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
3356
|
+
[1m[35m (0.1ms)[0m begin transaction
|
3357
|
+
[1m[36mFixture Delete (0.2ms)[0m [1mDELETE FROM "users"[0m
|
3358
|
+
[1m[35mFixture Insert (0.1ms)[0m INSERT INTO "users" ("email", "password_digest", "created_at", "updated_at", "id") VALUES ('one@example.net', '$2a$04$Ze9d59FVmGT7IJwhGho9cewSEEkarQ1Jd0BNvshALz4cW7TPr3cNS', '2015-07-15 15:58:35', '2015-07-15 15:58:35', 980190962)
|
3359
|
+
[1m[36mFixture Insert (0.0ms)[0m [1mINSERT INTO "users" ("email", "password_digest", "created_at", "updated_at", "id") VALUES ('two@example.net', '$2a$04$9HsNAOfKKBNE8Gli.31H6Ob1Ots089NvBe0L1uzNkoo7Dz9dUAiTe', '2015-07-15 15:58:35', '2015-07-15 15:58:35', 298486374)[0m
|
3360
|
+
[1m[35m (1.5ms)[0m commit transaction
|
3361
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
3362
|
+
-----------------------------------------------------------------------------
|
3363
|
+
Knock::AuthTokenControllerTest: test_responds_with_404_if_user_does_not_exist
|
3364
|
+
-----------------------------------------------------------------------------
|
3365
|
+
Processing by Knock::AuthTokenController#create as HTML
|
3366
|
+
Parameters: {"auth"=>{"email"=>"wrong@example.net", "password"=>"[FILTERED]"}}
|
3367
|
+
[1m[35mUser Load (0.4ms)[0m SELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT 1 [["email", "wrong@example.net"]]
|
3368
|
+
Completed 404 Not Found in 18ms (ActiveRecord: 0.4ms)
|
3369
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
3370
|
+
[1m[35m (0.0ms)[0m begin transaction
|
3371
|
+
-----------------------------------------------------------------------------
|
3372
|
+
Knock::AuthTokenControllerTest: test_responds_with_404_if_password_is_invalid
|
3373
|
+
-----------------------------------------------------------------------------
|
3374
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1[0m [["id", 980190962]]
|
3375
|
+
Processing by Knock::AuthTokenController#create as HTML
|
3376
|
+
Parameters: {"auth"=>{"email"=>"one@example.net", "password"=>"[FILTERED]"}}
|
3377
|
+
[1m[35mUser Load (0.1ms)[0m SELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT 1 [["email", "one@example.net"]]
|
3378
|
+
Completed 404 Not Found in 2ms (ActiveRecord: 0.1ms)
|
3379
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
3380
|
+
[1m[35m (0.0ms)[0m begin transaction
|
3381
|
+
------------------------------------------------------
|
3382
|
+
Knock::AuthTokenControllerTest: test_responds_with_201
|
3383
|
+
------------------------------------------------------
|
3384
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1[0m [["id", 980190962]]
|
3385
|
+
Processing by Knock::AuthTokenController#create as HTML
|
3386
|
+
Parameters: {"auth"=>{"email"=>"one@example.net", "password"=>"[FILTERED]"}}
|
3387
|
+
[1m[35mUser Load (0.0ms)[0m SELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT 1 [["email", "one@example.net"]]
|
3388
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT 1[0m [["email", "one@example.net"]]
|
3389
|
+
Completed 201 Created in 7ms (Views: 0.2ms | ActiveRecord: 0.1ms)
|
3390
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
3391
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
3392
|
+
------------------------------------------------------------------------------
|
3393
|
+
ProtectedResourcesControllerTest: test_has_a_current_user_after_authentication
|
3394
|
+
------------------------------------------------------------------------------
|
3395
|
+
[1m[35mUser Load (0.1ms)[0m SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 980190962]]
|
3396
|
+
Processing by ProtectedResourcesController#index as HTML
|
3397
|
+
[1m[36mUser Load (0.0ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1[0m [["id", 980190962]]
|
3398
|
+
Completed 200 OK in 1ms (ActiveRecord: 0.0ms)
|
3399
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
3400
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
3401
|
+
-----------------------------------------------------------------------------
|
3402
|
+
ProtectedResourcesControllerTest: test_responds_with_success_if_authenticated
|
3403
|
+
-----------------------------------------------------------------------------
|
3404
|
+
[1m[35mUser Load (0.1ms)[0m SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 980190962]]
|
3405
|
+
Processing by ProtectedResourcesController#index as HTML
|
3406
|
+
[1m[36mUser Load (0.0ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1[0m [["id", 980190962]]
|
3407
|
+
Completed 200 OK in 0ms (ActiveRecord: 0.0ms)
|
3408
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
3409
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
3410
|
+
-----------------------------------------------------------------
|
3411
|
+
ProtectedResourcesControllerTest: test_responds_with_unauthorized
|
3412
|
+
-----------------------------------------------------------------
|
3413
|
+
Processing by ProtectedResourcesController#index as HTML
|
3414
|
+
Filter chain halted as :authenticate rendered or redirected
|
3415
|
+
Completed 401 Unauthorized in 0ms (ActiveRecord: 0.0ms)
|
3416
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
3417
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
3418
|
+
----------------------------------------------------------------
|
3419
|
+
InstallGeneratorTest: test_Assert_all_files_are_properly_created
|
3420
|
+
----------------------------------------------------------------
|
3421
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
3422
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.5ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
3423
|
+
[1m[35m (0.1ms)[0m begin transaction
|
3424
|
+
[1m[36mFixture Delete (0.9ms)[0m [1mDELETE FROM "users"[0m
|
3425
|
+
[1m[35mFixture Insert (0.5ms)[0m INSERT INTO "users" ("email", "password_digest", "created_at", "updated_at", "id") VALUES ('one@example.net', '$2a$04$VfCCl/ZVmwkH2QEebT/zUu36PwSNQwCL04UCSXU1fijFnGgU9HfnS', '2015-07-15 16:12:21', '2015-07-15 16:12:21', 980190962)
|
3426
|
+
[1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "users" ("email", "password_digest", "created_at", "updated_at", "id") VALUES ('two@example.net', '$2a$04$MPBCItViZiI7sB2vL7ZrbexzWVQaxxIOOe0Z6083Ycq3ebsZ8vUrS', '2015-07-15 16:12:21', '2015-07-15 16:12:21', 298486374)[0m
|
3427
|
+
[1m[35m (0.7ms)[0m commit transaction
|
3428
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
3429
|
+
------------------------------------------------------------------------------
|
3430
|
+
ProtectedResourcesControllerTest: test_has_a_current_user_after_authentication
|
3431
|
+
------------------------------------------------------------------------------
|
3432
|
+
[1m[35mUser Load (0.2ms)[0m SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 980190962]]
|
3433
|
+
Processing by ProtectedResourcesController#index as HTML
|
3434
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1[0m [["id", 980190962]]
|
3435
|
+
Completed 200 OK in 2ms (ActiveRecord: 0.1ms)
|
3436
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
3437
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
3438
|
+
-----------------------------------------------------------------
|
3439
|
+
ProtectedResourcesControllerTest: test_responds_with_unauthorized
|
3440
|
+
-----------------------------------------------------------------
|
3441
|
+
Processing by ProtectedResourcesController#index as HTML
|
3442
|
+
Filter chain halted as :authenticate rendered or redirected
|
3443
|
+
Completed 401 Unauthorized in 0ms (ActiveRecord: 0.0ms)
|
3444
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
3445
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
3446
|
+
-----------------------------------------------------------------------------
|
3447
|
+
ProtectedResourcesControllerTest: test_responds_with_success_if_authenticated
|
3448
|
+
-----------------------------------------------------------------------------
|
3449
|
+
[1m[35mUser Load (0.1ms)[0m SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 980190962]]
|
3450
|
+
Processing by ProtectedResourcesController#index as HTML
|
3451
|
+
[1m[36mUser Load (0.0ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1[0m [["id", 980190962]]
|
3452
|
+
Completed 200 OK in 0ms (ActiveRecord: 0.0ms)
|
3453
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
3454
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
3455
|
+
----------------------------------------------------------------
|
3456
|
+
InstallGeneratorTest: test_Assert_all_files_are_properly_created
|
3457
|
+
----------------------------------------------------------------
|
3458
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
3459
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
3460
|
+
------------------------------------------------------
|
3461
|
+
Knock::AuthTokenControllerTest: test_responds_with_201
|
3462
|
+
------------------------------------------------------
|
3463
|
+
[1m[35mUser Load (0.1ms)[0m SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 980190962]]
|
3464
|
+
Processing by Knock::AuthTokenController#create as HTML
|
3465
|
+
Parameters: {"auth"=>{"email"=>"one@example.net", "password"=>"[FILTERED]"}}
|
3466
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT 1[0m [["email", "one@example.net"]]
|
3467
|
+
[1m[35mUser Load (0.0ms)[0m SELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT 1 [["email", "one@example.net"]]
|
3468
|
+
Completed 201 Created in 3ms (Views: 0.1ms | ActiveRecord: 0.2ms)
|
3469
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
3470
|
+
[1m[35m (0.0ms)[0m begin transaction
|
3471
|
+
-----------------------------------------------------------------------------
|
3472
|
+
Knock::AuthTokenControllerTest: test_responds_with_404_if_password_is_invalid
|
3473
|
+
-----------------------------------------------------------------------------
|
3474
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1[0m [["id", 980190962]]
|
3475
|
+
Processing by Knock::AuthTokenController#create as HTML
|
3476
|
+
Parameters: {"auth"=>{"email"=>"one@example.net", "password"=>"[FILTERED]"}}
|
3477
|
+
[1m[35mUser Load (0.0ms)[0m SELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT 1 [["email", "one@example.net"]]
|
3478
|
+
Completed 404 Not Found in 2ms (ActiveRecord: 0.0ms)
|
3479
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
3480
|
+
[1m[35m (0.1ms)[0m begin transaction
|
3481
|
+
-----------------------------------------------------------------------------
|
3482
|
+
Knock::AuthTokenControllerTest: test_responds_with_404_if_user_does_not_exist
|
3483
|
+
-----------------------------------------------------------------------------
|
3484
|
+
Processing by Knock::AuthTokenController#create as HTML
|
3485
|
+
Parameters: {"auth"=>{"email"=>"wrong@example.net", "password"=>"[FILTERED]"}}
|
3486
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT 1[0m [["email", "wrong@example.net"]]
|
3487
|
+
Completed 404 Not Found in 0ms (ActiveRecord: 0.1ms)
|
3488
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
3489
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
3490
|
+
[1m[35m (0.1ms)[0m begin transaction
|
3491
|
+
[1m[36mFixture Delete (0.2ms)[0m [1mDELETE FROM "users"[0m
|
3492
|
+
[1m[35mFixture Insert (0.1ms)[0m INSERT INTO "users" ("email", "password_digest", "created_at", "updated_at", "id") VALUES ('one@example.net', '$2a$04$ECm2Ev8zjCnTUd.JW5IkVuwZAIwjsT9xRHZyMn7zJujBml9gsMYxO', '2015-07-15 16:13:45', '2015-07-15 16:13:45', 980190962)
|
3493
|
+
[1m[36mFixture Insert (0.0ms)[0m [1mINSERT INTO "users" ("email", "password_digest", "created_at", "updated_at", "id") VALUES ('two@example.net', '$2a$04$R/zDQvaVJ9FdXygihgMLUur1Yhzk0pmkz7qf4nvExEjbmpGF01yhu', '2015-07-15 16:13:45', '2015-07-15 16:13:45', 298486374)[0m
|
3494
|
+
[1m[35m (1.5ms)[0m commit transaction
|
3495
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
3496
|
+
------------------------------------------------------------------------------
|
3497
|
+
ProtectedResourcesControllerTest: test_has_a_current_user_after_authentication
|
3498
|
+
------------------------------------------------------------------------------
|
3499
|
+
[1m[35mUser Load (0.2ms)[0m SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 980190962]]
|
3500
|
+
Processing by ProtectedResourcesController#index as HTML
|
3501
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1[0m [["id", 980190962]]
|
3502
|
+
Completed 200 OK in 2ms (ActiveRecord: 0.1ms)
|
3503
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
3504
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
3505
|
+
-----------------------------------------------------------------
|
3506
|
+
ProtectedResourcesControllerTest: test_responds_with_unauthorized
|
3507
|
+
-----------------------------------------------------------------
|
3508
|
+
Processing by ProtectedResourcesController#index as HTML
|
3509
|
+
Filter chain halted as :authenticate rendered or redirected
|
3510
|
+
Completed 401 Unauthorized in 0ms (ActiveRecord: 0.0ms)
|
3511
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
3512
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
3513
|
+
-----------------------------------------------------------------------------
|
3514
|
+
ProtectedResourcesControllerTest: test_responds_with_success_if_authenticated
|
3515
|
+
-----------------------------------------------------------------------------
|
3516
|
+
[1m[35mUser Load (0.1ms)[0m SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 980190962]]
|
3517
|
+
Processing by ProtectedResourcesController#index as HTML
|
3518
|
+
[1m[36mUser Load (0.0ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1[0m [["id", 980190962]]
|
3519
|
+
Completed 200 OK in 0ms (ActiveRecord: 0.0ms)
|
3520
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
3521
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
3522
|
+
-----------------------------------------------------------------------------
|
3523
|
+
Knock::AuthTokenControllerTest: test_responds_with_404_if_user_does_not_exist
|
3524
|
+
-----------------------------------------------------------------------------
|
3525
|
+
Processing by Knock::AuthTokenController#create as HTML
|
3526
|
+
Parameters: {"auth"=>{"email"=>"wrong@example.net", "password"=>"[FILTERED]"}}
|
3527
|
+
[1m[35mUser Load (0.1ms)[0m SELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT 1 [["email", "wrong@example.net"]]
|
3528
|
+
Completed 404 Not Found in 1ms (ActiveRecord: 0.1ms)
|
3529
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
3530
|
+
[1m[35m (0.1ms)[0m begin transaction
|
3531
|
+
------------------------------------------------------
|
3532
|
+
Knock::AuthTokenControllerTest: test_responds_with_201
|
3533
|
+
------------------------------------------------------
|
3534
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1[0m [["id", 980190962]]
|
3535
|
+
Processing by Knock::AuthTokenController#create as HTML
|
3536
|
+
Parameters: {"auth"=>{"email"=>"one@example.net", "password"=>"[FILTERED]"}}
|
3537
|
+
[1m[35mUser Load (0.0ms)[0m SELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT 1 [["email", "one@example.net"]]
|
3538
|
+
[1m[36mUser Load (0.0ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT 1[0m [["email", "one@example.net"]]
|
3539
|
+
Completed 201 Created in 2ms (Views: 0.1ms | ActiveRecord: 0.1ms)
|
3540
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
3541
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
3542
|
+
-----------------------------------------------------------------------------
|
3543
|
+
Knock::AuthTokenControllerTest: test_responds_with_404_if_password_is_invalid
|
3544
|
+
-----------------------------------------------------------------------------
|
3545
|
+
[1m[35mUser Load (0.1ms)[0m SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 980190962]]
|
3546
|
+
Processing by Knock::AuthTokenController#create as HTML
|
3547
|
+
Parameters: {"auth"=>{"email"=>"one@example.net", "password"=>"[FILTERED]"}}
|
3548
|
+
[1m[36mUser Load (0.0ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT 1[0m [["email", "one@example.net"]]
|
3549
|
+
Completed 404 Not Found in 2ms (ActiveRecord: 0.0ms)
|
3550
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
3551
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
3552
|
+
----------------------------------------------------------------
|
3553
|
+
InstallGeneratorTest: test_Assert_all_files_are_properly_created
|
3554
|
+
----------------------------------------------------------------
|
3555
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
3556
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
3557
|
+
---------------------------------------
|
3558
|
+
KnockTest: test_setup_block_yields_self
|
3559
|
+
---------------------------------------
|
3560
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
3561
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
3562
|
+
[1m[35m (0.1ms)[0m begin transaction
|
3563
|
+
[1m[36mFixture Delete (0.2ms)[0m [1mDELETE FROM "users"[0m
|
3564
|
+
[1m[35mFixture Insert (0.1ms)[0m INSERT INTO "users" ("email", "password_digest", "created_at", "updated_at", "id") VALUES ('one@example.net', '$2a$04$ffjkG5TRoEGvTxub2Wv9Oea3R9yD.ZLLdk3Vx4ixdlE7jyqwz9bFW', '2015-07-15 16:14:05', '2015-07-15 16:14:05', 980190962)
|
3565
|
+
[1m[36mFixture Insert (0.0ms)[0m [1mINSERT INTO "users" ("email", "password_digest", "created_at", "updated_at", "id") VALUES ('two@example.net', '$2a$04$8AauzQEzp6ui7FyTlftZHOWsLinabqlYp4.7B.y.MPx1oj5nYFl/6', '2015-07-15 16:14:05', '2015-07-15 16:14:05', 298486374)[0m
|
3566
|
+
[1m[35m (1.5ms)[0m commit transaction
|
3567
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
3568
|
+
------------------------------------------------------------------------------
|
3569
|
+
ProtectedResourcesControllerTest: test_has_a_current_user_after_authentication
|
3570
|
+
------------------------------------------------------------------------------
|
3571
|
+
[1m[35mUser Load (0.2ms)[0m SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 980190962]]
|
3572
|
+
Processing by ProtectedResourcesController#index as HTML
|
3573
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1[0m [["id", 980190962]]
|
3574
|
+
Completed 200 OK in 2ms (ActiveRecord: 0.1ms)
|
3575
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
3576
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
3577
|
+
-----------------------------------------------------------------
|
3578
|
+
ProtectedResourcesControllerTest: test_responds_with_unauthorized
|
3579
|
+
-----------------------------------------------------------------
|
3580
|
+
Processing by ProtectedResourcesController#index as HTML
|
3581
|
+
Filter chain halted as :authenticate rendered or redirected
|
3582
|
+
Completed 401 Unauthorized in 0ms (ActiveRecord: 0.0ms)
|
3583
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
3584
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
3585
|
+
-----------------------------------------------------------------------------
|
3586
|
+
ProtectedResourcesControllerTest: test_responds_with_success_if_authenticated
|
3587
|
+
-----------------------------------------------------------------------------
|
3588
|
+
[1m[35mUser Load (0.1ms)[0m SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 980190962]]
|
3589
|
+
Processing by ProtectedResourcesController#index as HTML
|
3590
|
+
[1m[36mUser Load (0.0ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1[0m [["id", 980190962]]
|
3591
|
+
Completed 200 OK in 0ms (ActiveRecord: 0.0ms)
|
3592
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
3593
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
3594
|
+
----------------------------------------------------------------
|
3595
|
+
InstallGeneratorTest: test_Assert_all_files_are_properly_created
|
3596
|
+
----------------------------------------------------------------
|
3597
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
3598
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
3599
|
+
-----------------------------------------------------------------------------
|
3600
|
+
Knock::AuthTokenControllerTest: test_responds_with_404_if_user_does_not_exist
|
3601
|
+
-----------------------------------------------------------------------------
|
3602
|
+
Processing by Knock::AuthTokenController#create as HTML
|
3603
|
+
Parameters: {"auth"=>{"email"=>"wrong@example.net", "password"=>"[FILTERED]"}}
|
3604
|
+
[1m[35mUser Load (0.1ms)[0m SELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT 1 [["email", "wrong@example.net"]]
|
3605
|
+
Completed 404 Not Found in 1ms (ActiveRecord: 0.1ms)
|
3606
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
3607
|
+
[1m[35m (0.1ms)[0m begin transaction
|
3608
|
+
-----------------------------------------------------------------------------
|
3609
|
+
Knock::AuthTokenControllerTest: test_responds_with_404_if_password_is_invalid
|
3610
|
+
-----------------------------------------------------------------------------
|
3611
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1[0m [["id", 980190962]]
|
3612
|
+
Processing by Knock::AuthTokenController#create as HTML
|
3613
|
+
Parameters: {"auth"=>{"email"=>"one@example.net", "password"=>"[FILTERED]"}}
|
3614
|
+
[1m[35mUser Load (0.0ms)[0m SELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT 1 [["email", "one@example.net"]]
|
3615
|
+
Completed 404 Not Found in 2ms (ActiveRecord: 0.0ms)
|
3616
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
3617
|
+
[1m[35m (0.1ms)[0m begin transaction
|
3618
|
+
------------------------------------------------------
|
3619
|
+
Knock::AuthTokenControllerTest: test_responds_with_201
|
3620
|
+
------------------------------------------------------
|
3621
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1[0m [["id", 980190962]]
|
3622
|
+
Processing by Knock::AuthTokenController#create as HTML
|
3623
|
+
Parameters: {"auth"=>{"email"=>"one@example.net", "password"=>"[FILTERED]"}}
|
3624
|
+
[1m[35mUser Load (0.0ms)[0m SELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT 1 [["email", "one@example.net"]]
|
3625
|
+
[1m[36mUser Load (0.0ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT 1[0m [["email", "one@example.net"]]
|
3626
|
+
Completed 201 Created in 2ms (Views: 0.1ms | ActiveRecord: 0.1ms)
|
3627
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
3628
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
3629
|
+
---------------------------------------
|
3630
|
+
KnockTest: test_setup_block_yields_self
|
3631
|
+
---------------------------------------
|
3632
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
3633
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.4ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
3634
|
+
[1m[35m (0.1ms)[0m begin transaction
|
3635
|
+
[1m[36mFixture Delete (0.6ms)[0m [1mDELETE FROM "users"[0m
|
3636
|
+
[1m[35mFixture Insert (0.4ms)[0m INSERT INTO "users" ("email", "password_digest", "created_at", "updated_at", "id") VALUES ('one@example.net', '$2a$04$78Z5Pym6JBqYpiexQCKW1u0kr2qFmvgH8iNTL5OgKpyWkx/EPCO7u', '2015-07-15 16:39:22', '2015-07-15 16:39:22', 980190962)
|
3637
|
+
[1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "users" ("email", "password_digest", "created_at", "updated_at", "id") VALUES ('two@example.net', '$2a$04$0127htT2TiZ.yQNMnbXv5e7nnlwsfLpKgo.mHpQlZT4zHB3oRYnRG', '2015-07-15 16:39:22', '2015-07-15 16:39:22', 298486374)[0m
|
3638
|
+
[1m[35m (0.7ms)[0m commit transaction
|
3639
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
3640
|
+
------------------------------------------------------------------------------
|
3641
|
+
ProtectedResourcesControllerTest: test_has_a_current_user_after_authentication
|
3642
|
+
------------------------------------------------------------------------------
|
3643
|
+
[1m[35mUser Load (0.2ms)[0m SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 980190962]]
|
3644
|
+
Processing by ProtectedResourcesController#index as HTML
|
3645
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1[0m [["id", 980190962]]
|
3646
|
+
Completed 200 OK in 3ms (ActiveRecord: 0.1ms)
|
3647
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
3648
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
3649
|
+
-----------------------------------------------------------------
|
3650
|
+
ProtectedResourcesControllerTest: test_responds_with_unauthorized
|
3651
|
+
-----------------------------------------------------------------
|
3652
|
+
Processing by ProtectedResourcesController#index as HTML
|
3653
|
+
Filter chain halted as :authenticate rendered or redirected
|
3654
|
+
Completed 401 Unauthorized in 0ms (ActiveRecord: 0.0ms)
|
3655
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
3656
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
3657
|
+
-----------------------------------------------------------------------------
|
3658
|
+
ProtectedResourcesControllerTest: test_responds_with_success_if_authenticated
|
3659
|
+
-----------------------------------------------------------------------------
|
3660
|
+
[1m[35mUser Load (0.1ms)[0m SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 980190962]]
|
3661
|
+
Processing by ProtectedResourcesController#index as HTML
|
3662
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1[0m [["id", 980190962]]
|
3663
|
+
Completed 200 OK in 0ms (ActiveRecord: 0.1ms)
|
3664
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
3665
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
3666
|
+
-----------------------------------------------------------------------------
|
3667
|
+
Knock::AuthTokenControllerTest: test_responds_with_404_if_user_does_not_exist
|
3668
|
+
-----------------------------------------------------------------------------
|
3669
|
+
Processing by Knock::AuthTokenController#create as HTML
|
3670
|
+
Parameters: {"auth"=>{"email"=>"wrong@example.net", "password"=>"[FILTERED]"}}
|
3671
|
+
[1m[35mUser Load (0.1ms)[0m SELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT 1 [["email", "wrong@example.net"]]
|
3672
|
+
Completed 404 Not Found in 1ms (ActiveRecord: 0.1ms)
|
3673
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
3674
|
+
[1m[35m (0.1ms)[0m begin transaction
|
3675
|
+
-----------------------------------------------------------------------------
|
3676
|
+
Knock::AuthTokenControllerTest: test_responds_with_404_if_password_is_invalid
|
3677
|
+
-----------------------------------------------------------------------------
|
3678
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1[0m [["id", 980190962]]
|
3679
|
+
Processing by Knock::AuthTokenController#create as HTML
|
3680
|
+
Parameters: {"auth"=>{"email"=>"one@example.net", "password"=>"[FILTERED]"}}
|
3681
|
+
[1m[35mUser Load (0.0ms)[0m SELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT 1 [["email", "one@example.net"]]
|
3682
|
+
Completed 404 Not Found in 2ms (ActiveRecord: 0.0ms)
|
3683
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
3684
|
+
[1m[35m (0.0ms)[0m begin transaction
|
3685
|
+
------------------------------------------------------
|
3686
|
+
Knock::AuthTokenControllerTest: test_responds_with_201
|
3687
|
+
------------------------------------------------------
|
3688
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1[0m [["id", 980190962]]
|
3689
|
+
Processing by Knock::AuthTokenController#create as HTML
|
3690
|
+
Parameters: {"auth"=>{"email"=>"one@example.net", "password"=>"[FILTERED]"}}
|
3691
|
+
[1m[35mUser Load (0.0ms)[0m SELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT 1 [["email", "one@example.net"]]
|
3692
|
+
[1m[36mUser Load (0.0ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT 1[0m [["email", "one@example.net"]]
|
3693
|
+
Completed 201 Created in 2ms (Views: 0.1ms | ActiveRecord: 0.1ms)
|
3694
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
3695
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
3696
|
+
---------------------------------------
|
3697
|
+
KnockTest: test_setup_block_yields_self
|
3698
|
+
---------------------------------------
|
3699
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
3700
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
3701
|
+
----------------------------------------------------------------
|
3702
|
+
InstallGeneratorTest: test_Assert_all_files_are_properly_created
|
3703
|
+
----------------------------------------------------------------
|
3704
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
@@ -0,0 +1,12 @@
|
|
1
|
+
require "test_helper"
|
2
|
+
|
3
|
+
class InstallGeneratorTest < Rails::Generators::TestCase
|
4
|
+
tests Knock::InstallGenerator
|
5
|
+
destination File.expand_path("../tmp", File.dirname(__FILE__))
|
6
|
+
setup :prepare_destination
|
7
|
+
|
8
|
+
test "Assert all files are properly created" do
|
9
|
+
run_generator
|
10
|
+
assert_file "config/initializers/knock.rb"
|
11
|
+
end
|
12
|
+
end
|
data/test/knock_test.rb
CHANGED
@@ -0,0 +1,36 @@
|
|
1
|
+
Knock.setup do |config|
|
2
|
+
|
3
|
+
## Expiration claim
|
4
|
+
## ----------------
|
5
|
+
##
|
6
|
+
## How long before a token is expired.
|
7
|
+
##
|
8
|
+
## Default:
|
9
|
+
# config.token_lifetime = 1.day
|
10
|
+
|
11
|
+
|
12
|
+
## Audience claim
|
13
|
+
## --------------
|
14
|
+
##
|
15
|
+
## Configure the audience claim to indentify the recipients that the token
|
16
|
+
## is intended for.
|
17
|
+
##
|
18
|
+
## Default:
|
19
|
+
# config.token_audience = nil
|
20
|
+
|
21
|
+
## If using Auth0, uncomment the line below
|
22
|
+
# config.token_audience = -> { Rails.application.secrets.auth0_client_id }
|
23
|
+
|
24
|
+
|
25
|
+
## Signature key
|
26
|
+
## -------------
|
27
|
+
##
|
28
|
+
## Configure the key used to sign tokens.
|
29
|
+
##
|
30
|
+
## Default:
|
31
|
+
# config.token_secret_signature_key = -> { Rails.application.secrets.secret_key_base }
|
32
|
+
|
33
|
+
## If using Auth0, uncomment the line below
|
34
|
+
# config.token_secret_signature_key = -> { Rails.application.secrets.auth0_client_secret }
|
35
|
+
|
36
|
+
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.0.
|
4
|
+
version: 1.1.0.rc1
|
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: 2015-07-
|
12
|
+
date: 2015-07-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -80,6 +80,8 @@ files:
|
|
80
80
|
- app/controllers/knock/auth_token_controller.rb
|
81
81
|
- app/model/knock/auth_token.rb
|
82
82
|
- config/routes.rb
|
83
|
+
- lib/generators/knock/install_generator.rb
|
84
|
+
- lib/generators/templates/knock.rb
|
83
85
|
- lib/knock.rb
|
84
86
|
- lib/knock/authenticable.rb
|
85
87
|
- lib/knock/engine.rb
|
@@ -121,6 +123,7 @@ files:
|
|
121
123
|
- test/dummy/db/migrate/20150713101607_create_users.rb
|
122
124
|
- test/dummy/db/schema.rb
|
123
125
|
- test/dummy/db/test.sqlite3
|
126
|
+
- test/dummy/log/development.log
|
124
127
|
- test/dummy/log/test.log
|
125
128
|
- test/dummy/public/404.html
|
126
129
|
- test/dummy/public/422.html
|
@@ -130,8 +133,10 @@ files:
|
|
130
133
|
- test/dummy/test/fixtures/users.yml
|
131
134
|
- test/dummy/test/models/user_test.rb
|
132
135
|
- test/fixtures/users.yml
|
136
|
+
- test/generators/install_generator_test.rb
|
133
137
|
- test/knock_test.rb
|
134
138
|
- test/test_helper.rb
|
139
|
+
- test/tmp/config/initializers/knock.rb
|
135
140
|
homepage: https://github.com/nsarno/knock
|
136
141
|
licenses:
|
137
142
|
- MIT
|
@@ -147,9 +152,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
147
152
|
version: '0'
|
148
153
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
149
154
|
requirements:
|
150
|
-
- - "
|
155
|
+
- - ">"
|
151
156
|
- !ruby/object:Gem::Version
|
152
|
-
version:
|
157
|
+
version: 1.3.1
|
153
158
|
requirements: []
|
154
159
|
rubyforge_project:
|
155
160
|
rubygems_version: 2.4.4
|
@@ -191,6 +196,7 @@ test_files:
|
|
191
196
|
- test/dummy/db/migrate/20150713101607_create_users.rb
|
192
197
|
- test/dummy/db/schema.rb
|
193
198
|
- test/dummy/db/test.sqlite3
|
199
|
+
- test/dummy/log/development.log
|
194
200
|
- test/dummy/log/test.log
|
195
201
|
- test/dummy/public/404.html
|
196
202
|
- test/dummy/public/422.html
|
@@ -202,5 +208,7 @@ test_files:
|
|
202
208
|
- test/dummy/test/fixtures/users.yml
|
203
209
|
- test/dummy/test/models/user_test.rb
|
204
210
|
- test/fixtures/users.yml
|
211
|
+
- test/generators/install_generator_test.rb
|
205
212
|
- test/knock_test.rb
|
206
213
|
- test/test_helper.rb
|
214
|
+
- test/tmp/config/initializers/knock.rb
|