rack-simple_auth 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +20 -6
- data/lib/rack/simple_auth/version.rb +1 -1
- data/rack-simple_auth.gemspec +6 -4
- metadata +16 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b5fe75792b1cb30cd2b7ef7810d2c552c586c35e
|
4
|
+
data.tar.gz: b19a3bc05f918adbc4ee1150f3fa400048523cb5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 11512be444876aaa302ca891fe8f710fa8572e6410e9e5f8154ff80fb52fe737014329617124cf2c34da5085cccb0c8b2466302200bc6a27263005f52f74c05d
|
7
|
+
data.tar.gz: fd484a1159cbe66f4b35397fa6e302d6d6ff5e6da994fe1f525d6b7e34a29063b7d7ca8a35ed293283539a78ea957e0faf833d9e209a5095e1f2c956aebff973
|
data/README.md
CHANGED
@@ -56,11 +56,14 @@ config = {
|
|
56
56
|
'DELETE' => 'path',
|
57
57
|
'PUT' => 'path',
|
58
58
|
'PATCH' => 'path'
|
59
|
-
'tolerance' => 2
|
59
|
+
'tolerance' => 2,
|
60
|
+
'signature' => 'signature',
|
61
|
+
'secret' => 'secret',
|
62
|
+
'logpath' => '/path/to/log/file'
|
60
63
|
}
|
61
64
|
|
62
65
|
map '/' do
|
63
|
-
use Rack::SimpleAuth::HMAC,
|
66
|
+
use Rack::SimpleAuth::HMAC, config
|
64
67
|
run MyApplication
|
65
68
|
end
|
66
69
|
```
|
@@ -69,15 +72,23 @@ Note: Private Key and Signature should be served by a file which is not checked
|
|
69
72
|
|
70
73
|
|
71
74
|
|
75
|
+
|
72
76
|
#### Config Hash
|
73
77
|
|
78
|
+
|
74
79
|
Via the config hash you are able to define the 'data' for each request method.<br />
|
75
80
|
This data + HTTP Methodname is your Message what will be encrypted.<br />
|
76
81
|
|
77
82
|
For example ```GET '/get/user?name=rack'```:
|
78
83
|
|
79
84
|
```ruby
|
80
|
-
config = {
|
85
|
+
config = {
|
86
|
+
.
|
87
|
+
.
|
88
|
+
'GET' => 'path'
|
89
|
+
.
|
90
|
+
.
|
91
|
+
}
|
81
92
|
```
|
82
93
|
|
83
94
|
The Message what will be HMAC encrypted is:
|
@@ -101,19 +112,20 @@ Notice: For a set tolerance a Encrypted Message array will be generated and comp
|
|
101
112
|
|
102
113
|
#### Logging
|
103
114
|
|
104
|
-
With
|
115
|
+
With config['logpath'] you can define a destination where the internal #log method should write to.
|
105
116
|
|
106
|
-
The Logging will only be triggered when a path is defined (leave
|
117
|
+
The Logging will only be triggered when a path is defined (leave config['logpath'] for disable logging) and a request is not authorized!
|
107
118
|
|
108
119
|
It contains following information:
|
109
120
|
|
110
121
|
- HTTP_AUTHORIZATION Header
|
111
122
|
- Config for the specific Request Method (GET => path etc ...)
|
112
|
-
- The Encrypted Message which was expected
|
123
|
+
- The Encrypted Message Array which was expected
|
113
124
|
- The Signature which was expected
|
114
125
|
|
115
126
|
|
116
127
|
|
128
|
+
|
117
129
|
## TODO
|
118
130
|
|
119
131
|
~~Add Timestamp to encryption..~~
|
@@ -124,6 +136,7 @@ It contains following information:
|
|
124
136
|
|
125
137
|
|
126
138
|
|
139
|
+
|
127
140
|
## Contributing
|
128
141
|
|
129
142
|
1. Fork it ( http://github.com/benny1992/rack-simple_auth/fork )
|
@@ -140,3 +153,4 @@ It contains following information:
|
|
140
153
|
|
141
154
|
|
142
155
|
|
156
|
+
|
data/rack-simple_auth.gemspec
CHANGED
@@ -10,16 +10,18 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = ["klotz.benjamin@yahoo.de"]
|
11
11
|
spec.summary = %q{SimpleAuth HMAC authentication}
|
12
12
|
spec.description = spec.summary
|
13
|
-
spec.homepage = "
|
13
|
+
spec.homepage = "https://github.com/Benny1992/rack-simple_auth"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
16
|
spec.files = File.read(File.expand_path('../MANIFEST', __FILE__)).split("\n")
|
17
17
|
spec.require_paths = ["lib"]
|
18
18
|
|
19
|
+
spec.required_ruby_version = '>= 1.8.7'
|
20
|
+
|
19
21
|
spec.add_runtime_dependency "rack"
|
20
22
|
|
21
23
|
spec.add_development_dependency "bundler", "~> 1.5"
|
22
|
-
spec.add_development_dependency "rake"
|
23
|
-
spec.add_development_dependency "coveralls"
|
24
|
-
spec.add_development_dependency "rack-test"
|
24
|
+
spec.add_development_dependency "rake", '~> 10.2.2'
|
25
|
+
spec.add_development_dependency "coveralls", '~> 0.7.0'
|
26
|
+
spec.add_development_dependency "rack-test", '~> 0.6.2'
|
25
27
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-simple_auth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Benny1992
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
@@ -42,44 +42,44 @@ dependencies:
|
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: 10.2.2
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: 10.2.2
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: coveralls
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: 0.7.0
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
68
|
+
version: 0.7.0
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rack-test
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - "
|
73
|
+
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
75
|
+
version: 0.6.2
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - "
|
80
|
+
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
82
|
+
version: 0.6.2
|
83
83
|
description: SimpleAuth HMAC authentication
|
84
84
|
email:
|
85
85
|
- klotz.benjamin@yahoo.de
|
@@ -110,7 +110,7 @@ files:
|
|
110
110
|
- test/rack/simple_auth/hmac_fail_test.rb
|
111
111
|
- test/rack/simple_auth/hmac_test.rb
|
112
112
|
- test/test_helper.rb
|
113
|
-
homepage:
|
113
|
+
homepage: https://github.com/Benny1992/rack-simple_auth
|
114
114
|
licenses:
|
115
115
|
- MIT
|
116
116
|
metadata: {}
|
@@ -122,7 +122,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
122
122
|
requirements:
|
123
123
|
- - ">="
|
124
124
|
- !ruby/object:Gem::Version
|
125
|
-
version:
|
125
|
+
version: 1.8.7
|
126
126
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
127
127
|
requirements:
|
128
128
|
- - ">="
|