google-cloud-firestore-admin-v1 1.2.0 → 1.4.0

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.
@@ -641,6 +641,13 @@ module Google
641
641
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
642
642
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
643
643
  # * (`nil`) indicating no credentials
644
+ #
645
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
646
+ # external source for authentication to Google Cloud, you must validate it before
647
+ # providing it to a Google API client library. Providing an unvalidated credential
648
+ # configuration to Google APIs can compromise the security of your systems and data.
649
+ # For more information, refer to [Validate credential configurations from external
650
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
644
651
  # @return [::Object]
645
652
  # @!attribute [rw] scope
646
653
  # The OAuth scopes
@@ -191,6 +191,25 @@ module Google
191
191
  "projects/#{project}"
192
192
  end
193
193
 
194
+ ##
195
+ # Create a fully-qualified UserCreds resource string.
196
+ #
197
+ # The resource will be in the following format:
198
+ #
199
+ # `projects/{project}/databases/{database}/userCreds/{user_creds}`
200
+ #
201
+ # @param project [String]
202
+ # @param database [String]
203
+ # @param user_creds [String]
204
+ #
205
+ # @return [::String]
206
+ def user_creds_path project:, database:, user_creds:
207
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
208
+ raise ::ArgumentError, "database cannot contain /" if database.to_s.include? "/"
209
+
210
+ "projects/#{project}/databases/#{database}/userCreds/#{user_creds}"
211
+ end
212
+
194
213
  extend self
195
214
  end
196
215
  end