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 +4 -4
- data/lib/fastly/gem_version.rb +1 -1
- data/lib/fastly/syslog.rb +1 -1
- data/test/fastly/syslog_test.rb +51 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 32580a6ec6e08ca73404be24355a3a4d2fadb7f4
|
4
|
+
data.tar.gz: e8ed0acc3f405be9191c0cb86ea15b24003a1fe6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e4db43c2914802dda5f07fcb478bfcadb5e91fd9fdfdad8358420dfeca8606d78339206d102ff8657d29884e00a458e79ff1c51ca6a0fe520f92dbb52c0e51d4
|
7
|
+
data.tar.gz: d50fb2fc71ace46af5522ac0cb45a4fe304034e9444ee35d27d9b8737607ac30f8f0703e5143bb2e947144508999222f38ad77b4c2564f1088341c7dbe23eedd
|
data/lib/fastly/gem_version.rb
CHANGED
data/lib/fastly/syslog.rb
CHANGED
@@ -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, :
|
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.
|
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-
|
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.
|
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
|