rack-simple_auth 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
- ---
2
- SHA1:
3
- metadata.gz: 8fa6b100a85c9fd7a4a16745a3669038ef8f48ce
4
- data.tar.gz: fbf000d057d5df50733d04cc3d4afcda972ff192
5
- SHA512:
6
- metadata.gz: ee7d6fb78ea972bdd943eda54f9056acf6d10e4b8754af7da87dcc626c7183ad92497d676eacc598a444acbf628695d0ad07ef368ac8f26175753755d7c869ed
7
- data.tar.gz: 44d6c7373f234946f22246b5729ea14fbd47b942fb29a81db0d344ba8cc6f294b6ad5de842d245e8ab3649693500b15c0a9b1436495166550f7dab008052e9e1
1
+ ---
2
+ SHA1:
3
+ metadata.gz: a9eb2327a5e9743a78d600c3a79f6c10628d4d4e
4
+ data.tar.gz: 648aba592008e3d5da11eda588352f3940b67d86
5
+ SHA512:
6
+ metadata.gz: c485c387b2bfd02372758c937aae019acd9160acbd1ad0436027bdf8365197444d32a360c59a421e23cf427b86212e0f02f8cf84d3981f0e9ffc3d17189fc6d8
7
+ data.tar.gz: fc568199976dd711a630a5e584be13a82a741ff68f9873e67cd84e84c7c79f5d977b4ecccd7af4ae3f6cc3d768b9dfa5fd9e25d163f1da87f6eeb21dd0fb0cbd
@@ -1,4 +1,5 @@
1
1
  require 'rack/simple_auth/version'
2
+ require 'rack/simple_auth/logger'
2
3
  require 'rack/simple_auth/hmac'
3
4
 
4
5
  require 'json'
@@ -83,7 +83,9 @@ module Rack
83
83
  def message(delay = 0)
84
84
  date = @date + delay
85
85
  date = date.to_i if delay.eql?(0.0)
86
- puts "Delay: #{delay}, Timestamp: #{date}"
86
+
87
+ # Print out Delay and Timestamp for each range step in development environment
88
+ puts "Delay: #{delay}, Timestamp: #{date}" if ENV['RACK_ENV'].eql?('development')
87
89
 
88
90
  case @request.request_method
89
91
  when 'GET'
@@ -118,22 +120,20 @@ module Rack
118
120
  # - requested path
119
121
  def log(hash_array)
120
122
  if @logpath
121
- log = "#{Time.new} - #{@request.request_method} #{@request.path} - 400 Unauthorized\n"
122
- log << "HTTP_AUTHORIZATION: #{@request.env['HTTP_AUTHORIZATION']}\n"
123
- log << "Auth Message Config: #{@config[@request.request_method]}\n"
123
+ msg = "#{Time.new} - #{@request.request_method} #{@request.path} - 400 Unauthorized\n"
124
+ msg << "HTTP_AUTHORIZATION: #{@request.env['HTTP_AUTHORIZATION']}\n"
125
+ msg << "Auth Message Config: #{@config[@request.request_method]}\n"
124
126
 
125
127
  if hash_array
126
- log << "Allowed Encrypted Messages:\n"
128
+ msg << "Allowed Encrypted Messages:\n"
127
129
  hash_array.each do |hash|
128
- log << "#{hash}\n"
130
+ msg << "#{hash}\n"
129
131
  end
130
132
  end
131
133
 
132
- log << "Auth Signature: #{@signature}"
134
+ msg << "Auth Signature: #{@signature}"
133
135
 
134
- open("#{@logpath}/#{ENV['RACK_ENV']}_error.log", 'a') do |f|
135
- f << "#{log}\n"
136
- end
136
+ Rack::SimpleAuth::Logger.log(@logpath, ENV['RACK_ENV'], msg)
137
137
  end
138
138
  end
139
139
 
@@ -151,6 +151,6 @@ module Rack
151
151
  fail "Tolerance must be greater than stepsize - Tolerance: #{@tolerance}, Stepsize: #{@steps}"
152
152
  end
153
153
  end
154
- end
155
- end
156
- end
154
+ end # HMAC
155
+ end # SimpleAuth
156
+ end # Rack
@@ -2,6 +2,6 @@ module Rack
2
2
  # Module which Contains different Authorization / Authentication Classes (HMAC, ..)
3
3
  module SimpleAuth
4
4
  # Current Gem Version
