-
Notifications
You must be signed in to change notification settings - Fork 388
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(iam): move iam_v2_policy_protos to a separate lib (#12413)
- Loading branch information
Showing
15 changed files
with
151 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,2 @@ | ||
@com_google_googleapis//google/iam/v1/logging:audit_data.proto | ||
@com_google_googleapis//google/iam/v1:iam_policy.proto | ||
@com_google_googleapis//google/iam/v1:options.proto | ||
@com_google_googleapis//google/iam/v1:policy.proto | ||
@com_google_googleapis//google/iam/v2:deny.proto | ||
@com_google_googleapis//google/iam/v2:policy.proto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
# ~~~ | ||
# Copyright 2023 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# ~~~ | ||
|
||
include(GoogleapisConfig) | ||
|
||
include(GoogleCloudCppCommon) | ||
|
||
include(CompileProtos) | ||
google_cloud_cpp_find_proto_include_dir(PROTO_INCLUDE_DIR) | ||
google_cloud_cpp_load_protolist( | ||
iam_policy_list | ||
"${PROJECT_SOURCE_DIR}/external/googleapis/protolists/iam_policy.list") | ||
google_cloud_cpp_load_protodeps( | ||
iam_policy_deps | ||
"${PROJECT_SOURCE_DIR}/external/googleapis/protodeps/iam_policy.deps") | ||
google_cloud_cpp_grpcpp_library( | ||
google_cloud_cpp_iam_policy_protos ${iam_policy_list} | ||
PROTO_PATH_DIRECTORIES "${EXTERNAL_GOOGLEAPIS_SOURCE}" | ||
"${PROTO_INCLUDE_DIR}") | ||
external_googleapis_set_version_and_alias(iam_policy_protos) | ||
target_link_libraries(google_cloud_cpp_iam_policy_protos | ||
PUBLIC ${iam_policy_deps}) | ||
|
||
# Get the destination directories based on the GNU recommendations. | ||
include(GNUInstallDirs) | ||
|
||
# Export the CMake targets to make it easy to create configuration files. | ||
install( | ||
EXPORT google_cloud_cpp_iam_policy-targets | ||
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/google_cloud_cpp_iam_policy" | ||
COMPONENT google_cloud_cpp_development) | ||
|
||
# Install the libraries and headers in the locations determined by | ||
# GNUInstallDirs | ||
install( | ||
TARGETS google_cloud_cpp_iam_policy_protos | ||
EXPORT google_cloud_cpp_iam_policy-targets | ||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} | ||
COMPONENT google_cloud_cpp_runtime | ||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
COMPONENT google_cloud_cpp_runtime | ||
NAMELINK_COMPONENT google_cloud_cpp_runtime | ||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
COMPONENT google_cloud_cpp_development) | ||
|
||
google_cloud_cpp_install_proto_library_protos( | ||
"google_cloud_cpp_iam_policy_protos" "${EXTERNAL_GOOGLEAPIS_SOURCE}") | ||
google_cloud_cpp_install_proto_library_headers( | ||
"google_cloud_cpp_iam_policy_protos") | ||
|
||
# Create and install the CMake configuration files. | ||
include(CMakePackageConfigHelpers) | ||
configure_file("config.cmake.in" "google_cloud_cpp_iam_policy-config.cmake" | ||
@ONLY) | ||
write_basic_package_version_file( | ||
"google_cloud_cpp_iam_policy-config-version.cmake" | ||
VERSION ${PROJECT_VERSION} | ||
COMPATIBILITY ExactVersion) | ||
|
||
install( | ||
FILES | ||
"${CMAKE_CURRENT_BINARY_DIR}/google_cloud_cpp_iam_policy-config.cmake" | ||
"${CMAKE_CURRENT_BINARY_DIR}/google_cloud_cpp_iam_policy-config-version.cmake" | ||
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/google_cloud_cpp_iam_policy" | ||
COMPONENT google_cloud_cpp_development) | ||
|
||
external_googleapis_install_pc("google_cloud_cpp_iam_policy_protos") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# IAM Policy Proto Libraries | ||
|
||
Several Google Cloud Platform services use the IAM Policy APIs and protocol | ||
buffer definitions. This directory contains CMake targets to generate the C++ | ||
libraries corresponding to this code. Customers are not expected to use these | ||
libraries directly (though they might), instead we recommend using the idiomatic | ||
C++ libraries for the GCP services. | ||
|
||
Please note that the Google Cloud C++ client libraries do **not** follow | ||
[Semantic Versioning](https://semver.org/). | ||
|
||
For detailed instructions on how to build and install this library, see the | ||
top-level [README](/README.md#building-and-installing). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Copyright 2023 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
include(CMakeFindDependencyMacro) | ||
# google_cloud_cpp_googleapis finds both gRPC and Protobuf, no need to load them here. | ||
find_dependency(google_cloud_cpp_googleapis) | ||
find_dependency(google_cloud_cpp_common) | ||
find_dependency(google_cloud_cpp_grpc_utils) | ||
find_dependency(absl) | ||
|
||
include("${CMAKE_CURRENT_LIST_DIR}/google_cloud_cpp_iam_policy-targets.cmake") |
FWIW, I think this was a breaking change. (Of the same variety as we are making for #8022).
Customers who used to link against
google_cloud_cpp_iam_protos
without building our IAM client library no longer have thegoogle::iam::v2::*
symbols.There is nothing that links
google_cloud_cpp_iam_protos
to the newgoogle_cloud_cpp_iam_policy_protos
.