Skip to content

Commit

Permalink
feat: introduce Long-Running Operations (LRO) for KMS
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 631049366
  • Loading branch information
Google APIs authored and Copybara-Service committed May 6, 2024
1 parent 245c0f5 commit abe82f8
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 24 deletions.
54 changes: 33 additions & 21 deletions google/cloud/kms/v1/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
load("@rules_proto//proto:defs.bzl", "proto_library")
# This file was automatically generated by BuildFileGenerator
# https://github.com/googleapis/rules_gapic/tree/master/bazel

# Most of the manual changes to this file will be overwritten.
# It's **only** allowed to change the following rule attribute values:
# - names of *_gapic_assembly_* rules
# - certain parameters of *_gapic_library rules, including but not limited to:
# * extra_protoc_parameters
# * extra_protoc_file_parameters
# The complete list of preserved parameters can be found in the source code.

# buildifier: disable=load-on-top

# This is an API workspace, having public visibility by default makes perfect sense.
package(default_visibility = ["//visibility:public"])

# Reading the default service config is useful for custom gRPC clients.
exports_files(["cloudkms_grpc_service_config.json"])

##############################################################################
# Common
##############################################################################
# buildifier: disable=load-on-top
# buildifier: disable=same-origin-load
load("@com_google_googleapis_imports//:imports.bzl", "proto_library_with_info")
load("@rules_proto//proto:defs.bzl", "proto_library")

proto_library(
name = "kms_proto",
Expand All @@ -24,9 +33,9 @@ proto_library(
"//google/api:client_proto",
"//google/api:field_behavior_proto",
"//google/api:resource_proto",
"//google/longrunning:operations_proto",
"@com_google_protobuf//:duration_proto",
"@com_google_protobuf//:field_mask_proto",
"@com_google_protobuf//:struct_proto",
"@com_google_protobuf//:timestamp_proto",
"@com_google_protobuf//:wrappers_proto",
],
Expand All @@ -39,14 +48,12 @@ proto_library_with_info(
"//google/cloud:common_resources_proto",
"//google/cloud/location:location_proto",
"//google/iam/v1:iam_policy_proto",
"//google/iam/v1:policy_proto",
],
)

