google-cloud-pubsub 3.0.2 → 3.0.3
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/pubsub/version.rb +1 -1
- data/lib/google/cloud/pubsub.rb +18 -3
- data/lib/google-cloud-pubsub.rb +18 -4
- 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: a7ddb29c5a0b1ae4716f853f703725e8d8fd0902a978b3ab0141a933b3b4664c
|
|
4
|
+
data.tar.gz: 530004ebcdeac8a4be673a7a40ce7dae3e7771fb8102eb0878336046f7ca6063
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: cd222027aab9e9b54f90bac0f1a6aa2269129da691bdea4f620c7133c15f003241a1f118ea8ae4fbb52f21fcbb1cbcfa0c2cabae1e26c330df61507a84316c14
|
|
7
|
+
data.tar.gz: 2d386aea9fe41bb823653d594c6073342187c4fa9ba4651daaf30ea5c45050bdef08f84451c82efc5894ab2471b91db06f315de4276ebad6f1a23c942d965331
|
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/pubsub"
|
|
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::PubSub.configure do |config|
|
|
106
117
|
config.project_id = "my-project-id"
|
|
107
|
-
config.credentials =
|
|
118
|
+
config.credentials = credentials
|
|
108
119
|
end
|
|
109
120
|
|
|
110
121
|
client = Google::Cloud::PubSub.new
|
data/CHANGELOG.md
CHANGED
data/lib/google/cloud/pubsub.rb
CHANGED
|
@@ -43,9 +43,24 @@ module Google
|
|
|
43
43
|
# @param [String] project_id Project identifier for the Pub/Sub service
|
|
44
44
|
# you are connecting to. If not present, the default project for the
|
|
45
45
|
# credentials is used.
|
|
46
|
-
# @param [
|
|
47
|
-
#
|
|
48
|
-
#
|
|
46
|
+
# @param [Google::Auth::Credentials] credentials A Google::Auth::Credentials
|
|
47
|
+
# object. (See {PubSub::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
|
+
# pubsub = Google::Cloud::Pubsub.new project_id: "my-project", credentials: credentials
|
|
49
64
|
# @param [String, Array<String>] scope The OAuth 2.0 scopes controlling
|
|
50
65
|
# the set of resources and operations that the connection can access.
|
|
51
66
|
# See [Using OAuth 2.0 to Access Google
|
data/lib/google-cloud-pubsub.rb
CHANGED
|
@@ -76,10 +76,24 @@ module Google
|
|
|
76
76
|
# @param [String] project_id Project identifier for the Pub/Sub service you
|
|
77
77
|
# are connecting to. If not present, the default project for the
|
|
78
78
|
# credentials is used.
|
|
79
|
-
# @param [
|
|
80
|
-
#
|
|
81
|
-
#
|
|
82
|
-
#
|
|
79
|
+
# @param [Google::Auth::Credentials] credentials A Google::Auth::Credentials
|
|
80
|
+
# object. (See {Google::Cloud::PubSub::Credentials})
|
|
81
|
+
# @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials
|
|
82
|
+
# is deprecated. Providing an unvalidated credential configuration to
|
|
83
|
+
# Google APIs can compromise the security of your systems and data.
|
|
84
|
+
#
|
|
85
|
+
# @example
|
|
86
|
+
#
|
|
87
|
+
# # The recommended way to provide credentials is to use the `make_creds` method
|
|
88
|
+
# # on the appropriate credentials class for your environment.
|
|
89
|
+
#
|
|
90
|
+
# require "googleauth"
|
|
91
|
+
#
|
|
92
|
+
# credentials = ::Google::Auth::ServiceAccountCredentials.make_creds(
|
|
93
|
+
# json_key_io: ::File.open("/path/to/keyfile.json")
|
|
94
|
+
# )
|
|
95
|
+
#
|
|
96
|
+
# pubsub = Google::Cloud::Pubsub.new project_id: "my-project", credentials: credentials
|
|
83
97
|
# @param [String, Array<String>] scope The OAuth 2.0 scopes controlling the
|
|
84
98
|
# set of resources and operations that the connection can access. See
|
|
85
99
|
# [Using OAuth 2.0 to Access Google
|