google-cloud-logging 2.5.0 → 2.6.1

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: 657dd5524961ef04e416dc5bfe1186ba9217ad829bafdea4520177f94e8be951
4
- data.tar.gz: c030a7b24ce70cc161b8368656700f0e26145cee9552830fd9b28ab28ae72b93
3
+ metadata.gz: 2816c11f44d21e93dd932e1b404d09672e941c2a41b504d564bd9706b7cda23b
4
+ data.tar.gz: d2a9a2c155f111f69eebe90ccefbe0f16bbebfe83baef825df2c4030fd39dbc0
5
5
  SHA512:
6
- metadata.gz: c1c039ba7dac2ec400385c2b8ea494fe4397db3249c553da4030b91257719fb3b2f568cdb7c0df683f66b1240a1a69c4aa2c586760f40396fd4782d2782432b8
7
- data.tar.gz: 8c12bbd2eacb0780d62af3dc27d70f1ef8de514c352ff45511f0f974324edd61442ced8eeab874fdab7491bcc80965add4a3dcb5a7e588bb30cf9623371fecde
6
+ metadata.gz: 25c01fe153ae282da7abd367f7292a95e93847ca1c2f6219f57632d83a85e5baac2c5722077e40a1094771ff26022eef640fa9f4d2d053e72aa9bb320a0b3db5
7
+ data.tar.gz: f52e922267736277b2ec5c2c213addcec76e247a0286c31144b83dbbfe6b200bdb75abb501e73d309b7a5a0d03622502f485897e214ee2c96d0ca7da430f9d11
data/AUTHENTICATION.md CHANGED
@@ -46,6 +46,12 @@ code.
46
46
 
47
47
  **Credentials** are discovered in the following order:
48
48
 
49
+ > [!WARNING]
50
+ > If you accept a credential configuration (JSON file or Hash) from an
51
+ > external source for authentication to Google Cloud, you must validate it before
52
+ > providing it to a Google API client library. Providing an unvalidated credential
53
+ > configuration to Google APIs can compromise the security of your systems and data.
54
+
49
55
  1. Specify credentials in method arguments
50
56
  2. Specify credentials in configuration
51
57
  3. Discover credentials path in environment variables
@@ -100,11 +106,16 @@ The **Project ID** and the path to the **Credentials JSON** file can be configur
100
106
  instead of placing them in environment variables or providing them as arguments.
101
107
 
