looker-sdk 0.1.4 → 0.1.6

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: eec4f085f75f425e9a066942d67bde11f67fa7f2ebf1fd7a38778a6b02a01104
4
- data.tar.gz: 41246f423ed0288d8cbbbb5f2dba3fe011ad23cca48dec84e6a6ddfb575ec73f
3
+ metadata.gz: d5e038d877894b66d6cbc3c73e6c56d254196a47d2965ede1e0bcb75a9b9fddf
4
+ data.tar.gz: 9770b81dcbd531e51f4d62e73d2131cbca10e69ae560536b570a118bc866b5ad
5
5
  SHA512:
6
- metadata.gz: d6eb98d64177c6b30dd98c3fc0a6dc2ecf0ab0a83fdb4c694476cc791c63e8c2fc14c18a199dd6c01f59926691c7a340bccdf38ef4a0f1f3e10cbf8ff6a505ac
7
- data.tar.gz: 7630058cb8ae0d8e3968fddfb81b1e22c52bf446621cfed83d8e9b44d7c9685c306a801d8709197d2a2a84db970a5d73fe2fdc0212d9a713639bb2043abfdd5f
6
+ metadata.gz: 10c9f1833242eb61f8098b3d006ebddcae6d50a9bd354fc49c5297c9d2daece34a7bc377d5117461240a594aec8375b0aa361a1408ac056702b4164d4bd15e9f
7
+ data.tar.gz: da2bb7771662e02515fd6994b6ea550b0897122f131f4772b42a0e86e155014667492577de99358e094cb8e35752fbc0d556432c61ec52c455ce9398e593faa5
@@ -11,7 +11,7 @@ jobs:
11
11
  release-please:
12
12
  runs-on: ubuntu-latest
13
13
  steps:
14
- - uses: GoogleCloudPlatform/release-please-action@v2
14
+ - uses: GoogleCloudPlatform/release-please-action@v3
15
15
  id: release
16
16
  with:
17
17
  release-type: ruby
@@ -102,7 +102,7 @@ jobs:
102
102
  - name: remove mock .netrc
103
103
  if: ${{ always() }}
104
104
  run: |
105
- rm test/fixtures/.netrc
105
+ rm -f test/fixtures/.netrc
106
106
 
107
107
  - name: Upload ts unit test results
108
108
  if: ${{ always() }}
data/.gitignore CHANGED
@@ -10,7 +10,7 @@
10
10
  *~
11
11
  *.sass-cache
12
12
  *.iml
13
-
13
+ .ruby-version
14
14
 
15
15
  # OS or Editor folders
16
16
  .DS_Store
@@ -55,3 +55,6 @@ tmp
55
55
 
56
56
  # credentials for testing
57
57
  .netrc
