url_tokenizer 1.1.7 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 01c899d592f71a4e611ab36aa287483f7832bd01
4
- data.tar.gz: 45552df3f7222ebcd8f55af53bde349431f96a76
3
+ metadata.gz: 528fc592fedf1fe398ad55786d3db269889228bf
4
+ data.tar.gz: f7ba2eb5f0322d7d52deb4cd2fdf1255d16f80f4
5
5
  SHA512:
6
- metadata.gz: a9d15987c541f476832622f3e10022541601055907a5af059a7cf3b68d80f5124ad28752f0e010ff4b068725d0bd54bb448de6b574247291ef9f0b72d7894dca
7
- data.tar.gz: 6e638d296dfb4fa7eec6f7b1c15902b5e740b6997a6082637638c18daefed83c8a98e40f5f5c5438d90147d082be5f644a98ef24abe549ba9e92b5ed58820755
6
+ metadata.gz: 4ad56796ba99550b04b2e0e1311deb523d4f4fe7506ec675f8075632f5ff4adb19c25c295990434abb59b4fef080dd310822c47bd5edf6a461e91356627a447b
7
+ data.tar.gz: 2e1fa729428300ca442813c69fcf905e8b488f6c738fc2c21d8bd81705c7b7186780cf4083302e1602d2bfc53cffe21b8912e306f033e6656ef16ddc1ca07a04
data/.env.sample CHANGED
@@ -1,3 +1,4 @@
1
1
  LL_TOKEN=secret
2
2
  CDN77_TOKEN=secret
3
3
  WOWZA_TOKEN=secret
4
+ FASTLY_TOKEN=secret
data/.travis.yml CHANGED
@@ -1,17 +1,15 @@
1
1
  language: ruby
2
2
  cache: bundler
3
3
  rvm:
4
+ - 2.4.1
5
+ - 2.3.3
4
6
  - 2.2
5
7
  - 2.1
6
8
  - ruby-head
7
- - rbx-2
8
- - jruby-head
9
9
 
10
10
  matrix:
11
11
  allow_failures:
12
12
  - rvm: ruby-head
13
- - rvm: rbx-2
14
- - rvm: jruby-head
15
13
 
16
14
  addons:
17
15
  code_climate:
data/Rakefile CHANGED
@@ -5,6 +5,7 @@ namespace :ci do
5
5
  desc "Run tests on CI"
6
6
  RSpec::Core::RakeTask.new('all') do |t|
7
7
  t.verbose = true
8
+ t.rspec_opts = "--tag ~real_data && bundle exec codeclimate-test-reporter"
8
9
  end
9
10
  end
10
11
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.7
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.1.7
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: 2016-07-06 00:00:00.000000000 Z
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.1
142
+ rubygems_version: 2.4.5
142
143
  signing_key:
143
144
  specification_version: 4
144
145
  summary: Tokenize url by variety of providers.