google-cloud-secret_manager-v1 1.8.0 → 1.9.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/lib/google/cloud/secret_manager/v1/bindings_override.rb +1 -1
- data/lib/google/cloud/secret_manager/v1/rest.rb +1 -1
- data/lib/google/cloud/secret_manager/v1/secret_manager_service/client.rb +199 -1
- data/lib/google/cloud/secret_manager/v1/secret_manager_service/credentials.rb +1 -1
- data/lib/google/cloud/secret_manager/v1/secret_manager_service/paths.rb +1 -1
- data/lib/google/cloud/secret_manager/v1/secret_manager_service/rest/client.rb +185 -1
- data/lib/google/cloud/secret_manager/v1/secret_manager_service/rest/service_stub.rb +141 -1
- data/lib/google/cloud/secret_manager/v1/secret_manager_service/rest.rb +1 -1
- data/lib/google/cloud/secret_manager/v1/secret_manager_service.rb +1 -1
- data/lib/google/cloud/secret_manager/v1/version.rb +1 -1
- data/lib/google/cloud/secret_manager/v1.rb +1 -1
- data/lib/google/cloud/secretmanager/v1/resources_pb.rb +6 -1
- data/lib/google/cloud/secretmanager/v1/service_pb.rb +4 -1
- data/lib/google/cloud/secretmanager/v1/service_services_pb.rb +11 -1
- data/lib/google-cloud-secret_manager-v1.rb +1 -1
- data/proto_docs/google/api/client.rb +1 -1
- data/proto_docs/google/api/field_behavior.rb +1 -1
- data/proto_docs/google/api/launch_stage.rb +1 -1
- data/proto_docs/google/api/resource.rb +1 -1
- data/proto_docs/google/cloud/secretmanager/v1/resources.rb +71 -1
- data/proto_docs/google/cloud/secretmanager/v1/service.rb +47 -1
- data/proto_docs/google/iam/v1/iam_policy.rb +1 -1
- data/proto_docs/google/iam/v1/options.rb +1 -1
- data/proto_docs/google/iam/v1/policy.rb +1 -1
- data/proto_docs/google/iam/v1/resource_policy_member.rb +49 -0
- data/proto_docs/google/protobuf/any.rb +145 -0
- data/proto_docs/google/protobuf/duration.rb +1 -1
- data/proto_docs/google/protobuf/empty.rb +1 -1
- data/proto_docs/google/protobuf/field_mask.rb +1 -1
- data/proto_docs/google/protobuf/timestamp.rb +8 -7
- data/proto_docs/google/rpc/status.rb +48 -0
- data/proto_docs/google/type/expr.rb +1 -1
- metadata +4 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 78dce0306521fb668f7c56ac0e51b8010d524892f67b5d1ef4c9dcffe82780b8
|
|
4
|
+
data.tar.gz: e8d00e2239b8d7824422afdce75e337b3b6ce2752f822dc5e088c309853f2fa0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 70b11309c2989c7fdee85ee72390e135c434a1bbde9f2b2e0faeb7b8a3d2c9db847976c13b33fd2f616671077b3fed8dd49bdac8855c02c6271aebbb2bb7d126
|
|
7
|
+
data.tar.gz: cff1f1c9e3adee5878eec5ef7e15b613f44a4616a9cc20e57e117e4694cdea92a7e539fba904cf55ec503b348de677810c4dad374229238dc82713ea7ef362f7
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Copyright
|
|
3
|
+
# Copyright 2026 Google LLC
|
|
4
4
|
#
|
|
5
5
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
6
|
# you may not use this file except in compliance with the License.
|
|
@@ -1685,6 +1685,190 @@ module Google
|
|
|
1685
1685
|
raise ::Google::Cloud::Error.from_error(e)
|
|
1686
1686
|
end
|
|
1687
1687
|
|
|
1688
|
+
##
|
|
1689
|
+
# Enables the managed rotation feature for a
|
|
1690
|
+
# {::Google::Cloud::SecretManager::V1::Secret Secret}. This method can only be
|
|
1691
|
+
# triggered once for a secret. In order to do further rotations, RotateSecret
|
|
1692
|
+
# should be used. This method will add a secret version and update the
|
|
1693
|
+
# password in Cloud SQL.
|
|
1694
|
+
#
|
|
1695
|
+
# @overload enable_managed_rotation(request, options = nil)
|
|
1696
|
+
# Pass arguments to `enable_managed_rotation` via a request object, either of type
|
|
1697
|
+
# {::Google::Cloud::SecretManager::V1::EnableManagedRotationRequest} or an equivalent Hash.
|
|
1698
|
+
#
|
|
1699
|
+
# @param request [::Google::Cloud::SecretManager::V1::EnableManagedRotationRequest, ::Hash]
|
|
1700
|
+
# A request object representing the call parameters. Required. To specify no
|
|
1701
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
1702
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
1703
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
|
1704
|
+
#
|
|
1705
|
+
# @overload enable_managed_rotation(parent: nil, cloud_sql_single_user_credentials: nil)
|
|
1706
|
+
# Pass arguments to `enable_managed_rotation` via keyword arguments. Note that at
|
|
1707
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
1708
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
1709
|
+
#
|
|
1710
|
+
# @param parent [::String]
|
|
1711
|
+
# Required. The resource name of the
|
|
1712
|
+
# {::Google::Cloud::SecretManager::V1::Secret Secret} to associate with the
|
|
1713
|
+
# {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format
|
|
1714
|
+
# `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`.
|
|
1715
|
+
# @param cloud_sql_single_user_credentials [::Google::Cloud::SecretManager::V1::EnableManagedRotationRequest::CloudSQLSingleUserCredentials, ::Hash]
|
|
1716
|
+
# Credentials required for Cloud SQL DB for Single user Managed Rotation.
|
|
1717
|
+
#
|
|
1718
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
|
1719
|
+
# @yieldparam response [::Google::Cloud::SecretManager::V1::SecretVersion]
|
|
1720
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
|
1721
|
+
#
|
|
1722
|
+
# @return [::Google::Cloud::SecretManager::V1::SecretVersion]
|
|
1723
|
+
#
|
|
1724
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
|
1725
|
+
#
|
|
1726
|
+
# @example Basic example
|
|
1727
|
+
# require "google/cloud/secret_manager/v1"
|
|
1728
|
+
#
|
|
1729
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
1730
|
+
# client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new
|
|
1731
|
+
#
|
|
1732
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
1733
|
+
# request = Google::Cloud::SecretManager::V1::EnableManagedRotationRequest.new
|
|
1734
|
+
#
|
|
1735
|
+
# # Call the enable_managed_rotation method.
|
|
1736
|
+
# result = client.enable_managed_rotation request
|
|
1737
|
+
#
|
|
1738
|
+
# # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion.
|
|
1739
|
+
# p result
|
|
1740
|
+
#
|
|
1741
|
+
def enable_managed_rotation request, options = nil
|
|
1742
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
1743
|
+
|
|
1744
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::EnableManagedRotationRequest
|
|
1745
|
+
|
|
1746
|
+
# Converts hash and nil to an options object
|
|
1747
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
1748
|
+
|
|
1749
|
+
# Customize the options with defaults
|
|
1750
|
+
metadata = @config.rpcs.enable_managed_rotation.metadata.to_h
|
|
1751
|
+
|
|
1752
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
1753
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
1754
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
1755
|
+
gapic_version: ::Google::Cloud::SecretManager::V1::VERSION
|
|
1756
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
1757
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
1758
|
+
|
|
1759
|
+
header_params = {}
|
|
1760
|
+
if request.parent
|
|
1761
|
+
header_params["parent"] = request.parent
|
|
1762
|
+
end
|
|
1763
|
+
|
|
1764
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
|
1765
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
|
1766
|
+
|
|
1767
|
+
options.apply_defaults timeout: @config.rpcs.enable_managed_rotation.timeout,
|
|
1768
|
+
metadata: metadata,
|
|
1769
|
+
retry_policy: @config.rpcs.enable_managed_rotation.retry_policy
|
|
1770
|
+
|
|
1771
|
+
options.apply_defaults timeout: @config.timeout,
|
|
1772
|
+
metadata: @config.metadata,
|
|
1773
|
+
retry_policy: @config.retry_policy
|
|
1774
|
+
|
|
1775
|
+
@secret_manager_service_stub.call_rpc :enable_managed_rotation, request, options: options do |response, operation|
|
|
1776
|
+
yield response, operation if block_given?
|
|
1777
|
+
end
|
|
1778
|
+
rescue ::GRPC::BadStatus => e
|
|
1779
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
1780
|
+
end
|
|
1781
|
+
|
|
1782
|
+
##
|
|
1783
|
+
# Do a managed rotation for a {::Google::Cloud::SecretManager::V1::Secret Secret}.
|
|
1784
|
+
# This can only be triggered after Managed rotation has been enabled.
|
|
1785
|
+
# This method will add a secret version and update the password in Cloud SQL.
|
|
1786
|
+
#
|
|
1787
|
+
# @overload rotate_secret(request, options = nil)
|
|
1788
|
+
# Pass arguments to `rotate_secret` via a request object, either of type
|
|
1789
|
+
# {::Google::Cloud::SecretManager::V1::RotateSecretRequest} or an equivalent Hash.
|
|
1790
|
+
#
|
|
1791
|
+
# @param request [::Google::Cloud::SecretManager::V1::RotateSecretRequest, ::Hash]
|
|
1792
|
+
# A request object representing the call parameters. Required. To specify no
|
|
1793
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
1794
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
1795
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
|
1796
|
+
#
|
|
1797
|
+
# @overload rotate_secret(parent: nil)
|
|
1798
|
+
# Pass arguments to `rotate_secret` via keyword arguments. Note that at
|
|
1799
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
1800
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
1801
|
+
#
|
|
1802
|
+
# @param parent [::String]
|
|
1803
|
+
# Required. The resource name of the
|
|
1804
|
+
# {::Google::Cloud::SecretManager::V1::Secret Secret} to associate with the
|
|
1805
|
+
# {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format
|
|
1806
|
+
# `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`.
|
|
1807
|
+
#
|
|
1808
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
|
1809
|
+
# @yieldparam response [::Google::Cloud::SecretManager::V1::SecretVersion]
|
|
1810
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
|
1811
|
+
#
|
|
1812
|
+
# @return [::Google::Cloud::SecretManager::V1::SecretVersion]
|
|
1813
|
+
#
|
|
1814
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
|
1815
|
+
#
|
|
1816
|
+
# @example Basic example
|
|
1817
|
+
# require "google/cloud/secret_manager/v1"
|
|
1818
|
+
#
|
|
1819
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
1820
|
+
# client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new
|
|
1821
|
+
#
|
|
1822
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
1823
|
+
# request = Google::Cloud::SecretManager::V1::RotateSecretRequest.new
|
|
1824
|
+
#
|
|
1825
|
+
# # Call the rotate_secret method.
|
|
1826
|
+
# result = client.rotate_secret request
|
|
1827
|
+
#
|
|
1828
|
+
# # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion.
|
|
1829
|
+
# p result
|
|
1830
|
+
#
|
|
1831
|
+
def rotate_secret request, options = nil
|
|
1832
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
1833
|
+
|
|
1834
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::RotateSecretRequest
|
|
1835
|
+
|
|
1836
|
+
# Converts hash and nil to an options object
|
|
1837
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
1838
|
+
|
|
1839
|
+
# Customize the options with defaults
|
|
1840
|
+
metadata = @config.rpcs.rotate_secret.metadata.to_h
|
|
1841
|
+
|
|
1842
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
1843
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
1844
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
1845
|
+
gapic_version: ::Google::Cloud::SecretManager::V1::VERSION
|
|
1846
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
1847
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
1848
|
+
|
|
1849
|
+
header_params = {}
|
|
1850
|
+
if request.parent
|
|
1851
|
+
header_params["parent"] = request.parent
|
|
1852
|
+
end
|
|
1853
|
+
|
|
1854
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
|
1855
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
|
1856
|
+
|
|
1857
|
+
options.apply_defaults timeout: @config.rpcs.rotate_secret.timeout,
|
|
1858
|
+
metadata: metadata,
|
|
1859
|
+
retry_policy: @config.rpcs.rotate_secret.retry_policy
|
|
1860
|
+
|
|
1861
|
+
options.apply_defaults timeout: @config.timeout,
|
|
1862
|
+
metadata: @config.metadata,
|
|
1863
|
+
retry_policy: @config.retry_policy
|
|
1864
|
+
|
|
1865
|
+
@secret_manager_service_stub.call_rpc :rotate_secret, request, options: options do |response, operation|
|
|
1866
|
+
yield response, operation if block_given?
|
|
1867
|
+
end
|
|
1868
|
+
rescue ::GRPC::BadStatus => e
|
|
1869
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
1870
|
+
end
|
|
1871
|
+
|
|
1688
1872
|
##
|
|
1689
1873
|
# Configuration class for the SecretManagerService API.
|
|
1690
1874
|
#
|
|
@@ -1945,6 +2129,16 @@ module Google
|
|
|
1945
2129
|
# @return [::Gapic::Config::Method]
|
|
1946
2130
|
#
|
|
1947
2131
|
attr_reader :test_iam_permissions
|
|
2132
|
+
##
|
|
2133
|
+
# RPC-specific configuration for `enable_managed_rotation`
|
|
2134
|
+
# @return [::Gapic::Config::Method]
|
|
2135
|
+
#
|
|
2136
|
+
attr_reader :enable_managed_rotation
|
|
2137
|
+
##
|
|
2138
|
+
# RPC-specific configuration for `rotate_secret`
|
|
2139
|
+
# @return [::Gapic::Config::Method]
|
|
2140
|
+
#
|
|
2141
|
+
attr_reader :rotate_secret
|
|
1948
2142
|
|
|
1949
2143
|
# @private
|
|
1950
2144
|
def initialize parent_rpcs = nil
|
|
@@ -1978,6 +2172,10 @@ module Google
|
|
|
1978
2172
|
@get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config
|
|
1979
2173
|
test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions
|
|
1980
2174
|
@test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config
|
|
2175
|
+
enable_managed_rotation_config = parent_rpcs.enable_managed_rotation if parent_rpcs.respond_to? :enable_managed_rotation
|
|
2176
|
+
@enable_managed_rotation = ::Gapic::Config::Method.new enable_managed_rotation_config
|
|
2177
|
+
rotate_secret_config = parent_rpcs.rotate_secret if parent_rpcs.respond_to? :rotate_secret
|
|
2178
|
+
@rotate_secret = ::Gapic::Config::Method.new rotate_secret_config
|
|
1981
2179
|
|
|
1982
2180
|
yield self if block_given?
|
|
1983
2181
|
end
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Copyright
|
|
3
|
+
# Copyright 2026 Google LLC
|
|
4
4
|
#
|
|
5
5
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
6
|
# you may not use this file except in compliance with the License.
|
|
@@ -1574,6 +1574,176 @@ module Google
|
|
|
1574
1574
|
raise ::Google::Cloud::Error.from_error(e)
|
|
1575
1575
|
end
|
|
1576
1576
|
|
|
1577
|
+
##
|
|
1578
|
+
# Enables the managed rotation feature for a
|
|
1579
|
+
# {::Google::Cloud::SecretManager::V1::Secret Secret}. This method can only be
|
|
1580
|
+
# triggered once for a secret. In order to do further rotations, RotateSecret
|
|
1581
|
+
# should be used. This method will add a secret version and update the
|
|
1582
|
+
# password in Cloud SQL.
|
|
1583
|
+
#
|
|
1584
|
+
# @overload enable_managed_rotation(request, options = nil)
|
|
1585
|
+
# Pass arguments to `enable_managed_rotation` via a request object, either of type
|
|
1586
|
+
# {::Google::Cloud::SecretManager::V1::EnableManagedRotationRequest} or an equivalent Hash.
|
|
1587
|
+
#
|
|
1588
|
+
# @param request [::Google::Cloud::SecretManager::V1::EnableManagedRotationRequest, ::Hash]
|
|
1589
|
+
# A request object representing the call parameters. Required. To specify no
|
|
1590
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
1591
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
1592
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
1593
|
+
#
|
|
1594
|
+
# @overload enable_managed_rotation(parent: nil, cloud_sql_single_user_credentials: nil)
|
|
1595
|
+
# Pass arguments to `enable_managed_rotation` via keyword arguments. Note that at
|
|
1596
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
1597
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
1598
|
+
#
|
|
1599
|
+
# @param parent [::String]
|
|
1600
|
+
# Required. The resource name of the
|
|
1601
|
+
# {::Google::Cloud::SecretManager::V1::Secret Secret} to associate with the
|
|
1602
|
+
# {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format
|
|
1603
|
+
# `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`.
|
|
1604
|
+
# @param cloud_sql_single_user_credentials [::Google::Cloud::SecretManager::V1::EnableManagedRotationRequest::CloudSQLSingleUserCredentials, ::Hash]
|
|
1605
|
+
# Credentials required for Cloud SQL DB for Single user Managed Rotation.
|
|
1606
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
1607
|
+
# @yieldparam result [::Google::Cloud::SecretManager::V1::SecretVersion]
|
|
1608
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
1609
|
+
#
|
|
1610
|
+
# @return [::Google::Cloud::SecretManager::V1::SecretVersion]
|
|
1611
|
+
#
|
|
1612
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
|
1613
|
+
#
|
|
1614
|
+
# @example Basic example
|
|
1615
|
+
# require "google/cloud/secret_manager/v1"
|
|
1616
|
+
#
|
|
1617
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
1618
|
+
# client = Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new
|
|
1619
|
+
#
|
|
1620
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
1621
|
+
# request = Google::Cloud::SecretManager::V1::EnableManagedRotationRequest.new
|
|
1622
|
+
#
|
|
1623
|
+
# # Call the enable_managed_rotation method.
|
|
1624
|
+
# result = client.enable_managed_rotation request
|
|
1625
|
+
#
|
|
1626
|
+
# # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion.
|
|
1627
|
+
# p result
|
|
1628
|
+
#
|
|
1629
|
+
def enable_managed_rotation request, options = nil
|
|
1630
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
1631
|
+
|
|
1632
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::EnableManagedRotationRequest
|
|
1633
|
+
|
|
1634
|
+
# Converts hash and nil to an options object
|
|
1635
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
1636
|
+
|
|
1637
|
+
# Customize the options with defaults
|
|
1638
|
+
call_metadata = @config.rpcs.enable_managed_rotation.metadata.to_h
|
|
1639
|
+
|
|
1640
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
1641
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
1642
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
1643
|
+
gapic_version: ::Google::Cloud::SecretManager::V1::VERSION,
|
|
1644
|
+
transports_version_send: [:rest]
|
|
1645
|
+
|
|
1646
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
1647
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
1648
|
+
|
|
1649
|
+
options.apply_defaults timeout: @config.rpcs.enable_managed_rotation.timeout,
|
|
1650
|
+
metadata: call_metadata,
|
|
1651
|
+
retry_policy: @config.rpcs.enable_managed_rotation.retry_policy
|
|
1652
|
+
|
|
1653
|
+
options.apply_defaults timeout: @config.timeout,
|
|
1654
|
+
metadata: @config.metadata,
|
|
1655
|
+
retry_policy: @config.retry_policy
|
|
1656
|
+
|
|
1657
|
+
@secret_manager_service_stub.enable_managed_rotation request, options do |result, operation|
|
|
1658
|
+
yield result, operation if block_given?
|
|
1659
|
+
end
|
|
1660
|
+
rescue ::Gapic::Rest::Error => e
|
|
1661
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
1662
|
+
end
|
|
1663
|
+
|
|
1664
|
+
##
|
|
1665
|
+
# Do a managed rotation for a {::Google::Cloud::SecretManager::V1::Secret Secret}.
|
|
1666
|
+
# This can only be triggered after Managed rotation has been enabled.
|
|
1667
|
+
# This method will add a secret version and update the password in Cloud SQL.
|
|
1668
|
+
#
|
|
1669
|
+
# @overload rotate_secret(request, options = nil)
|
|
1670
|
+
# Pass arguments to `rotate_secret` via a request object, either of type
|
|
1671
|
+
# {::Google::Cloud::SecretManager::V1::RotateSecretRequest} or an equivalent Hash.
|
|
1672
|
+
#
|
|
1673
|
+
# @param request [::Google::Cloud::SecretManager::V1::RotateSecretRequest, ::Hash]
|
|
1674
|
+
# A request object representing the call parameters. Required. To specify no
|
|
1675
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
1676
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
1677
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
1678
|
+
#
|
|
1679
|
+
# @overload rotate_secret(parent: nil)
|
|
1680
|
+
# Pass arguments to `rotate_secret` via keyword arguments. Note that at
|
|
1681
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
1682
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
1683
|
+
#
|
|
1684
|
+
# @param parent [::String]
|
|
1685
|
+
# Required. The resource name of the
|
|
1686
|
+
# {::Google::Cloud::SecretManager::V1::Secret Secret} to associate with the
|
|
1687
|
+
# {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format
|
|
1688
|
+
# `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`.
|
|
1689
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
1690
|
+
# @yieldparam result [::Google::Cloud::SecretManager::V1::SecretVersion]
|
|
1691
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
1692
|
+
#
|
|
1693
|
+
# @return [::Google::Cloud::SecretManager::V1::SecretVersion]
|
|
1694
|
+
#
|
|
1695
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
|
1696
|
+
#
|
|
1697
|
+
# @example Basic example
|
|
1698
|
+
# require "google/cloud/secret_manager/v1"
|
|
1699
|
+
#
|
|
1700
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
1701
|
+
# client = Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new
|
|
1702
|
+
#
|
|
1703
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
1704
|
+
# request = Google::Cloud::SecretManager::V1::RotateSecretRequest.new
|
|
1705
|
+
#
|
|
1706
|
+
# # Call the rotate_secret method.
|
|
1707
|
+
# result = client.rotate_secret request
|
|
1708
|
+
#
|
|
1709
|
+
# # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion.
|
|
1710
|
+
# p result
|
|
1711
|
+
#
|
|
1712
|
+
def rotate_secret request, options = nil
|
|
1713
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
1714
|
+
|
|
1715
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::RotateSecretRequest
|
|
1716
|
+
|
|
1717
|
+
# Converts hash and nil to an options object
|
|
1718
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
1719
|
+
|
|
1720
|
+
# Customize the options with defaults
|
|
1721
|
+
call_metadata = @config.rpcs.rotate_secret.metadata.to_h
|
|
1722
|
+
|
|
1723
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
1724
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
1725
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
1726
|
+
gapic_version: ::Google::Cloud::SecretManager::V1::VERSION,
|
|
1727
|
+
transports_version_send: [:rest]
|
|
1728
|
+
|
|
1729
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
1730
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
1731
|
+
|
|
1732
|
+
options.apply_defaults timeout: @config.rpcs.rotate_secret.timeout,
|
|
1733
|
+
metadata: call_metadata,
|
|
1734
|
+
retry_policy: @config.rpcs.rotate_secret.retry_policy
|
|
1735
|
+
|
|
1736
|
+
options.apply_defaults timeout: @config.timeout,
|
|
1737
|
+
metadata: @config.metadata,
|
|
1738
|
+
retry_policy: @config.retry_policy
|
|
1739
|
+
|
|
1740
|
+
@secret_manager_service_stub.rotate_secret request, options do |result, operation|
|
|
1741
|
+
yield result, operation if block_given?
|
|
1742
|
+
end
|
|
1743
|
+
rescue ::Gapic::Rest::Error => e
|
|
1744
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
1745
|
+
end
|
|
1746
|
+
|
|
1577
1747
|
##
|
|
1578
1748
|
# Configuration class for the SecretManagerService REST API.
|
|
1579
1749
|
#
|
|
@@ -1804,6 +1974,16 @@ module Google
|
|
|
1804
1974
|
# @return [::Gapic::Config::Method]
|
|
1805
1975
|
#
|
|
1806
1976
|
attr_reader :test_iam_permissions
|
|
1977
|
+
##
|
|
1978
|
+
# RPC-specific configuration for `enable_managed_rotation`
|
|
1979
|
+
# @return [::Gapic::Config::Method]
|
|
1980
|
+
#
|
|
1981
|
+
attr_reader :enable_managed_rotation
|
|
1982
|
+
##
|
|
1983
|
+
# RPC-specific configuration for `rotate_secret`
|
|
1984
|
+
# @return [::Gapic::Config::Method]
|
|
1985
|
+
#
|
|
1986
|
+
attr_reader :rotate_secret
|
|
1807
1987
|
|
|
1808
1988
|
# @private
|
|
1809
1989
|
def initialize parent_rpcs = nil
|
|
@@ -1837,6 +2017,10 @@ module Google
|
|
|
1837
2017
|
@get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config
|
|
1838
2018
|
test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions
|
|
1839
2019
|
@test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config
|
|
2020
|
+
enable_managed_rotation_config = parent_rpcs.enable_managed_rotation if parent_rpcs.respond_to? :enable_managed_rotation
|
|
2021
|
+
@enable_managed_rotation = ::Gapic::Config::Method.new enable_managed_rotation_config
|
|
2022
|
+
rotate_secret_config = parent_rpcs.rotate_secret if parent_rpcs.respond_to? :rotate_secret
|
|
2023
|
+
@rotate_secret = ::Gapic::Config::Method.new rotate_secret_config
|
|
1840
2024
|
|
|
1841
2025
|
yield self if block_given?
|
|
1842
2026
|
end
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Copyright
|
|
3
|
+
# Copyright 2026 Google LLC
|
|
4
4
|
#
|
|
5
5
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
6
|
# you may not use this file except in compliance with the License.
|
|
@@ -673,6 +673,86 @@ module Google
|
|
|
673
673
|
end
|
|
674
674
|
end
|
|
675
675
|
|
|
676
|
+
##
|
|
677
|
+
# Baseline implementation for the enable_managed_rotation REST call
|
|
678
|
+
#
|
|
679
|
+
# @param request_pb [::Google::Cloud::SecretManager::V1::EnableManagedRotationRequest]
|
|
680
|
+
# A request object representing the call parameters. Required.
|
|
681
|
+
# @param options [::Gapic::CallOptions]
|
|
682
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
683
|
+
#
|
|
684
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
685
|
+
# @yieldparam result [::Google::Cloud::SecretManager::V1::SecretVersion]
|
|
686
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
687
|
+
#
|
|
688
|
+
# @return [::Google::Cloud::SecretManager::V1::SecretVersion]
|
|
689
|
+
# A result object deserialized from the server's reply
|
|
690
|
+
def enable_managed_rotation request_pb, options = nil
|
|
691
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
|
692
|
+
|
|
693
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_enable_managed_rotation_request request_pb
|
|
694
|
+
query_string_params = if query_string_params.any?
|
|
695
|
+
query_string_params.to_h { |p| p.split "=", 2 }
|
|
696
|
+
else
|
|
697
|
+
{}
|
|
698
|
+
end
|
|
699
|
+
|
|
700
|
+
response = @client_stub.make_http_request(
|
|
701
|
+
verb,
|
|
702
|
+
uri: uri,
|
|
703
|
+
body: body || "",
|
|
704
|
+
params: query_string_params,
|
|
705
|
+
method_name: "enable_managed_rotation",
|
|
706
|
+
options: options
|
|
707
|
+
)
|
|
708
|
+
operation = ::Gapic::Rest::TransportOperation.new response
|
|
709
|
+
result = ::Google::Cloud::SecretManager::V1::SecretVersion.decode_json response.body, ignore_unknown_fields: true
|
|
710
|
+
catch :response do
|
|
711
|
+
yield result, operation if block_given?
|
|
712
|
+
result
|
|
713
|
+
end
|
|
714
|
+
end
|
|
715
|
+
|
|
716
|
+
##
|
|
717
|
+
# Baseline implementation for the rotate_secret REST call
|
|
718
|
+
#
|
|
719
|
+
# @param request_pb [::Google::Cloud::SecretManager::V1::RotateSecretRequest]
|
|
720
|
+
# A request object representing the call parameters. Required.
|
|
721
|
+
# @param options [::Gapic::CallOptions]
|
|
722
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
723
|
+
#
|
|
724
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
725
|
+
# @yieldparam result [::Google::Cloud::SecretManager::V1::SecretVersion]
|
|
726
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
727
|
+
#
|
|
728
|
+
# @return [::Google::Cloud::SecretManager::V1::SecretVersion]
|
|
729
|
+
# A result object deserialized from the server's reply
|
|
730
|
+
def rotate_secret request_pb, options = nil
|
|
731
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
|
732
|
+
|
|
733
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_rotate_secret_request request_pb
|
|
734
|
+
query_string_params = if query_string_params.any?
|
|
735
|
+
query_string_params.to_h { |p| p.split "=", 2 }
|
|
736
|
+
else
|
|
737
|
+
{}
|
|
738
|
+
end
|
|
739
|
+
|
|
740
|
+
response = @client_stub.make_http_request(
|
|
741
|
+
verb,
|
|
742
|
+
uri: uri,
|
|
743
|
+
body: body || "",
|
|
744
|
+
params: query_string_params,
|
|
745
|
+
method_name: "rotate_secret",
|
|
746
|
+
options: options
|
|
747
|
+
)
|
|
748
|
+
operation = ::Gapic::Rest::TransportOperation.new response
|
|
749
|
+
result = ::Google::Cloud::SecretManager::V1::SecretVersion.decode_json response.body, ignore_unknown_fields: true
|
|
750
|
+
catch :response do
|
|
751
|
+
yield result, operation if block_given?
|
|
752
|
+
result
|
|
753
|
+
end
|
|
754
|
+
end
|
|
755
|
+
|
|
676
756
|
##
|
|
677
757
|
# @private
|
|
678
758
|
#
|
|
@@ -1108,6 +1188,66 @@ module Google
|
|
|
1108
1188
|
)
|
|
1109
1189
|
transcoder.transcode request_pb
|
|
1110
1190
|
end
|
|
1191
|
+
|
|
1192
|
+
##
|
|
1193
|
+
# @private
|
|
1194
|
+
#
|
|
1195
|
+
# GRPC transcoding helper method for the enable_managed_rotation REST call
|
|
1196
|
+
#
|
|
1197
|
+
# @param request_pb [::Google::Cloud::SecretManager::V1::EnableManagedRotationRequest]
|
|
1198
|
+
# A request object representing the call parameters. Required.
|
|
1199
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
|
1200
|
+
# Uri, Body, Query string parameters
|
|
1201
|
+
def self.transcode_enable_managed_rotation_request request_pb
|
|
1202
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
|
1203
|
+
.with_bindings(
|
|
1204
|
+
uri_method: :post,
|
|
1205
|
+
uri_template: "/v1/{parent}:enableManagedRotation",
|
|
1206
|
+
body: "*",
|
|
1207
|
+
matches: [
|
|
1208
|
+
["parent", %r{^projects/[^/]+/secrets/[^/]+/?$}, false]
|
|
1209
|
+
]
|
|
1210
|
+
)
|
|
1211
|
+
.with_bindings(
|
|
1212
|
+
uri_method: :post,
|
|
1213
|
+
uri_template: "/v1/{parent}:enableManagedRotation",
|
|
1214
|
+
body: "*",
|
|
1215
|
+
matches: [
|
|
1216
|
+
["parent", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/?$}, false]
|
|
1217
|
+
]
|
|
1218
|
+
)
|
|
1219
|
+
transcoder.transcode request_pb
|
|
1220
|
+
end
|
|
1221
|
+
|
|
1222
|
+
##
|
|
1223
|
+
# @private
|
|
1224
|
+
#
|
|
1225
|
+
# GRPC transcoding helper method for the rotate_secret REST call
|
|
1226
|
+
#
|
|
1227
|
+
# @param request_pb [::Google::Cloud::SecretManager::V1::RotateSecretRequest]
|
|
1228
|
+
# A request object representing the call parameters. Required.
|
|
1229
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
|
1230
|
+
# Uri, Body, Query string parameters
|
|
1231
|
+
def self.transcode_rotate_secret_request request_pb
|
|
1232
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
|
1233
|
+
.with_bindings(
|
|
1234
|
+
uri_method: :post,
|
|
1235
|
+
uri_template: "/v1/{parent}:rotateSecret",
|
|
1236
|
+
body: "*",
|
|
1237
|
+
matches: [
|
|
1238
|
+
["parent", %r{^projects/[^/]+/secrets/[^/]+/?$}, false]
|
|
1239
|
+
]
|
|
1240
|
+
)
|
|
1241
|
+
.with_bindings(
|
|
1242
|
+
uri_method: :post,
|
|
1243
|
+
uri_template: "/v1/{parent}:rotateSecret",
|
|
1244
|
+
body: "*",
|
|
1245
|
+
matches: [
|
|
1246
|
+
["parent", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/?$}, false]
|
|
1247
|
+
]
|
|
1248
|
+
)
|
|
1249
|
+
transcoder.transcode request_pb
|
|
1250
|
+
end
|
|
1111
1251
|
end
|
|
1112
1252
|
end
|
|
1113
1253
|
end
|