58
+
59
+ # test output
60
+ /test/reports/**
data/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.1.6](https://github.com/looker-open-source/looker-sdk-ruby/compare/v0.1.5...v0.1.6) (2023-06-28)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * Deprecated Faraday::Request.method changed to http_method ([c3f74bd](https://github.com/looker-open-source/looker-sdk-ruby/commit/c3f74bdbaeb0ec6cc7ed10e2f395b7273cb80783))
9
+
10
+ ## [0.1.5](https://github.com/looker-open-source/looker-sdk-ruby/compare/v0.1.4...v0.1.5) (2023-06-28)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * updated redcarpet dependency to account for an injection vulnerability which can enable a cross-site scripting attack. ([f325228](https://github.com/looker-open-source/looker-sdk-ruby/commit/f32522897157887d0bf446b8c5b27c57d8e533b9))
16
+
3
17
  ### [0.1.4](https://www.github.com/looker-open-source/looker-sdk-ruby/compare/v0.1.3...v0.1.4) (2023-03-14)
4
18
 
5
19
 
data/Gemfile CHANGED
@@ -2,19 +2,19 @@ source 'https://rubygems.org'
2
2
 
3
3
  group :development do
4
4
  gem 'awesome_print', '~>1.6.1', :require => 'ap'
5
- gem 'redcarpet', '~>3.1.2', :platforms => :ruby
5
+ gem 'redcarpet', '~>3.5.1', :platforms => :ruby
6
6
  end
7
7
 
8
8
  group :development, :test do
9
- gem 'rake', '< 11.0'
9
+ gem 'rake', '~> 13.0.3'
10
10
  end
11
11
 
12
12
  group :test do
13
13
  # gem 'json', '~> 1.7', :platforms => [:jruby] look TODO needed?
14
- gem 'minitest', '5.9.1'
15
- gem 'mocha', '1.1.0'
16
- gem 'rack', '1.6.4'
17
- gem 'rack-test', '0.6.2'
14
+ gem 'minitest', '~> 5.11.0'
15
+ gem 'mocha', '~> 1.1.0'
16
+ gem 'rack', '~> 2.2.7'
17
+ gem 'rack-test', '~> 1'
18
18
  gem 'netrc', '~> 0.7.7'
19
19
  gem 'simplecov', '~> 0.7.1', :require => false
20
20
  end
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- looker-sdk (0.1.4)
4
+ looker-sdk (0.1.6)
5
5
  faraday (>= 1.2, < 3.0)
6
6
  sawyer (~> 0.8)
7
7
 
@@ -18,42 +18,27 @@ GEM
18
18
  ci_reporter_minitest (1.0.0)
19
19
  ci_reporter (~> 2.0)
20
20
  minitest (~> 5.0)
21
- faraday (1.10.3)
22
- faraday-em_http (~> 1.0)
23
- faraday-em_synchrony (~> 1.0)
24
- faraday-excon (~> 1.1)
25
- faraday-httpclient (~> 1.0)
26
- faraday-multipart (~> 1.0)
27
- faraday-net_http (~> 1.0)
28
- faraday-net_http_persistent (~> 1.0)
29
- faraday-patron (~> 1.0)
30
- faraday-rack (~> 1.0)
31
- faraday-retry (~> 1.0)
21
+ faraday (2.7.8)
22
+ faraday-net_http (>= 2.0, < 3.1)
32
23
  ruby2_keywords (>= 0.0.4)
33
- faraday-em_http (1.0.0)
34
- faraday-em_synchrony (1.0.0)
35
- faraday-excon (1.1.0)
36
- faraday-httpclient (1.0.1)
37
24
  faraday-multipart (1.0.4)
38
25
  multipart-post (~> 2)
39
- faraday-net_http (1.0.1)
40
- faraday-net_http_persistent (1.2.0)
41
- faraday-patron (1.0.0)
42
- faraday-rack (1.0.0)
43
- faraday-retry (1.0.3)
26
+ faraday-net_http (3.0.2)
27
+ faraday-rack (2.0.0)
28
+ faraday (~> 2.0)
44
29
  metaclass (0.0.4)
45
- minitest (5.9.1)
30
+ minitest (5.11.3)
46
31
  mocha (1.1.0)
47
32
  metaclass (~> 0.0.1)
48
33
  multi_json (1.15.0)
49
34
  multipart-post (2.3.0)
50
35
  netrc (0.7.9)
51
36
  public_suffix (5.0.1)
52
- rack (1.6.4)
53
- rack-test (0.6.2)
54
- rack (>= 1.0)
55
- rake (10.5.0)
56
- redcarpet (3.1.2)
37
+ rack (2.2.7)
38
+ rack-test (1.1.0)
39
+ rack (>= 1.0, < 3)
40
+ rake (13.0.6)
41
+ redcarpet (3.5.1)
57
42
  rexml (3.2.5)
58
43
  ruby2_keywords (0.0.5)
59
44
  sawyer (0.9.2)
@@ -65,21 +50,24 @@ GEM
65
50
  simplecov-html (0.7.1)
66
51
 
67
52
  PLATFORMS
53
+ arm64-darwin-22
68
54
  x86_64-linux
69
55
 
70
56
  DEPENDENCIES
71
57
  awesome_print (~> 1.6.1)
72
58
  ci_reporter_minitest (~> 1.0)
73
- faraday (~> 1.10)
59
+ faraday (~> 2.7)
60
+ faraday-multipart (~> 1.0)
61
+ faraday-rack (~> 2)
74
62
  looker-sdk!
75
- minitest (= 5.9.1)
76
- mocha (= 1.1.0)
63
+ minitest (~> 5.11.0)
64
+ mocha (~> 1.1.0)
77
65
  netrc (~> 0.7.7)
78
- rack (= 1.6.4)
79
- rack-test (= 0.6.2)
80
- rake (< 11.0)
81
- redcarpet (~> 3.1.2)
66
+ rack (~> 2.2.7)
67
+ rack-test (~> 1)
68
+ rake (~> 13.0.3)
69
+ redcarpet (~> 3.5.1)
82
70
  simplecov (~> 0.7.1)
83
71
 
84
72
  BUNDLED WITH
85
- 2.4.8
73
+ 2.4.14
data/README.md CHANGED
@@ -1,5 +1,9 @@
1
1
  [![Gem Version](https://badge.fury.io/rb/looker-sdk.svg)](https://badge.fury.io/rb/looker-sdk)[![Ruby-CI](https://github.com/looker-open-source/looker-sdk-ruby/actions/workflows/ruby-ci.yml/badge.svg?branch=main)](https://github.com/looker-open-source/looker-sdk-ruby/actions/workflows/ruby-ci.yml)
2
2
  # [Looker](http://looker.com/) SDK for Ruby
3
+
4
+ ### Support
5
+ This SDK is officially supported by Looker/Google. Issues can be logged here in the GitHub Issues page, but can also be logged with Looker Support. Details of Looker API and SDK support can be found at [https://cloud.google.com/looker/docs/api-sdk-support-policy](https://cloud.google.com/looker/docs/api-sdk-support-policy).
6
+
3
7
  ### Overview
4
8
  This SDK supports secure/authenticated access to the Looker RESTful API. The SDK binds dynamically to the Looker API and builds mappings for the sets of API methods that the Looker instance exposes. This allows for writing straightforward Ruby scripts to interact with the Looker API. And, it allows the SDK to provide access to new Looker API features in each Looker release without requiring an update to the SDK each time.
5
9
 
@@ -25,7 +25,7 @@
25
25
  require 'looker-sdk'
26
26
  require 'json'
27
27
 
28
- # Note that this example requires API 3.1 for new dashboard element manipulation functions
28
+ # Note that this example requires API 3.1 or greater for new dashboard element manipulation functions
29
29
 
30
30
  sdk = LookerSDK::Client.new(
31
31
  :client_id => ENV['KEY'],
@@ -370,12 +370,12 @@ module LookerSDK
370
370
  path_with_query = uri.query ? "#{uri.path}?#{uri.query}" : uri.path
371
371
 
372
372
  http_request = (
373
- case request.method
373
+ case request.http_method
374
374
  when :get then Net::HTTP::Get
375
375
  when :post then Net::HTTP::Post
376
376
  when :put then Net::HTTP::Put
377
377
  when :patch then Net::HTTP::Patch
378
- else raise "Stream to block not supported for '#{request.method}'"
378
+ else raise "Stream to block not supported for '#{request.http_method}'"
379
379
  end
380
380
  ).new(path_with_query, request.headers)
381
381
 
@@ -420,7 +420,11 @@ module LookerSDK
420
420
 
421
421
  class Serializer < Sawyer::Serializer
422
422
  def encode(data)
423
- data.kind_of?(Faraday::UploadIO) ? data : super
423
+ if Gem.loaded_specs['faraday'].version < Gem::Version.new('2.0')
424
+ data.kind_of?(Faraday::UploadIO) ? data : super
425
+ else
426
+ data.kind_of?(Faraday::FilePart) ? data : super
427
+ end
424
428
  end
425
429
 
426
430
  # slight modification to the base class' decode_hash_value function to
@@ -472,7 +476,9 @@ module LookerSDK
472
476
 
473
477
  def merge_content_type_if_body(body, options = {})
474
478
  if body
475
- if body.kind_of?(Faraday::UploadIO)
479
+ type = Gem.loaded_specs['faraday'].version < Gem::Version.new('2.0') ? Faraday::UploadIO : Faraday::FilePart
480
+
481
+ if body.kind_of?(type)
476
482
  length = File.new(body.local_path).size.to_s
477
483
  headers = {:content_type => body.content_type, :content_length => length}.merge(options[:headers] || {})
478
484
  else
@@ -26,6 +26,6 @@ module LookerSDK
26
26
 
27
27
  # Current version
28
28
  # @return [String]
29
- VERSION = "0.1.4"
29
+ VERSION = "0.1.6"
30
30
 
31
31
  end
data/looker-sdk.gemspec CHANGED
@@ -26,5 +26,7 @@ Gem::Specification.new do |s|
26
26
  s.add_dependency 'sawyer', '~> 0.8'
27
27
  s.add_dependency 'faraday', ['>= 1.2', '< 3.0']
28
28
  s.add_development_dependency 'ci_reporter_minitest', '~> 1.0'
29
- s.add_development_dependency 'faraday', '~> 1.10'
29
+ s.add_development_dependency 'faraday', '~> 2.7'
30
+ s.add_development_dependency 'faraday-rack', '~> 2'
31
+ s.add_development_dependency 'faraday-multipart', '~> 1.0'
30
32
  end
data/test/helper.rb CHANGED
@@ -41,6 +41,8 @@ require 'minitest/mock'
41
41
  require 'mocha/mini_test'
42
42
  require "rack/test"
43
43
  require "rack/request"
44
+ require "faraday/rack"
45
+ require "faraday/multipart"
44
46
 
45
47
  def fixture_path
46
48
  File.expand_path("../fixtures", __FILE__)
@@ -223,7 +223,12 @@ class LookerDynamicClientTest < MiniTest::Spec
223
223
  it "post with file upload" do
224
224
  verify(response, :post, '/api/3.0/users', {first_name:'Joe', last_name:'User'}, {}, "application/vnd.BOGUS3+json") do |sdk|
225
225
  name = File.join(File.dirname(__FILE__), 'user.json')
226
- sdk.create_user(Faraday::UploadIO.new(name, "application/vnd.BOGUS3+json"))
226
+ if Gem.loaded_specs['faraday'].version < Gem::Version.new('2.0')
227
+ sdk.create_user(Faraday::UploadIO.new(name, "application/vnd.BOGUS3+json"))
228
+ else
229
+ sdk.create_user(Faraday::FilePart.new(name, "application/vnd.BOGUS3+json"))
230
+ end
231
+
227
232
  end
228
233
  end
229
234
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: looker-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Looker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-03-14 00:00:00.000000000 Z
11
+ date: 2023-06-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sawyer
@@ -64,14 +64,42 @@ dependencies:
64
64
  requirements:
65
65
  - - "~>"
66
66
  - !ruby/object:Gem::Version
67
- version: '1.10'
67
+ version: '2.7'
68
68
  type: :development
69
69
  prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
72
  - - "~>"
73
73
  - !ruby/object:Gem::Version
74
- version: '1.10'
74
+ version: '2.7'
75
+ - !ruby/object:Gem::Dependency
76
+ name: faraday-rack
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - "~>"
80
+ - !ruby/object:Gem::Version
81
+ version: '2'
82
+ type: :development
83
+ prerelease: false
84
+ version_requirements: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - "~>"
87
+ - !ruby/object:Gem::Version
88
+ version: '2'
89
+ - !ruby/object:Gem::Dependency
90
+ name: faraday-multipart
91
+ requirement: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - "~>"
94
+ - !ruby/object:Gem::Version
95
+ version: '1.0'
96
+ type: :development
97
+ prerelease: false
98
+ version_requirements: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - "~>"
101
+ - !ruby/object:Gem::Version
102
+ version: '1.0'
75
103
  description: Use this SDK to access the Looker API. The Looker API provides functions
76
104
  to perform administrative tasks such as provisioning users, configuring database
77
105
  connections, and so on. It also enables you to leverage the Looker data analytics