uri_signer 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +13 -13
- data/lib/uri_signer/version.rb +1 -1
- data/uri_signer.gemspec +1 -1
- metadata +6 -6
data/README.md
CHANGED
@@ -30,30 +30,30 @@ At any point, you can use the `reload_yard` command to view the
|
|
30
30
|
documentation of the provided code. The basic usage is:
|
31
31
|
|
32
32
|
```ruby
|
33
|
+
http_method = 'get'
|
34
|
+
uri = "https://api.example.com/v1/endpoint.json?page=2&per_page=12&order=name:desc&select=id,name"
|
35
|
+
secret = "my_secret"
|
33
36
|
|
34
|
-
|
35
|
-
uri
|
36
|
-
secret = "my_secret"
|
37
|
-
|
38
|
-
signer = UriSigner::UriSigner.new(http_method, uri, secret)
|
37
|
+
signer = UriSigner::Signer.new(http_method, uri, secret)
|
38
|
+
=> #<UriSigner::Signer:0x007fd84ebf5490 @http_method="get", @uri="https://api.example.com/v1/endpoint.json?page=2&per_page=12&order=name:desc&select=id,name", @secret="my_secret">
|
39
39
|
|
40
40
|
signer.http_method
|
41
|
-
|
41
|
+
=> "GET"
|
42
42
|
|
43
43
|
signer.uri
|
44
|
-
|
44
|
+
=> "https://api.example.com/v1/endpoint.json?page=2&per_page=12&order=name:desc&select=id,name"
|
45
45
|
|
46
46
|
signer.signature
|
47
|
-
|
47
|
+
=> "Itt0xvD1ZAHHXP2ItX6PeXMfjOovr8MVgbpoXpq3158%3D"
|
48
48
|
|
49
49
|
signer.uri_with_signature
|
50
|
-
|
50
|
+
=> "https://api.example.com/v1/endpoint.json?page=2&per_page=12&order=name:desc&select=id,name&_signature=Itt0xvD1ZAHHXP2ItX6PeXMfjOovr8MVgbpoXpq3158%3D"
|
51
51
|
|
52
|
-
signer.valid?(
|
53
|
-
|
52
|
+
signer.valid?('Itt0xvD1ZAHHXP2ItX6PeXMfjOovr8MVgbpoXpq3158%3D')
|
53
|
+
=> true
|
54
54
|
|
55
|
-
signer.valid?('
|
56
|
-
|
55
|
+
signer.valid?('invalid')
|
56
|
+
=> false
|
57
57
|
```
|
58
58
|
|
59
59
|
## Contributing
|
data/lib/uri_signer/version.rb
CHANGED
data/uri_signer.gemspec
CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_dependency 'activesupport', ">=3.0
|
21
|
+
spec.add_dependency 'activesupport', ">=2.3.0"
|
22
22
|
spec.add_dependency 'rack'
|
23
23
|
spec.add_dependency 'addressable'
|
24
24
|
spec.add_dependency 'ruby-hmac'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uri_signer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -18,7 +18,7 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 3.0
|
21
|
+
version: 2.3.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ! '>='
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: 3.0
|
29
|
+
version: 2.3.0
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
31
|
name: rack
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
@@ -209,7 +209,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
209
209
|
version: '0'
|
210
210
|
segments:
|
211
211
|
- 0
|
212
|
-
hash:
|
212
|
+
hash: 1564450552823077074
|
213
213
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
214
214
|
none: false
|
215
215
|
requirements:
|
@@ -218,10 +218,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
218
218
|
version: '0'
|
219
219
|
segments:
|
220
220
|
- 0
|
221
|
-
hash:
|
221
|
+
hash: 1564450552823077074
|
222
222
|
requirements: []
|
223
223
|
rubyforge_project:
|
224
|
-
rubygems_version: 1.8.
|
224
|
+
rubygems_version: 1.8.24
|
225
225
|
signing_key:
|
226
226
|
specification_version: 3
|
227
227
|
summary: Given a client secret, we can digitally sign the URL and make requests to
|