url_tokenizer 1.1.7 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.env.sample +1 -0
- data/.travis.yml +2 -4
- data/Rakefile +1 -0
- data/VERSION +1 -1
- data/lib/url_tokenizer/fastly.rb +28 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 528fc592fedf1fe398ad55786d3db269889228bf
|
4
|
+
data.tar.gz: f7ba2eb5f0322d7d52deb4cd2fdf1255d16f80f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ad56796ba99550b04b2e0e1311deb523d4f4fe7506ec675f8075632f5ff4adb19c25c295990434abb59b4fef080dd310822c47bd5edf6a461e91356627a447b
|
7
|
+
data.tar.gz: 2e1fa729428300ca442813c69fcf905e8b488f6c738fc2c21d8bd81705c7b7186780cf4083302e1602d2bfc53cffe21b8912e306f033e6656ef16ddc1ca07a04
|
data/.env.sample
CHANGED
data/.travis.yml
CHANGED
data/Rakefile
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.2.0
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'uri'
|
2
|
+
require 'openssl'
|
3
|
+
require_relative 'provider'
|
4
|
+
|
5
|
+
module UrlTokenizer
|
6
|
+
class Fastly < Provider
|
7
|
+
def call(input_url, **options)
|
8
|
+
options = global_options.merge options
|
9
|
+
uri = URI.parse input_url
|
10
|
+
path = uri.path
|
11
|
+
return if path.empty? || path == '/'
|
12
|
+
|
13
|
+
expiration = expiration_date(options[:expires_in])
|
14
|
+
dir = File.dirname(path)
|
15
|
+
|
16
|
+
token = digest [dir, expiration].compact.join
|
17
|
+
token = [expiration, token].compact.join '_'
|
18
|
+
|
19
|
+
uri.path = ['/', token, path].join
|
20
|
+
uri.to_s
|
21
|
+
end
|
22
|
+
|
23
|
+
private
|
24
|
+
def digest(string_to_sign)
|
25
|
+
OpenSSL::HMAC.hexdigest('sha1', key, string_to_sign)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
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.2.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:
|
11
|
+
date: 2017-03-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: facets
|
@@ -114,6 +114,7 @@ files:
|
|
114
114
|
- bin/setup
|
115
115
|
- lib/url_tokenizer.rb
|
116
116
|
- lib/url_tokenizer/cdn77.rb
|
117
|
+
- lib/url_tokenizer/fastly.rb
|
117
118
|
- lib/url_tokenizer/limelight.rb
|
118
119
|
- lib/url_tokenizer/provider.rb
|
119
120
|
- lib/url_tokenizer/wowza.rb
|
@@ -138,7 +139,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
138
139
|
version: '0'
|
139
140
|
requirements: []
|
140
141
|
rubyforge_project:
|
141
|
-
rubygems_version: 2.5
|
142
|
+
rubygems_version: 2.4.5
|
142
143
|
signing_key:
|
143
144
|
specification_version: 4
|
144
145
|
summary: Tokenize url by variety of providers.
|