clearance_http_auth 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
@@ -7,11 +7,11 @@ module Clearance
|
|
7
7
|
#
|
8
8
|
module CurrentUserOverride
|
9
9
|
|
10
|
-
#
|
10
|
+
# Returns user authenticated from HTTP Auth or cookie
|
11
11
|
#
|
12
12
|
# @return [User, nil]
|
13
13
|
def current_user
|
14
|
-
(env['clearance.current_user'] rescue nil) || @_current_user
|
14
|
+
(env['clearance.current_user'] rescue nil) || (@_current_user ||= user_from_cookie)
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
data/test/dummy/log/test.log
CHANGED
@@ -9557,3 +9557,130 @@ Started GET "/" for 127.0.0.1 at Mon Jan 10 23:15:56 +0100 2011
|
|
9557
9557
|
#<User id: 1, email: "test@example.com", encrypted_password: "86a47619327e652b97e11d2644737e4f0b17bf17", salt: "7fe07f1f882e4f184b03b6ea49ae4d114b224925", confirmation_token: "7c338fff176c3809d8c678f96534bb5da20c5010", remember_token: "108007178bcb8cf8f949168e40bda18d4aa99350", email_confirmed: true, created_at: "2011-01-10 22:15:56", updated_at: "2011-01-10 22:15:56">
|
9558
9558
|
Rendered text template (0.0ms)
|
9559
9559
|
Completed 200 OK in 3ms (Views: 0.5ms | ActiveRecord: 0.5ms)
|
9560
|
+
[1m[36mSQL (1.1ms)[0m [1m SELECT name
|
9561
|
+
FROM sqlite_master
|
9562
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
9563
|
+
[0m
|
9564
|
+
[1m[35mSQL (0.2ms)[0m SELECT name
|
9565
|
+
FROM sqlite_master
|
9566
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
9567
|
+
[1m[36mSQL (0.1ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations"[0m
|
9568
|
+
Migrating to ClearanceCreateUsers (20101221153914)
|
9569
|
+
[1m[35mUser Load (0.6ms)[0m SELECT "users"."id" FROM "users" WHERE (LOWER("users"."email") = LOWER('test@example.com')) LIMIT 1
|
9570
|
+
[1m[36mAREL (4.4ms)[0m [1mINSERT INTO "users" ("email_confirmed", "email", "created_at", "salt", "confirmation_token", "remember_token", "updated_at", "encrypted_password") VALUES ('t', 'test@example.com', '2011-03-12 16:15:58.459989', '807bedde3c3849cd711dc9b45b6241fceee06f1d', '249f557d736a45a8782cf0ccd1f15e958591594a', '3317798e1845440fce479212b8b75658be06e789', '2011-03-12 16:15:58.459989', 'a49e6cc3dea19fc1681b58d3c7f03e5b29bc2d45')[0m
|
9571
|
+
|
9572
|
+
|
9573
|
+
Started GET "/entrances.json" for 127.0.0.1 at Sat Mar 12 17:15:58 +0100 2011
|
9574
|
+
[1m[35mUser Load (0.3ms)[0m SELECT "users".* FROM "users" WHERE ("users"."email" = 'test@example.com') LIMIT 1
|
9575
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users"."id" FROM "users" WHERE (LOWER("users"."email") = LOWER('test@example.com')) LIMIT 1[0m
|
9576
|
+
[1m[35mAREL (0.4ms)[0m INSERT INTO "users" ("email_confirmed", "email", "created_at", "salt", "confirmation_token", "remember_token", "updated_at", "encrypted_password") VALUES ('t', 'test@example.com', '2011-03-12 16:15:58.495978', '624bf518c38bf88bd048674b6435e9fdcf014e4c', '3d54584b20f7c0de946abff213a8e1fad109de77', 'dd41eb11c3922059fac1c52272d957a5ba68dd22', '2011-03-12 16:15:58.495978', '361921b8c3983ab1410e198a42cea07939bb3594')
|
9577
|
+
|
9578
|
+
|
9579
|
+
Started GET "/entrances.json" for 127.0.0.1 at Sat Mar 12 17:15:58 +0100 2011
|
9580
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users"."id" FROM "users" WHERE (LOWER("users"."email") = LOWER('test@example.com')) LIMIT 1[0m
|
9581
|
+
[1m[35mAREL (0.4ms)[0m INSERT INTO "users" ("email_confirmed", "email", "created_at", "salt", "confirmation_token", "remember_token", "updated_at", "encrypted_password") VALUES ('t', 'test@example.com', '2011-03-12 16:15:58.502571', '847e56ca59f4e441a64163c4010d7abd8ee369a7', '3184aec80b72dea609d837b8b3fde43ec14f2db9', 'f5891edde2b28e294da941f2e807beb028192a70', '2011-03-12 16:15:58.502571', 'a952b676f314fe9757d9a6b48d0a70409157b62e')
|
9582
|
+
|
9583
|
+
|
9584
|
+
Started POST "/entrances.json" for 127.0.0.1 at Sat Mar 12 17:15:58 +0100 2011
|
9585
|
+
[1m[36mUser Load (0.2ms)[0m [1mSELECT "users".* FROM "users" WHERE ("users"."email" = 'test@example.com') LIMIT 1[0m
|
9586
|
+
Processing by EntrancesController#create as JSON
|
9587
|
+
Completed 201 Created in 11ms (Views: 10.3ms | ActiveRecord: 8.0ms)
|
9588
|
+
[1m[35mUser Load (0.2ms)[0m SELECT "users"."id" FROM "users" WHERE (LOWER("users"."email") = LOWER('test@example.com')) LIMIT 1
|
9589
|
+
[1m[36mAREL (0.4ms)[0m [1mINSERT INTO "users" ("email_confirmed", "email", "created_at", "salt", "confirmation_token", "remember_token", "updated_at", "encrypted_password") VALUES ('t', 'test@example.com', '2011-03-12 16:15:58.624555', '878224f7dcd476762563e5abf5e10ead300eee46', '9d56db80963bc1c6253c6efb9ed8cdb02d1decdb', 'ea712b2cefdd9b502eb388b53135e0681aee6325', '2011-03-12 16:15:58.624555', '3b883120bc5ef6b9e91aef25f38e22d3be14705a')[0m
|
9590
|
+
|
9591
|
+
|
9592
|
+
Started GET "/entrances.json" for 127.0.0.1 at Sat Mar 12 17:15:58 +0100 2011
|
9593
|
+
[1m[35mUser Load (0.2ms)[0m SELECT "users".* FROM "users" WHERE ("users"."email" = 'test@example.com') LIMIT 1
|
9594
|
+
Processing by EntrancesController#index as JSON
|
9595
|
+
#<User id: 1, email: "test@example.com", encrypted_password: "3b883120bc5ef6b9e91aef25f38e22d3be14705a", salt: "878224f7dcd476762563e5abf5e10ead300eee46", confirmation_token: "9d56db80963bc1c6253c6efb9ed8cdb02d1decdb", remember_token: "ea712b2cefdd9b502eb388b53135e0681aee6325", email_confirmed: true, created_at: "2011-03-12 16:15:58", updated_at: "2011-03-12 16:15:58">
|
9596
|
+
Completed 200 OK in 2ms (Views: 0.3ms | ActiveRecord: 0.8ms)
|
9597
|
+
[1m[36mUser Load (0.2ms)[0m [1mSELECT "users"."id" FROM "users" WHERE (LOWER("users"."email") = LOWER('test@example.com')) LIMIT 1[0m
|
9598
|
+
[1m[35mAREL (0.4ms)[0m INSERT INTO "users" ("email_confirmed", "email", "created_at", "salt", "confirmation_token", "remember_token", "updated_at", "encrypted_password") VALUES ('t', 'test@example.com', '2011-03-12 16:15:58.639929', '7a4d46103bd235cda6b11512c68d185a658db01c', '220d5a6189bee40507473ae9303e053ef8b8ae33', '7435b6c4763e7394e3b83bff5f40eb57d8b4d310', '2011-03-12 16:15:58.639929', '29b73a63b9e22e73053b2e0ec7b6b5783457415f')
|
9599
|
+
|
9600
|
+
|
9601
|
+
Started GET "/entrances.csv" for 127.0.0.1 at Sat Mar 12 17:15:58 +0100 2011
|
9602
|
+
[1m[36mUser Load (0.2ms)[0m [1mSELECT "users".* FROM "users" WHERE ("users"."email" = 'test@example.com') LIMIT 1[0m
|
9603
|
+
Processing by EntrancesController#index as CSV
|
9604
|
+
#<User id: 1, email: "test@example.com", encrypted_password: "29b73a63b9e22e73053b2e0ec7b6b5783457415f", salt: "7a4d46103bd235cda6b11512c68d185a658db01c", confirmation_token: "220d5a6189bee40507473ae9303e053ef8b8ae33", remember_token: "7435b6c4763e7394e3b83bff5f40eb57d8b4d310", email_confirmed: true, created_at: "2011-03-12 16:15:58", updated_at: "2011-03-12 16:15:58">
|
9605
|
+
Rendered text template (0.0ms)
|
9606
|
+
Completed 200 OK in 4ms (Views: 2.9ms | ActiveRecord: 0.8ms)
|
9607
|
+
[1m[35mUser Load (0.2ms)[0m SELECT "users"."id" FROM "users" WHERE (LOWER("users"."email") = LOWER('test@example.com')) LIMIT 1
|
9608
|
+
[1m[36mAREL (0.4ms)[0m [1mINSERT INTO "users" ("email_confirmed", "email", "created_at", "salt", "confirmation_token", "remember_token", "updated_at", "encrypted_password") VALUES ('t', 'test@example.com', '2011-03-12 16:15:58.655308', '1524f9e8fc4ea3085d75f78ebe04243d54ad7275', 'd967399db956d08fae984cd5f22650e85f9044ec', '482f1c3f77a3243039cd05f8d273dd52af70e840', '2011-03-12 16:15:58.655308', '3f28047440306b0472873018b9a3b6a1e44fab6a')[0m
|
9609
|
+
|
9610
|
+
|
9611
|
+
Started GET "/entrances.santa" for 127.0.0.1 at Sat Mar 12 17:15:58 +0100 2011
|
9612
|
+
Processing by EntrancesController#index as
|
9613
|
+
Redirected to http://example.org/sign_in
|
9614
|
+
Completed 302 Found in 1ms
|
9615
|
+
|
9616
|
+
|
9617
|
+
Started GET "/sign_in" for 127.0.0.1 at Sat Mar 12 17:15:58 +0100 2011
|
9618
|
+
Processing by Clearance::SessionsController#new as HTML
|
9619
|
+
Rendered /opt/local/lib/ruby/gems/1.8/gems/gems/clearance-0.9.1/app/views/sessions/new.html.erb within layouts/application (10.6ms)
|
9620
|
+
Completed 200 OK in 27ms (Views: 26.8ms | ActiveRecord: 0.6ms)
|
9621
|
+
[1m[35mUser Load (0.2ms)[0m SELECT "users"."id" FROM "users" WHERE (LOWER("users"."email") = LOWER('test@example.com')) LIMIT 1
|
9622
|
+
[1m[36mAREL (0.4ms)[0m [1mINSERT INTO "users" ("email_confirmed", "email", "created_at", "salt", "confirmation_token", "remember_token", "updated_at", "encrypted_password") VALUES ('t', 'test@example.com', '2011-03-12 16:15:58.701168', '0d91ca24f782112088da8f91b2070829cbce5f02', '2b1169437feee58a2d4b598edcbc473568e3ae0c', 'abaed8f8b125b7a45d55a1353be762c58487471b', '2011-03-12 16:15:58.701168', '8e26b7cf88efb6fdebc7a756315c56c0e674e3f0')[0m
|
9623
|
+
|
9624
|
+
|
9625
|
+
Started GET "/" for 127.0.0.1 at Sat Mar 12 17:15:58 +0100 2011
|
9626
|
+
Processing by EntrancesController#index as HTML
|
9627
|
+
Redirected to http://www.example.com/sign_in
|
9628
|
+
Completed 302 Found in 1ms
|
9629
|
+
|
9630
|
+
|
9631
|
+
Started GET "/sign_in" for 127.0.0.1 at Sat Mar 12 17:15:58 +0100 2011
|
9632
|
+
Processing by Clearance::SessionsController#new as HTML
|
9633
|
+
Rendered /opt/local/lib/ruby/gems/1.8/gems/gems/clearance-0.9.1/app/views/sessions/new.html.erb within layouts/application (4.1ms)
|
9634
|
+
Completed 200 OK in 5ms (Views: 5.0ms | ActiveRecord: 0.6ms)
|
9635
|
+
|
9636
|
+
|
9637
|
+
Started POST "/session" for 127.0.0.1 at Sat Mar 12 17:15:58 +0100 2011
|
9638
|
+
Processing by Clearance::SessionsController#create as HTML
|
9639
|
+
Parameters: {"commit"=>"Sign in", "session"=>{"password"=>"[FILTERED]", "email"=>"test@example.com"}, "utf8"=>"✓"}
|
9640
|
+
[1m[35mUser Load (0.3ms)[0m SELECT "users".* FROM "users" WHERE ("users"."email" = 'test@example.com') LIMIT 1
|
9641
|
+
Rendered /opt/local/lib/ruby/gems/1.8/gems/gems/clearance-0.9.1/app/views/sessions/new.html.erb within layouts/application (4.2ms)
|
9642
|
+
Completed 401 Unauthorized in 7ms (Views: 5.2ms | ActiveRecord: 0.3ms)
|
9643
|
+
[1m[36mUser Load (0.2ms)[0m [1mSELECT "users"."id" FROM "users" WHERE (LOWER("users"."email") = LOWER('test@example.com')) LIMIT 1[0m
|
9644
|
+
[1m[35mAREL (0.4ms)[0m INSERT INTO "users" ("email_confirmed", "email", "created_at", "salt", "confirmation_token", "remember_token", "updated_at", "encrypted_password") VALUES ('t', 'test@example.com', '2011-03-12 16:15:58.771605', '107b9884f1dbbd8af0a0f52b5486563288c07e38', '13dc73576a257e73e749ee3a4f6b83b28e298004', 'c6f75523acb5b8126d70e573bf0cde45d0469795', '2011-03-12 16:15:58.771605', '8cef314d3b01642c41f01c600c8c7ef0c3fd9777')
|
9645
|
+
|
9646
|
+
|
9647
|
+
Started GET "/" for 127.0.0.1 at Sat Mar 12 17:15:58 +0100 2011
|
9648
|
+
Processing by EntrancesController#index as HTML
|
9649
|
+
Redirected to http://www.example.com/sign_in
|
9650
|
+
Completed 302 Found in 1ms
|
9651
|
+
|
9652
|
+
|
9653
|
+
Started GET "/sign_in" for 127.0.0.1 at Sat Mar 12 17:15:58 +0100 2011
|
9654
|
+
Processing by Clearance::SessionsController#new as HTML
|
9655
|
+
Rendered /opt/local/lib/ruby/gems/1.8/gems/gems/clearance-0.9.1/app/views/sessions/new.html.erb within layouts/application (4.4ms)
|
9656
|
+
Completed 200 OK in 6ms (Views: 5.3ms | ActiveRecord: 0.6ms)
|
9657
|
+
[1m[36mUser Load (0.2ms)[0m [1mSELECT "users"."id" FROM "users" WHERE (LOWER("users"."email") = LOWER('test@example.com')) LIMIT 1[0m
|
9658
|
+
[1m[35mAREL (0.4ms)[0m INSERT INTO "users" ("email_confirmed", "email", "created_at", "salt", "confirmation_token", "remember_token", "updated_at", "encrypted_password") VALUES ('t', 'test@example.com', '2011-03-12 16:15:58.792216', 'd7fa5f49879eb03db571b62149ade081fd819291', 'f65ab6f86d7fc232a3f8eb60b1cd893eace3e814', 'a8439016de823df2c74412dcb5233c4914bc2cc6', '2011-03-12 16:15:58.792216', '635719ac8aef01b7f2975ebf8e7cbe01bcd64c35')
|
9659
|
+
|
9660
|
+
|
9661
|
+
Started GET "/" for 127.0.0.1 at Sat Mar 12 17:15:58 +0100 2011
|
9662
|
+
Processing by EntrancesController#index as HTML
|
9663
|
+
Redirected to http://www.example.com/sign_in
|
9664
|
+
Completed 302 Found in 1ms
|
9665
|
+
|
9666
|
+
|
9667
|
+
Started GET "/sign_in" for 127.0.0.1 at Sat Mar 12 17:15:58 +0100 2011
|
9668
|
+
Processing by Clearance::SessionsController#new as HTML
|
9669
|
+
Rendered /opt/local/lib/ruby/gems/1.8/gems/gems/clearance-0.9.1/app/views/sessions/new.html.erb within layouts/application (5.1ms)
|
9670
|
+
Completed 200 OK in 10ms (Views: 10.0ms | ActiveRecord: 0.5ms)
|
9671
|
+
|
9672
|
+
|
9673
|
+
Started POST "/session" for 127.0.0.1 at Sat Mar 12 17:15:58 +0100 2011
|
9674
|
+
Processing by Clearance::SessionsController#create as HTML
|
9675
|
+
Parameters: {"commit"=>"Sign in", "session"=>{"password"=>"[FILTERED]", "email"=>"test@example.com"}, "utf8"=>"✓"}
|
9676
|
+
[1m[36mUser Load (0.4ms)[0m [1mSELECT "users".* FROM "users" WHERE ("users"."email" = 'test@example.com') LIMIT 1[0m
|
9677
|
+
Redirected to http://www.example.com/
|
9678
|
+
Completed 302 Found in 7ms
|
9679
|
+
|
9680
|
+
|
9681
|
+
Started GET "/" for 127.0.0.1 at Sat Mar 12 17:15:58 +0100 2011
|
9682
|
+
Processing by EntrancesController#index as HTML
|
9683
|
+
[1m[35mUser Load (0.4ms)[0m SELECT "users".* FROM "users" WHERE ("users"."remember_token" = 'a8439016de823df2c74412dcb5233c4914bc2cc6') LIMIT 1
|
9684
|
+
#<User id: 1, email: "test@example.com", encrypted_password: "635719ac8aef01b7f2975ebf8e7cbe01bcd64c35", salt: "d7fa5f49879eb03db571b62149ade081fd819291", confirmation_token: "f65ab6f86d7fc232a3f8eb60b1cd893eace3e814", remember_token: "a8439016de823df2c74412dcb5233c4914bc2cc6", email_confirmed: true, created_at: "2011-03-12 16:15:58", updated_at: "2011-03-12 16:15:58">
|
9685
|
+
Rendered text template (0.0ms)
|
9686
|
+
Completed 200 OK in 3ms (Views: 0.6ms | ActiveRecord: 0.9ms)
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: clearance_http_auth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 23
|
5
|
+
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
8
|
+
- 2
|
9
9
|
- 0
|
10
|
-
version: 0.
|
10
|
+
version: 0.2.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Karel Minarik
|
@@ -15,12 +15,13 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-03-12 00:00:00 +01:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
22
|
prerelease: false
|
23
|
-
|
23
|
+
type: :runtime
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
25
|
none: false
|
25
26
|
requirements:
|
26
27
|
- - ~>
|
@@ -31,12 +32,12 @@ dependencies:
|
|
31
32
|
- 0
|
32
33
|
- 0
|
33
34
|
version: 1.0.0
|
34
|
-
requirement: *id001
|
35
35
|
name: bundler
|
36
|
-
|
36
|
+
version_requirements: *id001
|
37
37
|
- !ruby/object:Gem::Dependency
|
38
38
|
prerelease: false
|
39
|
-
|
39
|
+
type: :runtime
|
40
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
40
41
|
none: false
|
41
42
|
requirements:
|
42
43
|
- - ">"
|
@@ -46,12 +47,12 @@ dependencies:
|
|
46
47
|
- 0
|
47
48
|
- 9
|
48
49
|
version: "0.9"
|
49
|
-
requirement: *id002
|
50
50
|
name: clearance
|
51
|
-
|
51
|
+
version_requirements: *id002
|
52
52
|
- !ruby/object:Gem::Dependency
|
53
53
|
prerelease: false
|
54
|
-
|
54
|
+
type: :runtime
|
55
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
55
56
|
none: false
|
56
57
|
requirements:
|
57
58
|
- - ">"
|
@@ -61,12 +62,12 @@ dependencies:
|
|
61
62
|
- 1
|
62
63
|
- 2
|
63
64
|
version: "1.2"
|
64
|
-
requirement: *id003
|
65
65
|
name: rack
|
66
|
-
|
66
|
+
version_requirements: *id003
|
67
67
|
- !ruby/object:Gem::Dependency
|
68
68
|
prerelease: false
|
69
|
-
|
69
|
+
type: :development
|
70
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
70
71
|
none: false
|
71
72
|
requirements:
|
72
73
|
- - ">="
|
@@ -75,12 +76,12 @@ dependencies:
|
|
75
76
|
segments:
|
76
77
|
- 0
|
77
78
|
version: "0"
|
78
|
-
requirement: *id004
|
79
79
|
name: thin
|
80
|
-
|
80
|
+
version_requirements: *id004
|
81
81
|
- !ruby/object:Gem::Dependency
|
82
82
|
prerelease: false
|
83
|
-
|
83
|
+
type: :development
|
84
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
84
85
|
none: false
|
85
86
|
requirements:
|
86
87
|
- - ">="
|
@@ -89,12 +90,12 @@ dependencies:
|
|
89
90
|
segments:
|
90
91
|
- 0
|
91
92
|
version: "0"
|
92
|
-
requirement: *id005
|
93
93
|
name: turn
|
94
|
-
|
94
|
+
version_requirements: *id005
|
95
95
|
- !ruby/object:Gem::Dependency
|
96
96
|
prerelease: false
|
97
|
-
|
97
|
+
type: :development
|
98
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
98
99
|
none: false
|
99
100
|
requirements:
|
100
101
|
- - ">="
|
@@ -103,9 +104,8 @@ dependencies:
|
|
103
104
|
segments:
|
104
105
|
- 0
|
105
106
|
version: "0"
|
106
|
-
requirement: *id006
|
107
107
|
name: shoulda
|
108
|
-
|
108
|
+
version_requirements: *id006
|
109
109
|
description: " Simple, instant HTTP Basic Authentication for applications using Clearance.\n"
|
110
110
|
email: karmi@karmi.cz
|
111
111
|
executables: []
|
@@ -206,7 +206,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
206
206
|
requirements: []
|
207
207
|
|
208
208
|
rubyforge_project:
|
209
|
-
rubygems_version: 1.
|
209
|
+
rubygems_version: 1.5.0
|
210
210
|
signing_key:
|
211
211
|
specification_version: 3
|
212
212
|
summary: HTTP Basic Authentication for Clearance
|