fastly 1.13.1 → 1.13.2

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: 24819569b88811c8f88006babdf74049e2cda1a8
4
- data.tar.gz: 1503f3b1fa06ad6ed3709ccd69c410923f8c3304
3
+ metadata.gz: 32580a6ec6e08ca73404be24355a3a4d2fadb7f4
4
+ data.tar.gz: e8ed0acc3f405be9191c0cb86ea15b24003a1fe6
5
5
  SHA512:
6
- metadata.gz: 3e00e06c94da8f3e489df911d3bbbb3ffcbcb2ffff5258c15e854bbfab767ce4fcd88dc9d9304a470a24183b964105efe71431cd3d3107e5d2c1b80926cde743
7
- data.tar.gz: 6a97b7e2561b0a4d389cbcf4a0d5d5bf10cf7bf17e9d589b93895b0884cf90302716d99d4e2c6751d8370813346ab34fae2cf25d2a17cb197062a73e9366b650
6
+ metadata.gz: e4db43c2914802dda5f07fcb478bfcadb5e91fd9fdfdad8358420dfeca8606d78339206d102ff8657d29884e00a458e79ff1c51ca6a0fe520f92dbb52c0e51d4
7
+ data.tar.gz: d50fb2fc71ace46af5522ac0cb45a4fe304034e9444ee35d27d9b8737607ac30f8f0703e5143bb2e947144508999222f38ad77b4c2564f1088341c7dbe23eedd
@@ -1,4 +1,4 @@
1
1
  # The current version of the library
2
2
  class Fastly
3
- VERSION = "1.13.1"
3
+ VERSION = "1.13.2"
4
4
  end
@@ -1,7 +1,7 @@
1
1
  class Fastly
2
2
  # An endpoint to stream syslogs to
3
3
  class Syslog < BelongsToServiceAndVersion
4
- attr_accessor :service_id, :name, :comment, :ipv4, :ipv6, :hostname, :port, :token, :format, :format_version, :message_type, :response_conditions, :use_tls, :tls_hostname, :tls_ca_cert
4
+ attr_accessor :service_id, :name, :comment, :ipv4, :ipv6, :hostname, :port, :token, :format, :format_version, :message_type, :response_condition, :use_tls, :tls_hostname, :tls_ca_cert
5
5
 
6
6
  ##
7
7
  # :attr: service_id
@@ -0,0 +1,51 @@
1
+ require_relative '../test_helper'
2
+
3
+ describe Fastly::Syslog do
4
+
5
+ let(:client) { Fastly.new(user: 'test@example.com', password: 'password') }
6
+ let(:service_id) { SecureRandom.hex(6) }
7
+ let(:version) { 1 }
8
+ let(:syslog) { Fastly::Syslog.new({ name: 'test_syslog', service_id: service_id, version: 1 }, client) }
9
+
10
+ before {
11
+ stub_request(:post, "#{Fastly::Client::DEFAULT_URL}/login").to_return(body: '{}', status: 200, headers: { 'Set-Cookie' => 'tasty!' })
12
+ }
13
+
14
+ describe '#item' do
15
+ it 'translates response_condition attribute properly' do
16
+ response_condition = 'never_syslog'
17
+
18
+ response_body = JSON.dump(
19
+ 'placement' => nil,
20
+ 'format_version' => '2',
21
+ 'hostname' => nil,
22
+ 'response_condition' => response_condition,
23
+ 'address' => '10.2.2.2',
24
+ 'public_key' => nil,
25
+ 'updated_at' => '2017-12-13T16:28:09Z',
26
+ 'message_type' => 'classic',
27
+ 'ipv4' => '10.2.2.2',
28
+ 'tls_hostname' => nil,
29
+ 'name' => syslog.name,
30
+ 'port' => '514',
31
+ 'use_tls' => '0',
32
+ 'service_id' => service_id,
33
+ 'tls_ca_cert' => nil,
34
+ 'token' => nil,
35
+ 'version' => version,
36
+ 'deleted_at' => nil,
37
+ 'created_at' => '2017-12-12T21:44:45Z',
38
+ 'format' => '%h %l %u %t \'%r\' %>s %b',
39
+ )
40
+
41
+ get_item_url = "#{Fastly::Client::DEFAULT_URL}/service/#{service_id}/version/#{version}/syslog/#{syslog.name}"
42
+ get_service_url = "#{Fastly::Client::DEFAULT_URL}/service/#{service_id}/version/#{version}"
43
+
44
+ stub_request(:get, get_service_url).to_return(status: 200, body: '{}', headers: {})
45
+ stub_request(:get, get_item_url).to_return(body: response_body, status: 200)
46
+
47
+ item = client.get_syslog(service_id, version, syslog.name)
48
+ assert_equal response_condition, item.response_condition
49
+ end
50
+ end
51
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastly
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.13.1
4
+ version: 1.13.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fastly
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-08 00:00:00.000000000 Z
11
+ date: 2017-12-18 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Client library for the Fastly acceleration system
14
14
  email:
@@ -78,6 +78,7 @@ files:
78
78
  - test/fastly/acl_test.rb
79
79
  - test/fastly/client_test.rb
80
80
  - test/fastly/dictionary_test.rb
81
+ - test/fastly/syslog_test.rb
81
82
  - test/fastly/util_test.rb
82
83
  - test/full_login_test.rb
83
84
  - test/helper.rb
@@ -104,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
104
105
  version: '0'
105
106
  requirements: []
106
107
  rubyforge_project:
107
- rubygems_version: 2.6.8
108
+ rubygems_version: 2.5.2
108
109
  signing_key:
109
110
  specification_version: 4
110
111
  summary: Client library for the Fastly acceleration system
@@ -116,6 +117,7 @@ test_files:
116
117
  - test/fastly/acl_test.rb
117
118
  - test/fastly/client_test.rb
118
119
  - test/fastly/dictionary_test.rb
120
+ - test/fastly/syslog_test.rb
119
121
  - test/fastly/util_test.rb
120
122
  - test/full_login_test.rb
121
123
  - test/helper.rb