google-cloud-firestore 3.1.0 → 3.1.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: 791bfbf175ebfc435afa810200d9345d6faa8de259687c1013f31b775cd3c704
4
- data.tar.gz: ad58d22b57213e43771e4c22ad17555120e99a63419a9a50c5a7571e89a08d00
3
+ metadata.gz: eadae80e15a9c84121d9d2966f27c4698b84582f1c3e4b8124d5676bf9583ffb
4
+ data.tar.gz: 688e905687f52e469da3325d60b7eb30112082bd8487a501743d3463b27ac0fb
5
5
  SHA512:
6
- metadata.gz: 4f45cf2d0a38b4bfb799842a4feac370d7f7d06b27d3cb9104e49f2fb2d3be76357e8d5c2191ab8a8b313ac77b23aacb8ddd50f9a714bb63a04c022ffa82124b
7
- data.tar.gz: 7a4e35af0173d3a4bed5f70fb77d5c27a11bcb143e30f0f75db49059f1c89f85239640ebee68a5c36a149bcefc97961a9a11e8dbd734a77dfe948bcddbb5d311
6
+ metadata.gz: 4ea41f51137087f2e3a415b2fa5db3d5ca32f642be8ec60121f10fb4d685f44dd14d4ec12483f71740ff5bae9fe865cbad8ac2949fcb8c6a6eb4c6446509c66a
7
+ data.tar.gz: 9c704585160b7bfa428bb8e1da76309c2d033f873a6fa67739cc1459ccdd484e33dbbc377a6591755dbe22498734e012225c16c191e21388527427d22fe57fdb
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
@@ -99,11 +105,16 @@ The **Project ID** and the path to the **Credentials JSON** file can be configur
99
105
  instead of placing them in environment variables or providing them as arguments.
100
106
 
101
107
  ```ruby
108
+ require "googleauth"
102
109
  require "google/cloud/firestore"
103
110
 
111
+ credentials = ::Google::Auth::ServiceAccountCredentials.make_creds(
112
+ json_key_io: ::File.open("/path/to/keyfile.json")
113
+ )
114
+
104
115
  Google::Cloud::Firestore.configure do |config|
105
116
  config.project_id = "my-project-id"
106
- config.credentials = "path/to/keyfile.json"
117
+ config.credentials = credentials
107
118
  end
108
119
 
109
120
  client = Google::Cloud::Firestore.new
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Release History
2
2
 
3
+ ### 3.1.1 (2025-10-31)
4
+
5
+ #### Documentation
6
+
7
+ * add warning about loading unvalidated credentials ([#32121](https://github.com/googleapis/google-cloud-ruby/issues/32121))
8
+
3
9
  ### 3.1.0 (2025-08-07)
4
10
 
5
11
  #### Features
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module Firestore
19
- VERSION = "3.1.0".freeze
19
+ VERSION = "3.1.1".freeze
20
20
  end
21
21
  end
22
22
  end
@@ -43,9 +43,27 @@ module Google
43
43
  #
44
44
  # @param [String] project_id Identifier for a Firestore project. If not
45
45
  # present, the default project for the credentials is used.
46
- # @param [String, Hash, Google::Auth::Credentials] credentials The path to
47
- # the keyfile as a String, the contents of the keyfile as a Hash, or a
48
- # Google::Auth::Credentials object. (See {Firestore::Credentials})
46
+ # @param [Google::Auth::Credentials] credentials A Google::Auth::Credentials
47
+ # object. (See {Firestore::Credentials})
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
+ # firestore = Google::Cloud::Firestore.new(
64
+ # project_id: "my-project-id",
65
+ # credentials: credentials
66
+ # )
49
67
  # @param [String, Array<String>] scope The OAuth 2.0 scopes controlling
50
68
  # the set of resources and operations that the connection can access.
51
69
  # See [Using OAuth 2.0 to Access Google
@@ -91,9 +91,25 @@ module Google
91
91
  #
92
92
  # @param [String] project_id Identifier for a Firestore project. If not
93
93
  # present, the default project for the credentials is used.
94
- # @param [String, Hash, Google::Auth::Credentials] credentials The path to
95
- # the keyfile as a String, the contents of the keyfile as a Hash, or a
96
- # Google::Auth::Credentials object. (See {Firestore::Credentials})
94
+ # @param [Google::Auth::Credentials] credentials A Google::Auth::Credentials
95
+ # object. (See {Firestore::Credentials})
96
+ # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials
97
+ # is deprecated. Providing an unvalidated credential configuration to
98
+ # Google APIs can compromise the security of your systems and data.
99
+ #
100
+ # @example
101
+ #
102
+ # # The recommended way to provide credentials is to use the `make_creds` method
103
+ # # on the appropriate credentials class for your environment.
104
+ #
105
+ # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds(
106
+ # json_key_io: ::File.open("/path/to/keyfile.json")
107
+ # )
108
+ #
109
+ # firestore = Google::Cloud::Firestore.new(
110
+ # project_id: "my-project-id",
111
+ # credentials: credentials
112
+ # )
97
113
  # @param [String, Array<String>] scope The OAuth 2.0 scopes controlling the
98
114
  # set of resources and operations that the connection can access. See
99
115
  # [Using OAuth 2.0 to Access Google
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-firestore
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0
4
+ version: 3.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google Inc