gapic-generator 0.47.1 → 0.47.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 85080fd14e5e27a8df3ceab07bab66561e846bfecd776a2296194534d8bbeb75
4
- data.tar.gz: fae81b0c5525d979141c327b4282c8eb93026a4533855006fe850b6c767b1076
3
+ metadata.gz: cfab6bf4f7af1c42592258f1821fb073aafa1d0885a7bf889ec78cb42d6cecf1
4
+ data.tar.gz: e521c17b5649fe37213a6623e48fa768386c9df0ce6a24ecbdeaa75e099e6666
5
5
  SHA512:
6
- metadata.gz: 3d93ed47c14a6008ec72ea60b51105f3b898ec7606feea171e0927bd7ca3f37267f5fcd5bc3b4f16a5fca8f321c24d25d29b62b995e275fcfcb803e858c1d0dd
7
- data.tar.gz: c81c885b285e0406200b9e8350f69156a706be854a0be8ffc86ededd7943947ced4ec3124776071e8ef99bfed55cfe5846df1725e94643946438068655e839bd
6
+ metadata.gz: 3d123027e4026d3f258a71899203f03e1cd799262b0661a77ae7612e19c153417870a6cf2db246ee2267fac5d01a4f50946f577c592c5c918f2e107fb7318811
7
+ data.tar.gz: 057a11d6eb4b385b28bd148045e0075191c12577cdd9d7acbc4610eb57b107d84c157b5db1ab408d5c0cf653ec2fbf52586dacde863c553e25c873cdba07e104
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Release History for gapic-generator
2
2
 
3
+ ### 0.47.2 / 2025-10-22
4
+
5
+ * Fix: Deprecate credentials via string or hash
6
+
3
7
  ### 0.47.1 / 2025-09-11
4
8
 
5
9
  No significant changes
@@ -16,6 +16,6 @@
16
16
 
17
17
  module Gapic
18
18
  module Generator
19
- VERSION = "0.47.1"
19
+ VERSION = "0.47.2"
20
20
  end
21
21
  end
@@ -37,8 +37,6 @@
37
37
  # @return [::String,nil]
38
38
  # @!attribute [rw] credentials
39
39
  # Credentials to send with calls. You may provide any of the following types:
40
- # * (`String`) The path to a service account key file in JSON format
41
- # * (`Hash`) A service account key as a Hash
42
40
  # * (`Google::Auth::Credentials`) A googleauth credentials object
43
41
  # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
44
42
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
@@ -47,7 +45,26 @@
47
45
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
48
46
  # * (`nil`) indicating no credentials
49
47
  #
50
- # Warning: If you accept a credential configuration (JSON file or Hash) from an
48
+ # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials
49
+ # is deprecated. Providing an unvalidated credential configuration to
50
+ # Google APIs can compromise the security of your systems and data.
51
+ #
52
+ # @example
53
+ #
54
+ # # The recommended way to provide credentials is to use the `make_creds` method
55
+ # # on the appropriate credentials class for your environment.
56
+ #
57
+ # require "googleauth"
58
+ #
59
+ # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds(
60
+ # json_key_io: ::File.open("/path/to/keyfile.json")
61
+ # )
62
+ #
63
+ # client = <%= service.client_name_full %>.new do |config|
64
+ # config.credentials = credentials
65
+ # end
66
+ #
67
+ # @note Warning: If you accept a credential configuration (JSON file or Hash) from an
51
68
  # external source for authentication to Google Cloud, you must validate it before
52
69
  # providing it to a Google API client library. Providing an unvalidated credential
53
70
  # configuration to Google APIs can compromise the security of your systems and data.
@@ -16,6 +16,26 @@ class <%= service.client_name_full %>Test < Minitest::Test
16
16
 
17
17
  <%- end -%>
18
18
  <%= indent render(partial: "service/test/method/configure", locals: { service: service }), 2 %>
19
+
20
+ def test_credentials
21
+ key = OpenSSL::PKey::RSA.new 2048
22
+ cred_json = {
23
+ "private_key" => key.to_pem,
24
+ "client_email" => "app@developer.gserviceaccount.com",
25
+ "type" => "service_account"
26
+ }
27
+ key_file = StringIO.new cred_json.to_json
28
+ creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file })
29
+
30
+ dummy_stub = ClientStub.new nil, nil
31
+ Gapic::ServiceStub.stub :new, dummy_stub do
32
+ client = <%= service.client_name_full %>.new do |config|
33
+ config.credentials = creds
34
+ end
35
+ assert_kind_of <%= service.client_name_full %>, client
36
+ assert_equal creds, client.configure.credentials
37
+ end
38
+ end
19
39
  <%- if service.lro? -%>
20
40
 
21
41
  def test_<%= service.lro_client_var %>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gapic-generator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.47.1
4
+ version: 0.47.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ernest Landrito