Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions google-cloud-kms-v1/.owlbot-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,11 @@
"lib/google/cloud/kms/v1/key_management_service.rb",
"lib/google/cloud/kms/v1/key_management_service/client.rb",
"lib/google/cloud/kms/v1/key_management_service/credentials.rb",
"lib/google/cloud/kms/v1/key_management_service/operations.rb",
"lib/google/cloud/kms/v1/key_management_service/paths.rb",
"lib/google/cloud/kms/v1/key_management_service/rest.rb",
"lib/google/cloud/kms/v1/key_management_service/rest/client.rb",
"lib/google/cloud/kms/v1/key_management_service/rest/operations.rb",
"lib/google/cloud/kms/v1/key_management_service/rest/service_stub.rb",
"lib/google/cloud/kms/v1/resources_pb.rb",
"lib/google/cloud/kms/v1/rest.rb",
Expand Down Expand Up @@ -119,6 +121,8 @@
"snippets/key_management_service/create_key_ring.rb",
"snippets/key_management_service/decapsulate.rb",
"snippets/key_management_service/decrypt.rb",
"snippets/key_management_service/delete_crypto_key.rb",
"snippets/key_management_service/delete_crypto_key_version.rb",
"snippets/key_management_service/destroy_crypto_key_version.rb",
"snippets/key_management_service/encrypt.rb",
"snippets/key_management_service/generate_random_bytes.rb",
Expand All @@ -127,11 +131,13 @@
"snippets/key_management_service/get_import_job.rb",
"snippets/key_management_service/get_key_ring.rb",
"snippets/key_management_service/get_public_key.rb",
"snippets/key_management_service/get_retired_resource.rb",
"snippets/key_management_service/import_crypto_key_version.rb",
"snippets/key_management_service/list_crypto_key_versions.rb",
"snippets/key_management_service/list_crypto_keys.rb",
"snippets/key_management_service/list_import_jobs.rb",
"snippets/key_management_service/list_key_rings.rb",
"snippets/key_management_service/list_retired_resources.rb",
"snippets/key_management_service/mac_sign.rb",
"snippets/key_management_service/mac_verify.rb",
"snippets/key_management_service/raw_decrypt.rb",
Expand All @@ -155,6 +161,7 @@
"test/google/cloud/kms/v1/hsm_management_paths_test.rb",
"test/google/cloud/kms/v1/hsm_management_rest_test.rb",
"test/google/cloud/kms/v1/hsm_management_test.rb",
"test/google/cloud/kms/v1/key_management_service_operations_test.rb",
"test/google/cloud/kms/v1/key_management_service_paths_test.rb",
"test/google/cloud/kms/v1/key_management_service_rest_test.rb",
"test/google/cloud/kms/v1/key_management_service_test.rb",
Expand Down
20 changes: 20 additions & 0 deletions google-cloud-kms-v1/gapic_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,11 @@
"list_import_jobs"
]
},
"ListRetiredResources": {
"methods": [
"list_retired_resources"
]
},
"GetKeyRing": {
"methods": [
"get_key_ring"
Expand All @@ -201,6 +206,11 @@
"get_import_job"
]
},
"GetRetiredResource": {
"methods": [
"get_retired_resource"
]
},
"CreateKeyRing": {
"methods": [
"create_key_ring"
Expand All @@ -216,6 +226,16 @@
"create_crypto_key_version"
]
},
"DeleteCryptoKey": {
"methods": [
"delete_crypto_key"
]
},
"DeleteCryptoKeyVersion": {
"methods": [
"delete_crypto_key_version"
]
},
"ImportCryptoKeyVersion": {
"methods": [
"import_crypto_key_version"
Expand Down
16 changes: 9 additions & 7 deletions google-cloud-kms-v1/lib/google/cloud/kms/v1/autokey_admin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,15 @@ module Kms
module V1
##
# Provides interfaces for managing [Cloud KMS
# Autokey](https://cloud.google.com/kms/help/autokey) folder-level
# configurations. A configuration is inherited by all descendent projects. A
# configuration at one folder overrides any other configurations in its
# ancestry. Setting a configuration on a folder is a prerequisite for Cloud KMS
# Autokey, so that users working in a descendant project can request
# provisioned {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys}, ready for Customer
# Managed Encryption Key (CMEK) use, on-demand.
# Autokey](https://cloud.google.com/kms/help/autokey) folder-level or
# project-level configurations. A configuration is inherited by all descendent
# folders and projects. A configuration at a folder or project overrides any
# other configurations in its ancestry. Setting a configuration on a folder is
# a prerequisite for Cloud KMS Autokey, so that users working in a descendant
# project can request provisioned {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys},
# ready for Customer Managed Encryption Key (CMEK) use, on-demand when using
# the dedicated key project mode. This is not required when using the delegated
# key management mode for same-project keys.
#
# @example Load this service and instantiate a gRPC client
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@ module AutokeyAdmin
# Client for the AutokeyAdmin service.
#
# Provides interfaces for managing [Cloud KMS
# Autokey](https://cloud.google.com/kms/help/autokey) folder-level
# configurations. A configuration is inherited by all descendent projects. A
# configuration at one folder overrides any other configurations in its
# ancestry. Setting a configuration on a folder is a prerequisite for Cloud KMS
# Autokey, so that users working in a descendant project can request
# provisioned {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys}, ready for Customer
# Managed Encryption Key (CMEK) use, on-demand.
# Autokey](https://cloud.google.com/kms/help/autokey) folder-level or
# project-level configurations. A configuration is inherited by all descendent
# folders and projects. A configuration at a folder or project overrides any
# other configurations in its ancestry. Setting a configuration on a folder is
# a prerequisite for Cloud KMS Autokey, so that users working in a descendant
# project can request provisioned {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys},
# ready for Customer Managed Encryption Key (CMEK) use, on-demand when using
# the dedicated key project mode. This is not required when using the delegated
# key management mode for same-project keys.
#
class Client
# @private
Expand Down Expand Up @@ -238,8 +240,8 @@ def logger
# Service calls

##
# Updates the {::Google::Cloud::Kms::V1::AutokeyConfig AutokeyConfig} for a
# folder. The caller must have both `cloudkms.autokeyConfigs.update`
# Updates the {::Google::Cloud::Kms::V1::AutokeyConfig AutokeyConfig} for a folder
# or a project. The caller must have both `cloudkms.autokeyConfigs.update`
# permission on the parent folder and `cloudkms.cryptoKeys.setIamPolicy`
# permission on the provided key project. A
# {::Google::Cloud::Kms::V1::KeyHandle KeyHandle} creation in the folder's
Expand Down Expand Up @@ -334,8 +336,8 @@ def update_autokey_config request, options = nil
end

##
# Returns the {::Google::Cloud::Kms::V1::AutokeyConfig AutokeyConfig} for a
# folder.
# Returns the {::Google::Cloud::Kms::V1::AutokeyConfig AutokeyConfig} for a folder
# or project.
#
# @overload get_autokey_config(request, options = nil)
# Pass arguments to `get_autokey_config` via a request object, either of type
Expand All @@ -354,7 +356,8 @@ def update_autokey_config request, options = nil
#
# @param name [::String]
# Required. Name of the {::Google::Cloud::Kms::V1::AutokeyConfig AutokeyConfig}
# resource, e.g. `folders/{FOLDER_NUMBER}/autokeyConfig`.
# resource, e.g. `folders/{FOLDER_NUMBER}/autokeyConfig` or
# `projects/{PROJECT_NUMBER}/autokeyConfig`.
#
# @yield [response, operation] Access the result along with the RPC operation
# @yieldparam response [::Google::Cloud::Kms::V1::AutokeyConfig]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,34 @@ module Paths
##
# Create a fully-qualified AutokeyConfig resource string.
#
# The resource will be in the following format:
# @overload autokey_config_path(folder:)
# The resource will be in the following format:
#
# `folders/{folder}/autokeyConfig`
#
# @param folder [String]
#
# `folders/{folder}/autokeyConfig`
# @overload autokey_config_path(project:)
# The resource will be in the following format:
#
# @param folder [String]
# `projects/{project}/autokeyConfig`
#
# @param project [String]
#
# @return [::String]
def autokey_config_path folder:
"folders/#{folder}/autokeyConfig"
def autokey_config_path **args
resources = {
"folder" => (proc do |folder:|
"folders/#{folder}/autokeyConfig"
end),
"project" => (proc do |project:|
"projects/#{project}/autokeyConfig"
end)
}

resource = resources[args.keys.sort.join(":")]
raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
resource.call(**args)
end

##
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,15 @@ module Kms
module V1
##
# Provides interfaces for managing [Cloud KMS
# Autokey](https://cloud.google.com/kms/help/autokey) folder-level
# configurations. A configuration is inherited by all descendent projects. A
# configuration at one folder overrides any other configurations in its
# ancestry. Setting a configuration on a folder is a prerequisite for Cloud KMS
# Autokey, so that users working in a descendant project can request
# provisioned {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys}, ready for Customer
# Managed Encryption Key (CMEK) use, on-demand.
# Autokey](https://cloud.google.com/kms/help/autokey) folder-level or
# project-level configurations. A configuration is inherited by all descendent
# folders and projects. A configuration at a folder or project overrides any
# other configurations in its ancestry. Setting a configuration on a folder is
# a prerequisite for Cloud KMS Autokey, so that users working in a descendant
# project can request provisioned {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys},
# ready for Customer Managed Encryption Key (CMEK) use, on-demand when using
# the dedicated key project mode. This is not required when using the delegated
# key management mode for same-project keys.
#
# To load this service and instantiate a REST client:
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,15 @@ module Rest
# REST client for the AutokeyAdmin service.
#
# Provides interfaces for managing [Cloud KMS
# Autokey](https://cloud.google.com/kms/help/autokey) folder-level
# configurations. A configuration is inherited by all descendent projects. A
# configuration at one folder overrides any other configurations in its
# ancestry. Setting a configuration on a folder is a prerequisite for Cloud KMS
# Autokey, so that users working in a descendant project can request
# provisioned {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys}, ready for Customer
# Managed Encryption Key (CMEK) use, on-demand.
# Autokey](https://cloud.google.com/kms/help/autokey) folder-level or
# project-level configurations. A configuration is inherited by all descendent
# folders and projects. A configuration at a folder or project overrides any
# other configurations in its ancestry. Setting a configuration on a folder is
# a prerequisite for Cloud KMS Autokey, so that users working in a descendant
# project can request provisioned {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys},
# ready for Customer Managed Encryption Key (CMEK) use, on-demand when using
# the dedicated key project mode. This is not required when using the delegated
# key management mode for same-project keys.
#
class Client
# @private
Expand Down Expand Up @@ -233,8 +235,8 @@ def logger
# Service calls

##
# Updates the {::Google::Cloud::Kms::V1::AutokeyConfig AutokeyConfig} for a
# folder. The caller must have both `cloudkms.autokeyConfigs.update`
# Updates the {::Google::Cloud::Kms::V1::AutokeyConfig AutokeyConfig} for a folder
# or a project. The caller must have both `cloudkms.autokeyConfigs.update`
# permission on the parent folder and `cloudkms.cryptoKeys.setIamPolicy`
# permission on the provided key project. A
# {::Google::Cloud::Kms::V1::KeyHandle KeyHandle} creation in the folder's
Expand Down Expand Up @@ -322,8 +324,8 @@ def update_autokey_config request, options = nil
end

##
# Returns the {::Google::Cloud::Kms::V1::AutokeyConfig AutokeyConfig} for a
# folder.
# Returns the {::Google::Cloud::Kms::V1::AutokeyConfig AutokeyConfig} for a folder
# or project.
#
# @overload get_autokey_config(request, options = nil)
# Pass arguments to `get_autokey_config` via a request object, either of type
Expand All @@ -342,7 +344,8 @@ def update_autokey_config request, options = nil
#
# @param name [::String]
# Required. Name of the {::Google::Cloud::Kms::V1::AutokeyConfig AutokeyConfig}
# resource, e.g. `folders/{FOLDER_NUMBER}/autokeyConfig`.
# resource, e.g. `folders/{FOLDER_NUMBER}/autokeyConfig` or
# `projects/{PROJECT_NUMBER}/autokeyConfig`.
# @yield [result, operation] Access the result along with the TransportOperation object
# @yieldparam result [::Google::Cloud::Kms::V1::AutokeyConfig]
# @yieldparam operation [::Gapic::Rest::TransportOperation]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,14 @@ def self.transcode_update_autokey_config_request request_pb
["autokey_config.name", %r{^folders/[^/]+/autokeyConfig/?$}, false]
]
)
.with_bindings(
uri_method: :patch,
uri_template: "/v1/{autokey_config.name}",
body: "autokey_config",
matches: [
["autokey_config.name", %r{^projects/[^/]+/autokeyConfig/?$}, false]
]
)
transcoder.transcode request_pb
end

Expand All @@ -233,6 +241,13 @@ def self.transcode_get_autokey_config_request request_pb
["name", %r{^folders/[^/]+/autokeyConfig/?$}, false]
]
)
.with_bindings(
uri_method: :get,
uri_template: "/v1/{name}",
matches: [
["name", %r{^projects/[^/]+/autokeyConfig/?$}, false]
]
)
transcoder.transcode request_pb
end

Expand Down
Loading
Loading