koala 3.5.0 → 3.7.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 +4 -4
- data/.github/workflows/test.yml +3 -3
- data/Gemfile +1 -1
- data/changelog.md +32 -0
- data/koala.gemspec +3 -0
- data/lib/koala/api/graph_batch_api.rb +21 -8
- data/lib/koala/api/graph_collection.rb +1 -0
- data/lib/koala/errors.rb +4 -2
- data/lib/koala/version.rb +1 -1
- data/spec/cases/api_spec.rb +1 -1
- data/spec/cases/error_spec.rb +4 -2
- data/spec/cases/graph_api_batch_spec.rb +68 -11
- data/spec/cases/graph_error_checker_spec.rb +5 -3
- data/spec/cases/http_service_spec.rb +18 -6
- metadata +46 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cacc94480f8090c1c5380856b9315897e46b23b907efd411ab937d0c090d15ab
|
4
|
+
data.tar.gz: da676d048bd4d57e41eccef84cd72f7793ecad5e591728bac7ba45c51e01bb93
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 709df731e154734f941caba0b9df74aa3c0201f1e769bed433947e4dc54e6c3c27396560dfcaedd6eccaaa5d2d3a02f01b7d09e934ad70e97d7f37f766794efd
|
7
|
+
data.tar.gz: 9d15308a886501cedd51422a76a5e38e72b453ecfe0a067337b773b790c4a483cfc9c164c0299b62ca3f0cda0833201409b8e4dbdfbb934906df00888ef73516
|
data/.github/workflows/test.yml
CHANGED
@@ -10,11 +10,11 @@ jobs:
|
|
10
10
|
strategy:
|
11
11
|
fail-fast: false
|
12
12
|
matrix:
|
13
|
-
ruby: [2.7, "3.0", 3.1, head]
|
13
|
+
ruby: [2.7, "3.0", 3.1, 3.2, 3.3, 3.4, head]
|
14
14
|
|
15
15
|
steps:
|
16
16
|
- name: Checkout repository
|
17
|
-
uses: actions/checkout@
|
17
|
+
uses: actions/checkout@v4
|
18
18
|
|
19
19
|
- name: Set up Ruby
|
20
20
|
uses: ruby/setup-ruby@v1
|
@@ -25,7 +25,7 @@ jobs:
|
|
25
25
|
run: bundle install --jobs 4 --retry 3
|
26
26
|
|
27
27
|
- name: Specs & Coverage
|
28
|
-
uses: paambaati/codeclimate-action@
|
28
|
+
uses: paambaati/codeclimate-action@v6
|
29
29
|
env:
|
30
30
|
CC_TEST_REPORTER_ID: 7af99d9225b4c14640f9ec3cb2e24d2f7103ac49417b0bd989188fb6c25f2909
|
31
31
|
with:
|
data/Gemfile
CHANGED
@@ -15,7 +15,7 @@ end
|
|
15
15
|
|
16
16
|
group :test do
|
17
17
|
gem "rspec", "~> 3.0", "< 3.10" # resrict rspec version until https://github.com/rspec/rspec-support/pull/537 gets merged
|
18
|
-
gem "vcr", github: 'vcr/vcr', ref: '
|
18
|
+
gem "vcr", github: 'vcr/vcr', ref: 'ce35c236fe48899f02ddf780973b44cdb756c0ee' # needs https://github.com/vcr/vcr/issues/1057 for ruby 3.5
|
19
19
|
gem "webmock"
|
20
20
|
gem "simplecov"
|
21
21
|
end
|
data/changelog.md
CHANGED
@@ -15,6 +15,38 @@ Testing improvements:
|
|
15
15
|
|
16
16
|
Others:
|
17
17
|
|
18
|
+
v3.7.0 (2025-08-27)
|
19
|
+
==========
|
20
|
+
|
21
|
+
Internal improvements:
|
22
|
+
|
23
|
+
* explicitly require ostruct for ruby >= 3.3.5 ([694](https://github.com/arsduo/koala/pull/694))
|
24
|
+
* explicitly require cgi for ruby >= 3.5.0 ([702](https://github.com/arsduo/koala/pull/702))
|
25
|
+
|
26
|
+
Testing improvements:
|
27
|
+
|
28
|
+
* Add ruby 3.4 to CI ([696](https://github.com/arsduo/koala/pull/696))
|
29
|
+
* Fix json assertions in CI ([701](https://github.com/arsduo/koala/pull/701))
|
30
|
+
* Fix ruby 3.5 CI ([702](https://github.com/arsduo/koala/pull/702))
|
31
|
+
|
32
|
+
v3.6.0 (2024-06-27)
|
33
|
+
==========
|
34
|
+
|
35
|
+
Updated features:
|
36
|
+
|
37
|
+
* Add fbtrace_id, x-fb-rev, x-fb-debug to error messages and error class ([#668](https://github.com/arsduo/koala/pull/686))
|
38
|
+
* Handles the invalid JSON response from Facebook when the request's http_options[:http_component] is set to ':response' ([#689](https://github.com/arsduo/koala/pull/689))
|
39
|
+
|
40
|
+
Internal improvements:
|
41
|
+
|
42
|
+
* Require base64 for ruby 3.4 support ([#688](https://github.com/arsduo/koala/pull/688))
|
43
|
+
|
44
|
+
Testing improvements:
|
45
|
+
|
46
|
+
* Fix CI for ruby 3.4 ([#688](https://github.com/arsduo/koala/pull/688))
|
47
|
+
* Add latest rubies to CI ([#687](https://github.com/arsduo/koala/pull/687))
|
48
|
+
* Bump GHA action plugins to avoid deprecation warnings ([#689](https://github.com/arsduo/koala/pull/689))
|
49
|
+
|
18
50
|
v3.5.0 (2023-08-23)
|
19
51
|
======
|
20
52
|
|
data/koala.gemspec
CHANGED
@@ -28,4 +28,7 @@ Gem::Specification.new do |gem|
|
|
28
28
|
gem.add_runtime_dependency("addressable")
|
29
29
|
gem.add_runtime_dependency("json", ">= 1.8")
|
30
30
|
gem.add_runtime_dependency("rexml")
|
31
|
+
gem.add_runtime_dependency("base64")
|
32
|
+
gem.add_runtime_dependency("ostruct")
|
33
|
+
gem.add_runtime_dependency("cgi")
|
31
34
|
end
|
@@ -53,7 +53,16 @@ module Koala
|
|
53
53
|
end
|
54
54
|
|
55
55
|
original_api.graph_call("/", args, "post", http_options) do |response|
|
56
|
-
raise bad_response if response.nil?
|
56
|
+
raise bad_response('Facebook returned an empty body') if response.nil?
|
57
|
+
|
58
|
+
# when http_component is set we receive Koala::Http_service response object
|
59
|
+
# from graph_call so this needs to be parsed
|
60
|
+
# as generate_results method handles only JSON response
|
61
|
+
if http_options[:http_component] && http_options[:http_component] == :response
|
62
|
+
response = json_body(response.body)
|
63
|
+
|
64
|
+
raise bad_response('Facebook returned an invalid body') unless response.is_a?(Array)
|
65
|
+
end
|
57
66
|
|
58
67
|
batch_results += generate_results(response, batch)
|
59
68
|
end
|
@@ -81,9 +90,9 @@ module Koala
|
|
81
90
|
end
|
82
91
|
end
|
83
92
|
|
84
|
-
def bad_response
|
93
|
+
def bad_response(message)
|
85
94
|
# Facebook sometimes reportedly returns an empty body at times
|
86
|
-
BadFacebookResponse.new(200,
|
95
|
+
BadFacebookResponse.new(200, '', message)
|
87
96
|
end
|
88
97
|
|
89
98
|
def result_from_response(response, options)
|
@@ -123,14 +132,17 @@ module Koala
|
|
123
132
|
JSON.dump calls
|
124
133
|
end
|
125
134
|
|
126
|
-
def json_body(
|
127
|
-
|
128
|
-
|
129
|
-
JSON.parse(
|
135
|
+
def json_body(body)
|
136
|
+
return if body.nil?
|
137
|
+
|
138
|
+
JSON.parse(body)
|
139
|
+
rescue JSON::ParserError => e
|
140
|
+
Koala::Utils.logger.error("#{e.class}: #{e.message} while parsing #{body}")
|
141
|
+
nil
|
130
142
|
end
|
131
143
|
|
132
144
|
def desired_component(component:, response:, headers:)
|
133
|
-
result = Koala::HTTPService::Response.new(response['
|
145
|
+
result = Koala::HTTPService::Response.new(response['code'], response['body'], headers)
|
134
146
|
|
135
147
|
# Get the HTTP component they want
|
136
148
|
case component
|
@@ -138,6 +150,7 @@ module Koala
|
|
138
150
|
# facebook returns the headers as an array of k/v pairs, but we want a regular hash
|
139
151
|
when :headers then headers
|
140
152
|
# (see note in regular api method about JSON parsing)
|
153
|
+
when :response then result
|
141
154
|
else GraphCollection.evaluate(result, original_api)
|
142
155
|
end
|
143
156
|
end
|
data/lib/koala/errors.rb
CHANGED
@@ -22,6 +22,7 @@ module Koala
|
|
22
22
|
:fb_error_user_msg,
|
23
23
|
:fb_error_user_title,
|
24
24
|
:fb_error_trace_id,
|
25
|
+
:fb_error_debug_trace_id,
|
25
26
|
:fb_error_debug,
|
26
27
|
:fb_error_rev,
|
27
28
|
:fb_buc_usage,
|
@@ -65,8 +66,9 @@ module Koala
|
|
65
66
|
self.fb_error_message = error_info["message"]
|
66
67
|
self.fb_error_user_msg = error_info["error_user_msg"]
|
67
68
|
self.fb_error_user_title = error_info["error_user_title"]
|
69
|
+
self.fb_error_trace_id = error_info["fbtrace_id"]
|
68
70
|
|
69
|
-
self.
|
71
|
+
self.fb_error_debug_trace_id = error_info["x-fb-trace-id"]
|
70
72
|
self.fb_error_debug = error_info["x-fb-debug"]
|
71
73
|
self.fb_error_rev = error_info["x-fb-rev"]
|
72
74
|
self.fb_buc_usage = json_parse_for(error_info, "x-business-use-case-usage")
|
@@ -74,7 +76,7 @@ module Koala
|
|
74
76
|
self.fb_app_usage = json_parse_for(error_info, "x-app-usage")
|
75
77
|
|
76
78
|
error_array = []
|
77
|
-
%w(type code error_subcode message error_user_title error_user_msg x-fb-trace-id).each do |key|
|
79
|
+
%w(type code error_subcode message error_user_title error_user_msg fbtrace_id x-fb-trace-id x-fb-debug x-fb-rev).each do |key|
|
78
80
|
error_array << "#{key}: #{error_info[key]}" if error_info[key]
|
79
81
|
end
|
80
82
|
|
data/lib/koala/version.rb
CHANGED
data/spec/cases/api_spec.rb
CHANGED
@@ -345,7 +345,7 @@ describe "Koala::Facebook::API" do
|
|
345
345
|
response = Koala::HTTPService::Response.new(200, result.to_json, { "x-ad-account-usage" => "{\"acc_id_util_pct\"9.67}"})
|
346
346
|
allow(Koala).to receive(:make_request).and_return(response)
|
347
347
|
|
348
|
-
expect(Koala::Utils.logger).to receive(:error).with(
|
348
|
+
expect(Koala::Utils.logger).to receive(:error).with("JSON::ParserError: expected ':' after object key at line 1 column 19 while parsing x-ad-account-usage = {\"acc_id_util_pct\"9.67}")
|
349
349
|
api.graph_call('anything')
|
350
350
|
end
|
351
351
|
|
data/spec/cases/error_spec.rb
CHANGED
@@ -34,7 +34,8 @@ describe Koala::Facebook::APIError do
|
|
34
34
|
'error_subcode' => 'subcode',
|
35
35
|
'error_user_msg' => 'error user message',
|
36
36
|
'error_user_title' => 'error user title',
|
37
|
-
'
|
37
|
+
'fbtrace_id' => 'fb trace id',
|
38
|
+
'x-fb-trace-id' => 'x-fb trace id',
|
38
39
|
'x-fb-debug' => 'fb debug token',
|
39
40
|
'x-fb-rev' => 'fb revision',
|
40
41
|
'x-business-use-case-usage' => BUC_USAGE_JSON,
|
@@ -52,6 +53,7 @@ describe Koala::Facebook::APIError do
|
|
52
53
|
:fb_error_user_msg => 'error user message',
|
53
54
|
:fb_error_user_title => 'error user title',
|
54
55
|
:fb_error_trace_id => 'fb trace id',
|
56
|
+
:fb_error_debug_trace_id => 'x-fb trace id',
|
55
57
|
:fb_error_debug => 'fb debug token',
|
56
58
|
:fb_error_rev => 'fb revision',
|
57
59
|
:fb_buc_usage => JSON.parse(BUC_USAGE_JSON),
|
@@ -64,7 +66,7 @@ describe Koala::Facebook::APIError do
|
|
64
66
|
end
|
65
67
|
|
66
68
|
it "sets the error message appropriately" do
|
67
|
-
expect(error.message).to eq("type: type, code: 1, error_subcode: subcode, message: message, error_user_title: error user title, error_user_msg: error user message, x-fb-trace-id: fb trace id [HTTP 400]")
|
69
|
+
expect(error.message).to eq("type: type, code: 1, error_subcode: subcode, message: message, error_user_title: error user title, error_user_msg: error user message, fbtrace_id: fb trace id, x-fb-trace-id: x-fb trace id, x-fb-debug: fb debug token, x-fb-rev: fb revision [HTTP 400]")
|
68
70
|
end
|
69
71
|
end
|
70
72
|
|
@@ -383,28 +383,85 @@ describe "Koala::Facebook::GraphAPI in batch mode" do
|
|
383
383
|
end
|
384
384
|
end
|
385
385
|
|
386
|
-
describe
|
387
|
-
|
386
|
+
describe 'processing the request' do
|
387
|
+
let(:response_status) { 203 }
|
388
|
+
let(:response_body) { '{\"id\":\"1234\"}'.gsub('\\', '') }
|
389
|
+
let(:response_headers) { { 'Content-Type' => 'text/javascript; charset=UTF-8' } }
|
390
|
+
|
391
|
+
it 'returns the result headers as a hash if http_component is headers' do
|
388
392
|
allow(Koala).to receive(:make_request).and_return(Koala::HTTPService::Response.new(200, '[{"code":203,"headers":[{"name":"Content-Type","value":"text/javascript; charset=UTF-8"}],"body":"{\"id\":\"1234\"}"}]', {}))
|
389
393
|
result = @api.batch do |batch_api|
|
390
394
|
batch_api.get_object(KoalaTest.user1, {}, :http_component => :headers)
|
391
395
|
end
|
392
|
-
expect(
|
396
|
+
expect(response_headers).to eq(result[0])
|
397
|
+
end
|
398
|
+
|
399
|
+
it 'returns the complete response if http_component is response' do
|
400
|
+
allow(Koala).to receive(:make_request).and_return(Koala::HTTPService::Response.new(200, '[{"code":203,"headers":[{"name":"Content-Type","value":"text/javascript; charset=UTF-8"}],"body":"{\"id\":\"1234\"}"}]', {}))
|
401
|
+
result = @api.batch do |batch_api|
|
402
|
+
batch_api.get_object(KoalaTest.user1, {}, :http_component => :response)
|
403
|
+
end
|
404
|
+
|
405
|
+
expect(response_status).to eq(result[0].status)
|
406
|
+
expect(response_body).to eq(result[0].body)
|
407
|
+
expect(response_headers).to eq(result[0].headers)
|
393
408
|
end
|
394
409
|
|
395
|
-
describe
|
396
|
-
it
|
397
|
-
allow(Koala).to receive(:make_request).and_return(Koala::HTTPService::Response.new(500,
|
410
|
+
describe 'if it errors' do
|
411
|
+
it 'raises an APIError if the response is not 200' do
|
412
|
+
allow(Koala).to receive(:make_request).and_return(Koala::HTTPService::Response.new(500, '[]', {}))
|
398
413
|
expect {
|
399
|
-
Koala::Facebook::API.new(
|
414
|
+
Koala::Facebook::API.new('foo').batch { |batch_api| batch_api.get_object('me') }
|
400
415
|
}.to raise_exception(Koala::Facebook::APIError)
|
401
416
|
end
|
402
417
|
|
403
|
-
it
|
404
|
-
allow(Koala).to receive(:make_request).and_return(Koala::HTTPService::Response.new(200,
|
418
|
+
it 'raises a BadFacebookResponse if the body is empty' do
|
419
|
+
allow(Koala).to receive(:make_request).and_return(Koala::HTTPService::Response.new(200, '', {}))
|
405
420
|
expect {
|
406
|
-
Koala::Facebook::API.new(
|
407
|
-
}.to raise_exception(Koala::Facebook::BadFacebookResponse)
|
421
|
+
Koala::Facebook::API.new('foo').batch { |batch_api| batch_api.get_object('me') }
|
422
|
+
}.to raise_exception(Koala::Facebook::BadFacebookResponse, /Facebook returned an empty body \[HTTP 200\]/)
|
423
|
+
end
|
424
|
+
|
425
|
+
describe 'handle invalid body errors' do
|
426
|
+
describe 'with http_component set to :response' do
|
427
|
+
it 'raises a BadFacebookResponse if the body is non-empty, non-array' do
|
428
|
+
allow(Koala).to receive(:make_request).and_return(Koala::HTTPService::Response.new(200, '200', {}))
|
429
|
+
expect {
|
430
|
+
Koala::Facebook::API.new('foo').batch(http_component: :response) do |batch_api|
|
431
|
+
batch_api.get_object('me')
|
432
|
+
end
|
433
|
+
}.to raise_exception(Koala::Facebook::BadFacebookResponse, /Facebook returned an invalid body \[HTTP 200\]/)
|
434
|
+
end
|
435
|
+
|
436
|
+
it 'raises a BadFacebookResponse if the body is invalid JSON' do
|
437
|
+
allow(Koala).to receive(:make_request).and_return(Koala::HTTPService::Response.new(200, '{"\"id\":\1234\"}"}', {}))
|
438
|
+
expect {
|
439
|
+
Koala::Facebook::API.new('foo').batch(http_component: :response) do |batch_api|
|
440
|
+
batch_api.get_object('me')
|
441
|
+
end
|
442
|
+
}.to raise_exception(Koala::Facebook::BadFacebookResponse, /Facebook returned an invalid body \[HTTP 200\]/)
|
443
|
+
end
|
444
|
+
end
|
445
|
+
|
446
|
+
%i[headers status].each do |component|
|
447
|
+
describe "with http_component set to #{component}" do
|
448
|
+
it 'should not raise a BadFacebookResponse if the body is non-empty, non-array' do
|
449
|
+
allow(Koala).to receive(:make_request).and_return(Koala::HTTPService::Response.new(200, '200', {}))
|
450
|
+
expect {
|
451
|
+
Koala::Facebook::API.new('foo').batch(http_component: component) { |batch_api| batch_api.get_object('me') }
|
452
|
+
}.not_to raise_exception(Koala::Facebook::BadFacebookResponse, /Facebook returned an invalid body \[HTTP 200\]/)
|
453
|
+
end
|
454
|
+
|
455
|
+
it 'should not raise a BadFacebookResponse if the body is invalid JSON' do
|
456
|
+
allow(Koala).to receive(:make_request).and_return(Koala::HTTPService::Response.new(200, '{"\"id\":\1234\"}"}', {}))
|
457
|
+
expect {
|
458
|
+
Koala::Facebook::API.new('foo').batch(http_component: component) do |batch_api|
|
459
|
+
batch_api.get_object('me')
|
460
|
+
end
|
461
|
+
}.not_to raise_exception(Koala::Facebook::BadFacebookResponse, /Facebook returned an invalid body \[HTTP 200\]/)
|
462
|
+
end
|
463
|
+
end
|
464
|
+
end
|
408
465
|
end
|
409
466
|
|
410
467
|
context "with error info" do
|
@@ -76,10 +76,12 @@ module Koala
|
|
76
76
|
"error_subcode" => "FB error subcode",
|
77
77
|
"message" => "An error occurred!",
|
78
78
|
"error_user_msg" => "A user msg",
|
79
|
-
"error_user_title" => "usr title"
|
79
|
+
"error_user_title" => "usr title",
|
80
|
+
"fbtrace_id" => "fbtrace_id"
|
80
81
|
}
|
81
82
|
body.replace({"error" => error_data}.to_json)
|
82
83
|
|
84
|
+
expect(error.fb_error_trace_id).to eq(error_data["fbtrace_id"])
|
83
85
|
expect(error.fb_error_type).to eq(error_data["type"])
|
84
86
|
expect(error.fb_error_code).to eq(error_data["code"])
|
85
87
|
expect(error.fb_error_subcode).to eq(error_data["error_subcode"])
|
@@ -97,7 +99,7 @@ module Koala
|
|
97
99
|
"x-ad-account-usage" => { 'c' => 3, 'd' => 4 }.to_json,
|
98
100
|
"x-app-usage" => { 'e' => 5, 'f' => 6 }.to_json
|
99
101
|
)
|
100
|
-
expect(error.
|
102
|
+
expect(error.fb_error_debug_trace_id).to eq(headers["x-fb-trace-id"])
|
101
103
|
expect(error.fb_error_debug).to eq(headers["x-fb-debug"])
|
102
104
|
expect(error.fb_error_rev).to eq(headers["x-fb-rev"])
|
103
105
|
expect(error.fb_buc_usage).to eq({ 'a' => 1, 'b' => 2 })
|
@@ -110,7 +112,7 @@ module Koala
|
|
110
112
|
"x-app-usage" => '{invalid:json}'
|
111
113
|
)
|
112
114
|
|
113
|
-
expect(Koala::Utils.logger).to receive(:error).with(
|
115
|
+
expect(Koala::Utils.logger).to receive(:error).with("JSON::ParserError: expected object key, got 'invalid:json}' at line 1 column 2 while parsing x-app-usage = {invalid:json}")
|
114
116
|
expect(error.fb_app_usage).to eq(nil)
|
115
117
|
end
|
116
118
|
|
@@ -238,8 +238,12 @@ describe Koala::HTTPService do
|
|
238
238
|
it 'logs tokens' do
|
239
239
|
allow(Koala.config).to receive(:mask_tokens) { false }
|
240
240
|
|
241
|
-
expect(Koala::Utils).to receive(:debug)
|
242
|
-
|
241
|
+
expect(Koala::Utils).to receive(:debug) do |log|
|
242
|
+
expect(log).to match(/STARTED => GET: \/foo params: {"an"\s?=>\s?:arg, "access_token"\s?=>\s?"myvisbleaccesstoken"}/)
|
243
|
+
end
|
244
|
+
expect(Koala::Utils).to receive(:debug) do |log|
|
245
|
+
expect(log).to match(/FINISHED => GET: \/foo params: {"an"\s?=>\s?:arg, "access_token"\s?=>\s?"myvisbleaccesstoken"}/)
|
246
|
+
end
|
243
247
|
|
244
248
|
Koala::HTTPService.make_request(request)
|
245
249
|
end
|
@@ -247,8 +251,12 @@ describe Koala::HTTPService do
|
|
247
251
|
it 'doesnt log tokens' do
|
248
252
|
allow(Koala.config).to receive(:mask_tokens) { true }
|
249
253
|
|
250
|
-
expect(Koala::Utils).to receive(:debug)
|
251
|
-
|
254
|
+
expect(Koala::Utils).to receive(:debug) do |log|
|
255
|
+
expect(log).to match(/STARTED => GET: \/foo params: {"an"\s?=>\s?:arg, "access_token"\s?=>\s?"myvisbleac[*]{5}token"}/)
|
256
|
+
end
|
257
|
+
expect(Koala::Utils).to receive(:debug) do |log|
|
258
|
+
expect(log).to match(/FINISHED => GET: \/foo params: {"an"\s?=>\s?:arg, "access_token"\s?=>\s?"myvisbleac[*]{5}token"}/)
|
259
|
+
end
|
252
260
|
|
253
261
|
Koala::HTTPService.make_request(request)
|
254
262
|
end
|
@@ -258,8 +266,12 @@ describe Koala::HTTPService do
|
|
258
266
|
|
259
267
|
allow(Koala.config).to receive(:mask_tokens) { true }
|
260
268
|
|
261
|
-
expect(Koala::Utils).to receive(:debug)
|
262
|
-
|
269
|
+
expect(Koala::Utils).to receive(:debug) do |log|
|
270
|
+
expect(log).to match(/STARTED => GET: \/debug_token params: {"input_token"\s?=>\s?"myvisiblea[*]{5}token", "access_token"\s?=>\s?"myvisiblea[*]{5}token"}/)
|
271
|
+
end
|
272
|
+
expect(Koala::Utils).to receive(:debug) do |log|
|
273
|
+
expect(log).to match(/FINISHED => GET: \/debug_token params: {"input_token"\s?=>\s?"myvisiblea[*]{5}token", "access_token"\s?=>\s?"myvisiblea[*]{5}token"}/)
|
274
|
+
end
|
263
275
|
|
264
276
|
Koala::HTTPService.make_request(request)
|
265
277
|
end
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: koala
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Koppel
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: faraday
|
@@ -80,6 +79,48 @@ dependencies:
|
|
80
79
|
- - ">="
|
81
80
|
- !ruby/object:Gem::Version
|
82
81
|
version: '0'
|
82
|
+
- !ruby/object:Gem::Dependency
|
83
|
+
name: base64
|
84
|
+
requirement: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - ">="
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '0'
|
89
|
+
type: :runtime
|
90
|
+
prerelease: false
|
91
|
+
version_requirements: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - ">="
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '0'
|
96
|
+
- !ruby/object:Gem::Dependency
|
97
|
+
name: ostruct
|
98
|
+
requirement: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - ">="
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '0'
|
103
|
+
type: :runtime
|
104
|
+
prerelease: false
|
105
|
+
version_requirements: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - ">="
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
110
|
+
- !ruby/object:Gem::Dependency
|
111
|
+
name: cgi
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
113
|
+
requirements:
|
114
|
+
- - ">="
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: '0'
|
117
|
+
type: :runtime
|
118
|
+
prerelease: false
|
119
|
+
version_requirements: !ruby/object:Gem::Requirement
|
120
|
+
requirements:
|
121
|
+
- - ">="
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
version: '0'
|
83
124
|
description: Koala is a lightweight, flexible Ruby SDK for Facebook. It allows read/write
|
84
125
|
access to the social graph via the Graph and REST APIs, as well as support for realtime
|
85
126
|
updates and OAuth and Facebook Connect authentication. Koala is fully tested and
|
@@ -89,8 +130,8 @@ email: alex@alexkoppel.com
|
|
89
130
|
executables: []
|
90
131
|
extensions: []
|
91
132
|
extra_rdoc_files:
|
92
|
-
- readme.md
|
93
133
|
- changelog.md
|
134
|
+
- readme.md
|
94
135
|
files:
|
95
136
|
- ".github/workflows/test.yml"
|
96
137
|
- ".gitignore"
|
@@ -158,7 +199,6 @@ homepage: http://github.com/arsduo/koala
|
|
158
199
|
licenses:
|
159
200
|
- MIT
|
160
201
|
metadata: {}
|
161
|
-
post_install_message:
|
162
202
|
rdoc_options:
|
163
203
|
- "--line-numbers"
|
164
204
|
- "--inline-source"
|
@@ -177,8 +217,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
177
217
|
- !ruby/object:Gem::Version
|
178
218
|
version: '0'
|
179
219
|
requirements: []
|
180
|
-
rubygems_version: 3.
|
181
|
-
signing_key:
|
220
|
+
rubygems_version: 3.8.0.dev
|
182
221
|
specification_version: 4
|
183
222
|
summary: A lightweight, flexible library for Facebook with support for the Graph API,
|
184
223
|
the REST API, realtime updates, and OAuth authentication.
|