##############################################################################
# Java
##############################################################################
# buildifier: disable=load-on-top
# buildifier: disable=same-origin-load
load(
"@com_google_googleapis_imports//:imports.bzl",
Expand All @@ -71,6 +78,7 @@ java_grpc_library(
java_gapic_library(
name = "kms_java_gapic",
srcs = [":kms_proto_with_info"],
gapic_yaml = None,
grpc_service_config = "cloudkms_grpc_service_config.json",
rest_numeric_enums = True,
service_yaml = "cloudkms_v1.yaml",
Expand All @@ -82,6 +90,7 @@ java_gapic_library(
transport = "grpc+rest",
deps = [
":kms_java_proto",
"//google/api:api_java_proto",
"//google/cloud/location:location_java_proto",
"//google/iam/v1:iam_java_proto",
],
Expand All @@ -90,6 +99,8 @@ java_gapic_library(
java_gapic_test(
name = "kms_java_gapic_test_suite",
test_classes = [
"com.google.cloud.kms.v1.EkmServiceClientHttpJsonTest",
"com.google.cloud.kms.v1.EkmServiceClientTest",
"com.google.cloud.kms.v1.KeyManagementServiceClientHttpJsonTest",
"com.google.cloud.kms.v1.KeyManagementServiceClientTest",
],
Expand All @@ -112,7 +123,6 @@ java_gapic_assembly_gradle_pkg(
##############################################################################
# Go
##############################################################################
# buildifier: disable=load-on-top
# buildifier: disable=same-origin-load
load(
"@com_google_googleapis_imports//:imports.bzl",
Expand All @@ -128,7 +138,7 @@ go_proto_library(
protos = [":kms_proto"],
deps = [
"//google/api:annotations_go_proto",
"//google/iam/v1:iam_go_proto",
"//google/longrunning:longrunning_go_proto",
],
)

Expand All @@ -146,6 +156,9 @@ go_gapic_library(
":kms_go_proto",
"//google/cloud/location:location_go_proto",
"//google/iam/v1:iam_go_proto",
"//google/longrunning:longrunning_go_proto",
"@com_google_cloud_go_longrunning//:go_default_library",
"@com_google_cloud_go_longrunning//autogen:go_default_library",
"@io_bazel_rules_go//proto/wkt:duration_go_proto",
],
)
Expand All @@ -155,6 +168,7 @@ go_gapic_assembly_pkg(
name = "gapi-cloud-kms-v1-go",
deps = [
":kms_go_gapic",
":kms_go_gapic_srcjar-metadata.srcjar",
":kms_go_gapic_srcjar-snippets.srcjar",
":kms_go_gapic_srcjar-test.srcjar",
":kms_go_proto",
Expand All @@ -164,7 +178,6 @@ go_gapic_assembly_pkg(
##############################################################################
# Python
##############################################################################
# buildifier: disable=load-on-top
# buildifier: disable=same-origin-load
load(
"@com_google_googleapis_imports//:imports.bzl",
Expand All @@ -190,7 +203,6 @@ py_gapic_library(
transport = "grpc+rest",
deps = [
"//google/iam/v1:iam_policy_py_proto",
"//google/iam/v1:policy_py_proto",
],
)

Expand All @@ -204,6 +216,7 @@ py_test(
deps = [":kms_py_gapic"],
)

# Open Source Packages
py_gapic_assembly_pkg(
name = "kms-v1-py",
deps = [
Expand All @@ -214,7 +227,6 @@ py_gapic_assembly_pkg(
##############################################################################
# PHP
##############################################################################
# buildifier: disable=load-on-top
# buildifier: disable=same-origin-load
load(
"@com_google_googleapis_imports//:imports.bzl",
Expand All @@ -231,11 +243,14 @@ php_proto_library(
php_gapic_library(
name = "kms_php_gapic",
srcs = [":kms_proto_with_info"],
grpc_service_config = "cloudkms_grpc_service_config.json",
migration_mode = "MIGRATING",
rest_numeric_enums = True,
service_yaml = "cloudkms_v1.yaml",
transport = "grpc+rest",
deps = [":kms_php_proto"],
deps = [
":kms_php_proto",
],
)

# Open Source Packages
Expand All @@ -250,7 +265,6 @@ php_gapic_assembly_pkg(
##############################################################################
# Node.js
##############################################################################
# buildifier: disable=load-on-top
# buildifier: disable=same-origin-load
load(
"@com_google_googleapis_imports//:imports.bzl",
Expand Down Expand Up @@ -282,7 +296,6 @@ nodejs_gapic_assembly_pkg(
##############################################################################
# Ruby
##############################################################################
# buildifier: disable=load-on-top
# buildifier: disable=same-origin-load
load(
"@com_google_googleapis_imports//:imports.bzl",
Expand All @@ -307,11 +320,11 @@ ruby_cloud_gapic_library(
name = "kms_ruby_gapic",
srcs = [":kms_proto_with_info"],
extra_protoc_parameters = [
"ruby-cloud-gem-name=google-cloud-kms-v1",
"ruby-cloud-env-prefix=KMS",
"ruby-cloud-product-url=https://cloud.google.com/kms",
"ruby-cloud-api-id=cloudkms.googleapis.com",
"ruby-cloud-api-shortname=cloudkms",
"ruby-cloud-env-prefix=KMS",
"ruby-cloud-gem-name=google-cloud-kms-v1",
"ruby-cloud-product-url=https://cloud.google.com/kms",
],
grpc_service_config = "cloudkms_grpc_service_config.json",
rest_numeric_enums = True,
Expand All @@ -338,7 +351,6 @@ ruby_gapic_assembly_pkg(
##############################################################################
# C#
##############################################################################
# buildifier: disable=load-on-top
# buildifier: disable=same-origin-load
load(
"@com_google_googleapis_imports//:imports.bzl",
Expand All @@ -350,6 +362,7 @@ load(

csharp_proto_library(
name = "kms_csharp_proto",
extra_opts = [],
deps = [":kms_proto"],
)

Expand Down Expand Up @@ -386,7 +399,6 @@ csharp_gapic_assembly_pkg(
##############################################################################
# C++
##############################################################################
# buildifier: disable=load-on-top
# buildifier: disable=same-origin-load
load(
"@com_google_googleapis_imports//:imports.bzl",
Expand Down
7 changes: 7 additions & 0 deletions google/cloud/kms/v1/cloudkms_v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ http:
body: '*'
- post: '/v1/{resource=projects/*/locations/*/ekmConnections/*}:testIamPermissions'
body: '*'
- selector: google.longrunning.Operations.GetOperation
get: '/v1/{name=projects/*/locations/*/operations/*}'

authentication:
rules:
Expand Down Expand Up @@ -112,3 +114,8 @@ authentication:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform,
https://www.googleapis.com/auth/cloudkms
- selector: google.longrunning.Operations.GetOperation
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform,
https://www.googleapis.com/auth/cloudkms
2 changes: 1 addition & 1 deletion google/cloud/kms/v1/ekm_service.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion google/cloud/kms/v1/resources.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion google/cloud/kms/v1/service.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down

0 comments on commit abe82f8

Please sign in to comment.