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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5c3d341b0eb57e0628e5c5aaba722cd3bd1114ce
4
- data.tar.gz: a4eb5be460fac910bfdd06635ac17cd747d25e69
3
+ metadata.gz: 024c10094293999c1acf7c9e412e834eda4fd5a6
4
+ data.tar.gz: a03446b9ff84d11a9a122f1c0770cf03b09defe8
5
5
  SHA512:
6
- metadata.gz: 3f23f7f04209512f1384c36d053c580f0cedd1f77b2c6f058b63b74ecddf84cabadefa0bde9eaa9d8bf7158f60696bed006f99f3c963c3c7d098587de24aa3b8
7
- data.tar.gz: c27fd0067035e4c0271d42d2d833357ce710228bdc2f5c2ddc3da2f8d72d7166ba3e90900a455e204a7d79e309fd83347c3e450b51bde8eccd759ee269959fa2
6
+ metadata.gz: a507ceff48d0674b90f35d19ad641ed46099c7617f48427b1c58b2e076166e9852422abfe4f6523140f8023a70e977ff21227ba92497331f044977418967b47a
7
+ data.tar.gz: eeb01317361abdbd083883accb9fe5e8721da9de14b726f0ca60ef181edc88faed34fe718f1ccea5e292a8da1063e3fcfec5dfea122d6ceaf9ea497739f5596d
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.6.0
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
- token = digest [string_to_tokenize(uri), expiration].compact.join
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.hexdigest('sha1', key, string_to_sign)
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.6.0
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-09 00:00:00.000000000 Z
11
+ date: 2018-08-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: facets