koala 3.3.0 → 3.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f3709b2644f9f0259e68e181d629754ffe3ba0213322cfb3bad0d369ad04543c
4
- data.tar.gz: 7c3e3760d2ee7958b199713c7308f291552ee80a7badddc9ea9434a71cb024a9
3
+ metadata.gz: dd1ef11b53dbfd2dc45d096a2b3f26d86aab74927758638b95670be82d5a81b3
4
+ data.tar.gz: 4f8694539f46568a268740064fa16f5f9084198f90ccdb2bf66b532d0fd280ae
5
5
  SHA512:
6
- metadata.gz: a22e1b9de96408d3273816150d5e0d55768f72b8b48a93ea276b7d2dc5d35f45de38cb8aad847345faf9c6997d7d0f19d21f177882cfb024e472e8681c9bbd2d
7
- data.tar.gz: 5d66a1c10d8bd3d8153eb8faa02ee7ae901aae7321141d12f39abaeb33b6193cea2e3c7215b813942b714965d6048abda867f1d269de39dbdfc0bc137f3a0dc6
6
+ metadata.gz: aa13fcdb702dacaf5ea61d905f1d4d09e067b8181c9bbe9f1e210d80718eb8015953b770fc79332658bf9a0c5b11e0923a31c85049fde4a5dc566367f5ed63a1
7
+ data.tar.gz: cda4d98559e43ce1cb2cfd4c308431020c32443282cf2161230f6cae81bfc7608494181f55cc15e8dfc4386b248a81ec7d2306125487a41b6d4c7c6f4bc84c09
data/changelog.md CHANGED
@@ -15,6 +15,14 @@ Testing improvements:
15
15
 
16
16
  Others:
17
17
 
18
+ v3.4.0 (2023-01-05)
19
+ ======
20
+
21
+ Updated features:
22
+
23
+ * Force use by default of HTTPS (instead of HTTP) when there is no access token.
24
+ HTTP can still be used by passing :use_ssl => false in the options hash for an api call ([#678](https://github.com/arsduo/koala/pull/678/files))
25
+
18
26
  v3.3.0 (2022-09-27)
19
27
  ======
20
28
 
@@ -106,9 +106,7 @@ module Koala
106
106
  end
107
107
 
108
108
  def add_ssl_options(opts)
109
- # require https if there's a token
110
- return opts unless raw_args["access_token"]
111
-
109
+ # require https by default (can be overriden by explicitly setting other SSL options)
112
110
  {
113
111
  use_ssl: true,
114
112
  ssl: {verify: true}.merge(opts[:ssl] || {})
data/lib/koala/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Koala
2
- VERSION = "3.3.0"
2
+ VERSION = "3.4.0"
3
3
  end
@@ -176,9 +176,9 @@ module Koala
176
176
  end
177
177
 
178
178
  describe "ssl options" do
179
- it "does nothing if there's no access token" do
179
+ it "includes the default SSL options even if there's no access token" do
180
180
  request_options = Request.new(path: path, args: args.delete_if {|k, _v| k == "access_token"}, verb: verb, options: options).options
181
- expect(request_options).not_to include(:ssl, :use_ssl)
181
+ expect(request_options).to include(use_ssl: true, ssl: {verify: true})
182
182
  end
183
183
 
184
184
  context "if there is an access_token" do
@@ -193,9 +193,9 @@ module Koala
193
193
  end
194
194
 
195
195
  it "overrides default SSL options with what's provided" do
196
- new_ssl_options = {verify: :dunno}
197
- request_options = Request.new(path: path, args: args, verb: verb, options: options.merge(ssl: new_ssl_options)).options
198
- expect(request_options[:ssl]).to include(new_ssl_options)
196
+ new_ssl_options = {use_ssl: false, ssl:{verify: :dunno}}
197
+ request_options = Request.new(path: path, args: args, verb: verb, options: options.merge(new_ssl_options)).options
198
+ expect(request_options).to include(new_ssl_options)
199
199
  end
200
200
  end
201
201
  end
@@ -211,9 +211,17 @@ module Koala
211
211
  expect(request.server).to eq("https://foo")
212
212
  end
213
213
 
214
- context "if options[:use_ssl] is false (e.g. no access token)" do
214
+ context "if there is no access token" do
215
215
  let(:args) { {"a" => "b"} }
216
216
 
217
+ it "uses https" do
218
+ expect(request.server).to eq("https://graph.facebook.com")
219
+ end
220
+ end
221
+
222
+ context "if options[:use_ssl] is false" do
223
+ let(:options) { {use_ssl: false} }
224
+
217
225
  it "uses http" do
218
226
  expect(request.server).to eq("http://graph.facebook.com")
219
227
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: koala
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.0
4
+ version: 3.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Koppel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-27 00:00:00.000000000 Z
11
+ date: 2023-01-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -177,7 +177,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
177
177
  - !ruby/object:Gem::Version
178
178
  version: '0'
179
179
  requirements: []
180
- rubygems_version: 3.4.0.dev
180
+ rubygems_version: 3.2.32
181
181
  signing_key:
182
182
  specification_version: 4
183
183
  summary: A lightweight, flexible library for Facebook with support for the Graph API,