5
- VERSION = '0.1.3'
5
+ VERSION = '0.1.4'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,96 +1,81 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: rack-simple_auth
3
- version: !ruby/object:Gem::Version
4
- version: 0.1.3
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.4
5
5
  platform: ruby
6
- authors:
6
+ authors:
7
7
  - Benny1992
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-28 00:00:00.000000000 Z
12
- dependencies:
13
- - !ruby/object:Gem::Dependency
11
+
12
+ date: 2014-04-28 00:00:00 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
14
15
  name: rack
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: '0'
20
- type: :runtime
21
16
  prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- version: '0'
27
- - !ruby/object:Gem::Dependency
17
+ requirement: &id001 !ruby/object:Gem::Requirement
18
+ requirements:
19
+ - &id006
20
+ - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: "0"
23
+ type: :runtime
24
+ version_requirements: *id001
25
+ - !ruby/object:Gem::Dependency
28
26
  name: bundler
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: '1.6'
34
- type: :development
35
27
  prerelease: false
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'
28
+ requirement: &id002 !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ~>
31
+ - !ruby/object:Gem::Version
32
+ version: "1.6"
48
33
  type: :development
34
+ version_requirements: *id002
35
+ - !ruby/object:Gem::Dependency
36
+ name: rake
49
37
  prerelease: false
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'
38
+ requirement: &id003 !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - ~>
41
+ - !ruby/object:Gem::Version
42
+ version: "10.3"
62
43
  type: :development
44
+ version_requirements: *id003
45
+ - !ruby/object:Gem::Dependency
46
+ name: coveralls
63
47
  prerelease: false
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'
48
+ requirement: &id004 !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - ~>
51
+ - !ruby/object:Gem::Version
52
+ version: "0.7"
76
53
  type: :development
54
+ version_requirements: *id004
55
+ - !ruby/object:Gem::Dependency
56
+ name: rack-test
77
57
  prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - "~>"
81
- - !ruby/object:Gem::Version
82
- version: '0.6'
58
+ requirement: &id005 !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ~>
61
+ - !ruby/object:Gem::Version
62
+ version: "0.6"
63
+ type: :development
64
+ version_requirements: *id005
83
65
  description: SimpleAuth HMAC authentication
84
- email:
66
+ email:
85
67
  - r3qnbenni@gmail.com
86
68
  executables: []
69
+
87
70
  extensions: []
71
+
88
72
  extra_rdoc_files: []
89
- files:
90
- - ".gitignore"
91
- - ".rubocop.yml"
92
- - ".travis.yml"
93
- - ".yardopts"
73
+
74
+ files:
75
+ - .gitignore
76
+ - .rubocop.yml
77
+ - .travis.yml
78
+ - .yardopts
94
79
  - Gemfile
95
80
  - LICENSE.txt
96
81
  - MANIFEST
@@ -118,28 +103,29 @@ files:
118
103
  - test/rack/simple_auth/hmac_test.rb
119
104
  - test/test_helper.rb
120
105
  homepage: https://github.com/Benny1992/rack-simple_auth
121
- licenses:
106
+ licenses:
122
107
  - MIT
123
108
  metadata: {}
124
- post_install_message: 'Please report any issues at: https://github.com/Benny1992/rack-simple_auth/issues/new'
109
+
110
+ post_install_message: "Please report any issues at: https://github.com/Benny1992/rack-simple_auth/issues/new"
125
111
  rdoc_options: []
126
- require_paths:
112
+
113
+ require_paths:
127
114
  - lib
128
- required_ruby_version: !ruby/object:Gem::Requirement
129
- requirements:
115
+ required_ruby_version: !ruby/object:Gem::Requirement
116
+ requirements:
130
117
  - - ">="
131
- - !ruby/object:Gem::Version
118
+ - !ruby/object:Gem::Version
132
119
  version: 1.8.7
133
- required_rubygems_version: !ruby/object:Gem::Requirement
134
- requirements:
135
- - - ">="
136
- - !ruby/object:Gem::Version
137
- version: '0'
120
+ required_rubygems_version: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - *id006
138
123
  requirements: []
124
+
139
125
  rubyforge_project:
140
126
  rubygems_version: 2.2.2
141
127
  signing_key:
142
128
  specification_version: 4
143
129
  summary: SimpleAuth HMAC authentication
144
130
  test_files: []
145
- has_rdoc:
131
+