102
108
  ```ruby
109
+ require "googleauth"
103
110
  require "google/cloud/logging"
104
111
 
112
+ credentials = ::Google::Auth::ServiceAccountCredentials.make_creds(
113
+ json_key_io: ::File.open("/path/to/keyfile.json")
114
+ )
115
+
105
116
  Google::Cloud::Logging.configure do |config|
106
117
  config.project_id = "my-project-id"
107
- config.credentials = "path/to/keyfile.json"
118
+ config.credentials = credentials
108
119
  end
109
120
 
110
121
  client = Google::Cloud::Logging.new
data/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Release History
2
2
 
3
+ ### 2.6.1 (2025-11-04)
4
+
5
+ #### Documentation
6
+
7
+ * add warning about loading unvalidated credentials ([#32121](https://github.com/googleapis/google-cloud-ruby/issues/32121))
8
+
9
+ ### 2.6.0 (2025-03-04)
10
+
11
+ #### Features
12
+
13
+ * Update minimum Ruby version to 3.0 ([#29261](https://github.com/googleapis/google-cloud-ruby/issues/29261))
14
+
3
15
  ### 2.5.0 (2024-07-09)
4
16
 
5
17
  #### Features
@@ -360,7 +360,6 @@ module Google
360
360
  def async_writer max_batch_count: 10_000, max_batch_bytes: 10_000_000,
361
361
  max_queue_size: 100, interval: 5, threads: 10,
362
362
  partial_success: false
363
-
364
363
  AsyncWriter.new self, max_count: max_batch_count,
365
364
  max_bytes: max_batch_bytes,
366
365
  max_queue: max_queue_size,
@@ -83,7 +83,6 @@ module Google
83
83
 
84
84
  def list_entries resources: nil, filter: nil, order: nil, token: nil,
85
85
  max: nil, projects: nil
86
-
87
86
  project_ids = Array(projects).map { |p| "projects/#{p}" }
88
87
  resource_names = Array(resources) + project_ids
89
88
  resource_names = ["projects/#{@project}"] if resource_names.empty?
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module Logging
19
- VERSION = "2.5.0".freeze
19
+ VERSION = "2.6.1".freeze
20
20
  end
21
21
  end
22
22
  end
@@ -50,9 +50,27 @@ module Google
50
50
  # @param [String] project_id Project identifier for the Stackdriver
51
51
  # Logging service you are connecting to. If not present, the default
52
52
  # project for the credentials is used.
53
- # @param [String, Hash, Google::Auth::Credentials] credentials The path to
54
- # the keyfile as a String, the contents of the keyfile as a Hash, or a
55
- # Google::Auth::Credentials object. (See {Logging::Credentials})
53
+ # @param [Google::Auth::Credentials] credentials A Google::Auth::Credentials
54
+ # object. (See {Logging::Credentials})
55
+ # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials
56
+ # is deprecated. Providing an unvalidated credential configuration to
57
+ # Google APIs can compromise the security of your systems and data.
58
+ #
59
+ # @example
60
+ #
61
+ # # The recommended way to provide credentials is to use the `make_creds` method
62
+ # # on the appropriate credentials class for your environment.
63
+ #
64
+ # require "googleauth"
65
+ #
66
+ # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds(
67
+ # json_key_io: ::File.open("/path/to/keyfile.json")
68
+ # )
69
+ #
70
+ # logging = Google::Cloud::Logging.new(
71
+ # project_id: "my-project-id",
72
+ # credentials: credentials
73
+ # )
56
74
  # @param [String, Array<String>] scope The OAuth 2.0 scopes controlling
57
75
  # the set of resources and operations that the connection can access.
58
76
  # See [Using OAuth 2.0 to Access Google
@@ -80,9 +80,25 @@ module Google
80
80
  # @param [String] project_id Project identifier for the Stackdriver Logging
81
81
  # service you are connecting to. If not present, the default project for
82
82
  # the credentials is used.
83
- # @param [String, Hash, Google::Auth::Credentials] credentials The path to
84
- # the keyfile as a String, the contents of the keyfile as a Hash, or a
85
- # Google::Auth::Credentials object. (See {Logging::Credentials})
83
+ # @param [Google::Auth::Credentials] credentials A Google::Auth::Credentials
84
+ # object. (See {Logging::Credentials})
85
+ # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials
86
+ # is deprecated. Providing an unvalidated credential configuration to
87
+ # Google APIs can compromise the security of your systems and data.
88
+ #
89
+ # @example
90
+ #
91
+ # # The recommended way to provide credentials is to use the `make_creds` method
92
+ # # on the appropriate credentials class for your environment.
93
+ #
94
+ # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds(
95
+ # json_key_io: ::File.open("/path/to/keyfile.json")
96
+ # )
97
+ #
98
+ # logging = Google::Cloud::Logging.new(
99
+ # project_id: "my-project-id",
100
+ # credentials: credentials
101
+ # )
86
102
  # @param [String, Array<String>] scope The OAuth 2.0 scopes controlling the
87
103
  # set of resources and operations that the connection can access. See
88
104
  # [Using OAuth 2.0 to Access Google
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-logging
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.0
4
+ version: 2.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Moore
8
8
  - Chris Smith
9
- autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2024-07-09 00:00:00.000000000 Z
11
+ date: 1980-01-02 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: google-cloud-core
@@ -120,7 +119,6 @@ homepage: https://github.com/googleapis/google-cloud-ruby/tree/master/google-clo
120
119
  licenses:
121
120
  - Apache-2.0
122
121
  metadata: {}
123
- post_install_message:
124
122
  rdoc_options: []
125
123
  require_paths:
126
124
  - lib
@@ -128,15 +126,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
128
126
  requirements:
129
127
  - - ">="
130
128
  - !ruby/object:Gem::Version
131
- version: '2.7'
129
+ version: '3.0'
132
130
  required_rubygems_version: !ruby/object:Gem::Requirement
133
131
  requirements:
134
132
  - - ">="
135
133
  - !ruby/object:Gem::Version
136
134
  version: '0'
137
135
  requirements: []
138
- rubygems_version: 3.5.6
139
- signing_key:
136
+ rubygems_version: 3.6.9
140
137
  specification_version: 4
141
138
  summary: API Client library for Stackdriver Logging
142
139
  test_files: []