url_tokenizer 1.6.0 → 1.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/url_tokenizer/cloudflare.rb +9 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 024c10094293999c1acf7c9e412e834eda4fd5a6
|
4
|
+
data.tar.gz: a03446b9ff84d11a9a122f1c0770cf03b09defe8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a507ceff48d0674b90f35d19ad641ed46099c7617f48427b1c58b2e076166e9852422abfe4f6523140f8023a70e977ff21227ba92497331f044977418967b47a
|
7
|
+
data.tar.gz: eeb01317361abdbd083883accb9fe5e8721da9de14b726f0ca60ef181edc88faed34fe718f1ccea5e292a8da1063e3fcfec5dfea122d6ceaf9ea497739f5596d
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.7.0
|
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'rack'
|
2
2
|
require 'uri'
|
3
3
|
require 'openssl'
|
4
|
+
require 'base64'
|
4
5
|
require_relative 'provider'
|
5
6
|
|
6
7
|
module UrlTokenizer
|
@@ -13,7 +14,9 @@ module UrlTokenizer
|
|
13
14
|
|
14
15
|
expiration = expiration_date(options[:expires_in])
|
15
16
|
|
16
|
-
|
17
|
+
string_to_digest = [string_to_tokenize(uri), expiration].compact.join
|
18
|
+
|
19
|
+
token = digest string_to_digest
|
17
20
|
token = [expiration, token].compact.join '_'
|
18
21
|
|
19
22
|
params = parse_query_string(uri).merge(verify: token)
|
@@ -37,7 +40,11 @@ module UrlTokenizer
|
|
37
40
|
end
|
38
41
|
|
39
42
|
def digest(string_to_sign)
|
40
|
-
OpenSSL::HMAC.
|
43
|
+
sha256 = OpenSSL::HMAC.digest('sha256', key, string_to_sign)
|
44
|
+
|
45
|
+
CGI.escape(
|
46
|
+
Base64.encode64(sha256).strip
|
47
|
+
)
|
41
48
|
end
|
42
49
|
end
|
43
50
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: url_tokenizer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Paramonov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-08-
|
11
|
+
date: 2018-08-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: facets
|