google-cloud-logging 2.6.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: ca9ac0a8f2d6ea841d775c3aacc3913b6f8ddaeb938bb6c1792ea9b8fec83bc8
4
- data.tar.gz: 742cd54d99be989270fc9afe8a9ffcee60e7e581479402d0afe60de58b9ea311
3
+ metadata.gz: 2816c11f44d21e93dd932e1b404d09672e941c2a41b504d564bd9706b7cda23b
4
+ data.tar.gz: d2a9a2c155f111f69eebe90ccefbe0f16bbebfe83baef825df2c4030fd39dbc0
5
5
  SHA512:
6
- metadata.gz: a78b0502fe81b9d886b2d4798be34b2c41365961c3fd2ddf93c36f97a3366b778d578c984f5bcfffb87b5f751df3a64f373e5fa751366db31de380c3118f5b27
7
- data.tar.gz: d7ab6c4f585264b1453608d6d1073e6482ab47dd20d0aa0d001a4cdd0938c1e5b87d7db513818d91dc081f95610f3f6a6c3bc163946e4d84f27181cd9a30632f
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,11 @@
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
+
3
9
  ### 2.6.0 (2025-03-04)
4
10
 
5
11
  #### Features
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module Logging
19
- VERSION = "2.6.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,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-logging
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.0
4
+ version: 2.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Moore
8
8
  - Chris Smith
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-03-04 00:00:00.000000000 Z
11
+ date: 1980-01-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-cloud-core
@@ -133,7 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
133
133
  - !ruby/object:Gem::Version
134
134
  version: '0'
135
135
  requirements: []
136
- rubygems_version: 3.6.5
136
+ rubygems_version: 3.6.9
137
137
  specification_version: 4
138
138
  summary: API Client library for Stackdriver Logging
139
139
  test_files: []