rack-simple_auth 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -7
- data/lib/rack/simple_auth/hmac/middleware.rb +11 -13
- data/lib/rack/simple_auth/logger.rb +6 -4
- data/lib/rack/simple_auth/version.rb +1 -1
- metadata +80 -66
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
5
|
-
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: b292b620827a52e32d62b15027cad1d4a14c73d2
|
4
|
+
data.tar.gz: b78e47f4f8ecf282c030f784414e678320a1a5a9
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 4c3003c442e1f644b2d1b65e74121e8e0d00896c851a389c30474bf5aadce6ea786ec6c4e61d11034d5183f8379c60c29a5343ff02beb4b70264c878be15ce6a
|
7
|
+
data.tar.gz: 34a602e7ed297d971bfcd98de0324e0df70aa089f6edb8c33cc859234451785f6cdae2c8eba00d99ac3b26e1f4157641a4c1ae7e5626eb6b5c4e0daaac6ca6ec
|
@@ -184,22 +184,20 @@ module Rack
|
|
184
184
|
# (Rack::SimpleAuth::Logger.log has IO action, i think there are some performance issues)
|
185
185
|
#
|
186
186
|
def log
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
msg << "#{hash}\n"
|
196
|
-
end
|
187
|
+
msg = "#{Time.new} - #{@request.request_method} #{@request.path} - 400 Unauthorized\n"
|
188
|
+
msg << "HTTP_AUTHORIZATION: #{@request.env['HTTP_AUTHORIZATION']}\n"
|
189
|
+
msg << "Auth Message Config: #{@config.request_config[@request.request_method]}\n"
|
190
|
+
|
191
|
+
if @allowed_messages
|
192
|
+
msg << "Allowed Encrypted Messages:\n"
|
193
|
+
@allowed_messages.each do |hash|
|
194
|
+
msg << "#{hash}\n"
|
197
195
|
end
|
196
|
+
end
|
198
197
|
|
199
|
-
|
198
|
+
msg << "Auth Signature: #{@config.signature}"
|
200
199
|
|
201
|
-
|
202
|
-
end
|
200
|
+
Rack::SimpleAuth::Logger.log(@config.logpath, @config.verbose, ENV['RACK_ENV'], msg)
|
203
201
|
end
|
204
202
|
end # Middleware
|
205
203
|
end # HMAC
|
@@ -10,10 +10,12 @@ module Rack
|
|
10
10
|
# @param [TrueClass|FalseClass] verbose [if true print to stdout]
|
11
11
|
# @param [String] msg [Message defined by each Authorization class]
|
12
12
|
#
|
13
|
-
def self.log(logpath, verbose
|
14
|
-
|
15
|
-
|
16
|
-
|
13
|
+
def self.log(logpath, verbose, env, msg)
|
14
|
+
if logpath
|
15
|
+
system("mkdir #{logpath}") unless Dir.exist?("#{logpath}")
|
16
|
+
open("#{logpath}/#{env}_error.log", 'a') do |f|
|
17
|
+
f << "#{msg}\n"
|
18
|
+
end
|
17
19
|
end
|
18
20
|
|
19
21
|
puts msg if verbose
|
metadata
CHANGED
@@ -1,77 +1,92 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-simple_auth
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
|
-
authors:
|
6
|
+
authors:
|
7
7
|
- Benny1992
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
- !ruby/object:Gem::Dependency
|
11
|
+
date: 2014-04-30 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
15
14
|
name: rack
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version: "0"
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
23
20
|
type: :runtime
|
24
|
-
version_requirements: *id001
|
25
|
-
- !ruby/object:Gem::Dependency
|
26
|
-
name: bundler
|
27
21
|
prerelease: false
|
28
|
-
|
29
|
-
requirements:
|
30
|
-
- -
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
version:
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.6'
|
33
34
|
type: :development
|
34
|
-
version_requirements: *id002
|
35
|
-
- !ruby/object:Gem::Dependency
|
36
|
-
name: rake
|
37
35
|
prerelease: false
|
38
|
-
|
39
|
-
requirements:
|
40
|
-
- - ~>
|
41
|
-
- !ruby/object:Gem::Version
|
42
|
-
version:
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.6'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '10.3'
|
43
48
|
type: :development
|
44
|
-
version_requirements: *id003
|
45
|
-
- !ruby/object:Gem::Dependency
|
46
|
-
name: coveralls
|
47
49
|
prerelease: false
|
48
|
-
|
49
|
-
requirements:
|
50
|
-
- - ~>
|
51
|
-
- !ruby/object:Gem::Version
|
52
|
-
version:
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '10.3'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: coveralls
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0.7'
|
53
62
|
type: :development
|
54
|
-
version_requirements: *id004
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: rack-test
|
57
63
|
prerelease: false
|
58
|
-
|
59
|
-
requirements:
|
60
|
-
- - ~>
|
61
|
-
- !ruby/object:Gem::Version
|
62
|
-
version:
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0.7'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rack-test
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0.6'
|
63
76
|
type: :development
|
64
|
-
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0.6'
|
65
83
|
description: SimpleAuth HMAC authentication
|
66
|
-
email:
|
84
|
+
email:
|
67
85
|
- r3qnbenni@gmail.com
|
68
86
|
executables: []
|
69
|
-
|
70
87
|
extensions: []
|
71
|
-
|
72
88
|
extra_rdoc_files: []
|
73
|
-
|
74
|
-
files:
|
89
|
+
files:
|
75
90
|
- LICENSE.txt
|
76
91
|
- MANIFEST
|
77
92
|
- README.rdoc
|
@@ -110,29 +125,28 @@ files:
|
|
110
125
|
- lib/rack/simple_auth/version.rb
|
111
126
|
- rack-simple_auth.gemspec
|
112
127
|
homepage: https://github.com/Benny1992/rack-simple_auth
|
113
|
-
licenses:
|
128
|
+
licenses:
|
114
129
|
- MIT
|
115
130
|
metadata: {}
|
116
|
-
|
117
|
-
post_install_message: "Please report any issues at: https://github.com/Benny1992/rack-simple_auth/issues/new"
|
131
|
+
post_install_message: 'Please report any issues at: https://github.com/Benny1992/rack-simple_auth/issues/new'
|
118
132
|
rdoc_options: []
|
119
|
-
|
120
|
-
require_paths:
|
133
|
+
require_paths:
|
121
134
|
- lib
|
122
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
123
|
-
requirements:
|
135
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
136
|
+
requirements:
|
124
137
|
- - ">="
|
125
|
-
- !ruby/object:Gem::Version
|
138
|
+
- !ruby/object:Gem::Version
|
126
139
|
version: 1.8.7
|
127
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
128
|
-
requirements:
|
129
|
-
-
|
140
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
141
|
+
requirements:
|
142
|
+
- - ">="
|
143
|
+
- !ruby/object:Gem::Version
|
144
|
+
version: '0'
|
130
145
|
requirements: []
|
131
|
-
|
132
146
|
rubyforge_project:
|
133
147
|
rubygems_version: 2.2.2
|
134
148
|
signing_key:
|
135
149
|
specification_version: 4
|
136
150
|
summary: SimpleAuth HMAC authentication
|
137
151
|
test_files: []
|
138
|
-
|
152
|
+
has_rdoc:
|