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 +4 -4
- data/AUTHENTICATION.md +12 -1
- data/CHANGELOG.md +6 -0
- data/lib/google/cloud/firestore/version.rb +1 -1
- data/lib/google/cloud/firestore.rb +21 -3
- data/lib/google-cloud-firestore.rb +19 -3
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: eadae80e15a9c84121d9d2966f27c4698b84582f1c3e4b8124d5676bf9583ffb
|
|
4
|
+
data.tar.gz: 688e905687f52e469da3325d60b7eb30112082bd8487a501743d3463b27ac0fb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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 =
|
|
117
|
+
config.credentials = credentials
|
|
107
118
|
end
|
|
108
119
|
|
|
109
120
|
client = Google::Cloud::Firestore.new
|
data/CHANGELOG.md
CHANGED
|
@@ -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 [
|
|
47
|
-
#
|
|
48
|
-
#
|
|
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 [
|
|
95
|
-
#
|
|
96
|
-
#
|
|
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
|