fastly 2.5.2 → 2.5.3
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/.env.example +3 -0
- data/Gemfile +4 -0
- data/README.md +11 -7
- data/lib/fastly/belongs_to_service_and_version.rb +3 -3
- data/lib/fastly/client.rb +4 -0
- data/lib/fastly/gem_version.rb +1 -1
- data/lib/fastly/service.rb +2 -1
- data/test/fastly/client_test.rb +8 -1
- data/test/helper.rb +1 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ff6374dedf0a4320acb1bb370b700f31dffbb841ad039e717c9b6bd713a6cb5a
|
4
|
+
data.tar.gz: f53667b8fa95b6e9cf013ec23c94feee19b860c28de60aba3fee4ddd17ffaa4c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f3115a7e69149466f180e3d823c13ef9d4a895178a6e33e02522afa1b5551df59da7655dd3c316eba9cb0be0df2494b2b2f4a6803a2ec6b04cb8f4f1b06be11f
|
7
|
+
data.tar.gz: c7a1a39686da60e1986b24d7ef7d94cdba247e29117a99bed51924e23716da3dc72cc44869e1b711f75745309ff71597c165d2048fb5b43ed38fa6d0d2fc4e88
|
data/.env.example
ADDED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -202,15 +202,19 @@ This option should not be used in a production setting as all HTTP headers, requ
|
|
202
202
|
|
203
203
|
### Notes for testing
|
204
204
|
|
205
|
-
The test suite
|
205
|
+
The test suite tests create and delete three services in sequence, so you may want to create an account just for these tests.
|
206
206
|
|
207
|
-
|
208
|
-
* `FASTLY_TEST_PASSWORD` - Your account password
|
209
|
-
* `FASTLY_TEST_API_KEY` - Your API key (found at https://app.fastly.com/#account)
|
207
|
+
To run the test suite:
|
210
208
|
|
211
|
-
|
212
|
-
|
213
|
-
to
|
209
|
+
1. Generate a personal token for these tests: https://manage.fastly.com/account/personal/tokens
|
210
|
+
|
211
|
+
2. Copy `.env.example` to `.env` and add the values for the variables:
|
212
|
+
|
213
|
+
* `FASTLY_TEST_USER` - Your user email
|
214
|
+
* `FASTLY_TEST_PASSWORD` - Your account password
|
215
|
+
* `FASTLY_TEST_API_KEY` - Your personal token
|
216
|
+
|
217
|
+
3. Run the tests via `bundle exec rake test:unit`
|
214
218
|
|
215
219
|
## Copyright
|
216
220
|
|
data/lib/fastly/client.rb
CHANGED
@@ -27,6 +27,10 @@ class Fastly
|
|
27
27
|
|
28
28
|
return self unless fully_authed?
|
29
29
|
|
30
|
+
warn("DEPRECATION WARNING: Username/password authentication is deprecated
|
31
|
+
and will not be available starting September 2020;
|
32
|
+
please migrate to API tokens as soon as possible.")
|
33
|
+
|
30
34
|
# If full auth creds (user/pass) then log in and set a cookie
|
31
35
|
resp = http.post(
|
32
36
|
'/login',
|
data/lib/fastly/gem_version.rb
CHANGED
data/lib/fastly/service.rb
CHANGED
@@ -2,7 +2,8 @@
|
|
2
2
|
class Fastly
|
3
3
|
# Represents something you want to serve - this can be, for example, a whole web site, a Wordpress site, or just your image servers
|
4
4
|
class Service < Base
|
5
|
-
attr_accessor :id, :customer_id, :name, :comment
|
5
|
+
attr_accessor :id, :customer_id, :name, :comment
|
6
|
+
attr_writer :versions
|
6
7
|
|
7
8
|
@versions = []
|
8
9
|
|
data/test/fastly/client_test.rb
CHANGED
@@ -12,7 +12,7 @@ describe Fastly::Client do
|
|
12
12
|
}
|
13
13
|
end
|
14
14
|
|
15
|
-
it 'does not
|
15
|
+
it 'does not set the user/pass if they are not provided' do
|
16
16
|
client = Fastly::Client.new(api_key: api_key)
|
17
17
|
|
18
18
|
assert_equal api_key, client.api_key
|
@@ -29,6 +29,13 @@ describe Fastly::Client do
|
|
29
29
|
assert_equal "Invalid auth credentials. Check username/password.", e.message
|
30
30
|
end
|
31
31
|
|
32
|
+
it 'surfaces a deprecation message when a username or password is provided' do
|
33
|
+
stub_request(:any, /api.fastly.com/).
|
34
|
+
to_return(body: JSON.generate(i: "dont care"), status: 200)
|
35
|
+
|
36
|
+
assert_output('', /DEPRECATION WARNING:/) { Fastly::Client.new(user: user, password: pass) }
|
37
|
+
end
|
38
|
+
|
32
39
|
it 'initializes an http client' do
|
33
40
|
client = Fastly::Client.new(api_key: api_key)
|
34
41
|
|
data/test/helper.rb
CHANGED
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: 2.5.
|
4
|
+
version: 2.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fastly
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-06-09 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Client library for the Fastly acceleration system
|
14
14
|
email:
|
@@ -21,6 +21,7 @@ executables:
|
|
21
21
|
extensions: []
|
22
22
|
extra_rdoc_files: []
|
23
23
|
files:
|
24
|
+
- ".env.example"
|
24
25
|
- ".gitignore"
|
25
26
|
- ".rubocop.yml"
|
26
27
|
- ".travis.yml"
|
@@ -109,8 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
109
110
|
- !ruby/object:Gem::Version
|
110
111
|
version: '0'
|
111
112
|
requirements: []
|
112
|
-
|
113
|
-
rubygems_version: 2.7.6.2
|
113
|
+
rubygems_version: 3.0.6
|
114
114
|
signing_key:
|
115
115
|
specification_version: 4
|
116
116
|
summary: Client library for the Fastly acceleration system
|