google-cloud-datastore 2.13.0 → 2.13.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: 00f4895cedca98c329cdcccad6094e454ba6884afc5f18b2b765660c5df92da6
4
- data.tar.gz: 500ab2a00f401e8a69da2e4edb838072da922a149340fb56ecd148bf5aabfa1a
3
+ metadata.gz: 96ae4fca8972cf097e7b6b10d73e709ecef3d409fc68c96cae5ebcb7058c2d1b
4
+ data.tar.gz: 43c974a4d78a4533403e854d4e6ead63b19307c390e1cd1ed87194562ddde1f0
5
5
  SHA512:
6
- metadata.gz: 43730b11a7bbd83b69f2b495140fa752d8fee8deb6a729435fc99a7ff9e7d88f81628f209f7a852985d91b77cb3b9ca689edd09595ac9f71a49661bd57e0caef
7
- data.tar.gz: 5a6d3307d349f0fcfeb115d73ead84a76f053f65b64b4398e943ee2d641a2a6e6dcb58c715bbee563fa48bb2f20e83b6fe71a78125019eac57c017eb5795ae8a
6
+ metadata.gz: ed233508a15ee0c5adeed09f82435be5c9517a045e3b48fe46bfc2503bac49f82863b085ea630a20419232ba852b785377572fbc61dc1ba6048c4bf54415347a
7
+ data.tar.gz: c79f29a8601d877a7f32860b173350977eb8c94a50a4cd2c2b3a1ae3145e90762b525a2603f949c98f6cc6cc96d54b1d4ac049e6f20a3538c64ae4f11bb1e32c
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/datastore"
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::Datastore.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::Datastore.new
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Release History
2
2
 
3
+ ### 2.13.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.13.0 (2025-07-24)
4
10
 
5
11
  #### Features
data/OVERVIEW.md CHANGED
@@ -14,11 +14,16 @@ your code or via environment variables. Read more about the options for
14
14
  connecting in the {file:AUTHENTICATION.md Authentication Guide}.
15
15
 
16
16
  ```ruby
17
+ require "googleauth"
17
18
  require "google/cloud/datastore"
18
19
 
20
+ credentials = ::Google::Auth::ServiceAccountCredentials.make_creds(
21
+ json_key_io: ::File.open("/path/to/keyfile.json")
22
+ )
23
+
19
24
  datastore = Google::Cloud::Datastore.new(
20
25
  project_id: "my-todo-project",
21
- credentials: "/path/to/keyfile.json"
26
+ credentials: credentials
22
27
  )
23
28
 
24
29
  task = datastore.find "Task", "sampleTask"
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module Datastore
19
- VERSION = "2.13.0".freeze
19
+ VERSION = "2.13.1".freeze
20
20
  end
21
21
  end
22
22
  end
@@ -58,9 +58,27 @@ module Google
58
58
  #
59
59
  # @param [String] project_id Identifier for a Datastore project. If not
60
60
  # present, the default project for the credentials is used.
61
- # @param [String, Hash, Google::Auth::Credentials] credentials The path to
62
- # the keyfile as a String, the contents of the keyfile as a Hash, or a
63
- # Google::Auth::Credentials object. (See {Datastore::Credentials})
61
+ # @param [Google::Auth::Credentials] credentials A Google::Auth::Credentials
62
+ # object. (See {Datastore::Credentials})
63
+ # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials
64
+ # is deprecated. Providing an unvalidated credential configuration to
65
+ # Google APIs can compromise the security of your systems and data.
66
+ #
67
+ # @example
68
+ #
69
+ # # The recommended way to provide credentials is to use the `make_creds` method
70
+ # # on the appropriate credentials class for your environment.
71
+ #
72
+ # require "googleauth"
73
+ #
74
+ # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds(
75
+ # json_key_io: ::File.open("/path/to/keyfile.json")
76
+ # )
77
+ #
78
+ # datastore = Google::Cloud::Datastore.new(
79
+ # project_id: "my-project-id",
80
+ # credentials: credentials
81
+ # )
64
82
  # @param [String, Array<String>] scope The OAuth 2.0 scopes controlling
65
83
  # the set of resources and operations that the connection can access.
66
84
  # See [Using OAuth 2.0 to Access Google
@@ -84,9 +84,25 @@ module Google
84
84
  #
85
85
  # @param [String] project_id Identifier for a Datastore project. If not
86
86
  # present, the default project for the credentials is used.
87
- # @param [String, Hash, Google::Auth::Credentials] credentials The path to
88
- # the keyfile as a String, the contents of the keyfile as a Hash, or a
89
- # Google::Auth::Credentials object. (See {Datastore::Credentials})
87
+ # @param [Google::Auth::Credentials] credentials A Google::Auth::Credentials
88
+ # object. (See {Datastore::Credentials})
89
+ # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials
90
+ # is deprecated. Providing an unvalidated credential configuration to
91
+ # Google APIs can compromise the security of your systems and data.
92
+ #
93
+ # @example
94
+ #
95
+ # # The recommended way to provide credentials is to use the `make_creds` method
96
+ # # on the appropriate credentials class for your environment.
97
+ #
98
+ # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds(
99
+ # json_key_io: ::File.open("/path/to/keyfile.json")
100
+ # )
101
+ #
102
+ # datastore = Google::Cloud::Datastore.new(
103
+ # project_id: "my-project-id",
104
+ # credentials: credentials
105
+ # )
90
106
  # @param [String, Array<String>] scope The OAuth 2.0 scopes controlling the
91
107
  # set of resources and operations that the connection can access. See
92
108
  # [Using OAuth 2.0 to Access Google
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-datastore
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.13.0
4
+ version: 2.13.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Moore