diff options
author | juerg <juerg@google.com> | 2023-04-03 03:06:59 -0700 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2023-04-03 03:08:12 -0700 |
commit | f0b8018f7822e7925df731c6ea4f11e147c6941a (patch) | |
tree | a96902354b4aeb0f205f214b3b860a5435319876 /python | |
parent | 4c41d48aad3039705bd2787773173fffa166a34d (diff) | |
download | tink-f0b8018f7822e7925df731c6ea4f11e147c6941a.tar.gz |
Remove wrapping of C++ fake KMS client.
This is not needed anymore, since the fake KMS client is now implemented in Python.
PiperOrigin-RevId: 521408438
Diffstat (limited to 'python')
-rw-r--r-- | python/tink/cc/pybind/BUILD.bazel | 13 | ||||
-rw-r--r-- | python/tink/cc/pybind/cc_fake_kms_client_testonly.cc | 52 | ||||
-rw-r--r-- | python/tink/cc/pybind/cc_fake_kms_client_testonly.h | 31 | ||||
-rw-r--r-- | python/tink/cc/pybind/tink_bindings.cc | 3 |
4 files changed, 1 insertions, 98 deletions
diff --git a/python/tink/cc/pybind/BUILD.bazel b/python/tink/cc/pybind/BUILD.bazel index 0c5369ce9..285eac26a 100644 --- a/python/tink/cc/pybind/BUILD.bazel +++ b/python/tink/cc/pybind/BUILD.bazel @@ -278,18 +278,6 @@ tink_pybind_library( ], ) -tink_pybind_library( - name = "cc_fake_kms_client_testonly", - srcs = ["cc_fake_kms_client_testonly.cc"], - hdrs = ["cc_fake_kms_client_testonly.h"], - deps = [ - ":tink_exception", - "@pybind11", - "@tink_cc//util:fake_kms_client_pybind", - "@tink_cc//util:statusor", - ], -) - # To avoid getting multiple instances of KmsClients, ":aead" and # ":cc_fake_kms_client_testonly" need to be in the same pybind exension. tink_pybind_extension( @@ -298,7 +286,6 @@ tink_pybind_extension( deps = [ ":aead", ":cc_aws_kms_client", - ":cc_fake_kms_client_testonly", ":cc_gcp_kms_client", ":cc_hpke_config", ":cc_jwt_config", diff --git a/python/tink/cc/pybind/cc_fake_kms_client_testonly.cc b/python/tink/cc/pybind/cc_fake_kms_client_testonly.cc deleted file mode 100644 index 0f7350df8..000000000 --- a/python/tink/cc/pybind/cc_fake_kms_client_testonly.cc +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2021 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 -// -// http://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 "tink/cc/pybind/cc_fake_kms_client_testonly.h" - -#include <string> -#include <utility> - -#include "pybind11/pybind11.h" -#include "tink/util/fake_kms_client.h" -#include "tink/util/statusor.h" -#include "tink/cc/pybind/tink_exception.h" - -namespace crypto { -namespace tink { -namespace test { - -using pybind11::google_tink::TinkException; - -void PybindRegisterCcFakeKmsClientTestonly(pybind11::module* module) { - namespace py = pybind11; - py::module& m = *module; - m.def( - "register_fake_kms_client_testonly", - [](const std::string& key_uri, - const std::string& credentials_path) -> void { - crypto::tink::util::Status result = - FakeKmsClient::RegisterNewClient(key_uri, credentials_path); - if (!result.ok()) { - throw TinkException(result); - } - }, - py::arg("key_uri"), "URI of the key which should be used.", - py::arg("credentials_path"), "Path to the credentials for the client."); -} - -} // namespace test -} // namespace tink -} // namespace crypto diff --git a/python/tink/cc/pybind/cc_fake_kms_client_testonly.h b/python/tink/cc/pybind/cc_fake_kms_client_testonly.h deleted file mode 100644 index 3025f2189..000000000 --- a/python/tink/cc/pybind/cc_fake_kms_client_testonly.h +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2021 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 -// -// http://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. -// -/////////////////////////////////////////////////////////////////////////////// -#ifndef TINK_PYTHON_TINK_CC_PYBIND_CC_FAKE_KMS_CLIENT_TESTONLY_H_ -#define TINK_PYTHON_TINK_CC_PYBIND_CC_FAKE_KMS_CLIENT_TESTONLY_H_ - -#include "pybind11/pybind11.h" - -namespace crypto { -namespace tink { -namespace test { - -void PybindRegisterCcFakeKmsClientTestonly(pybind11::module* m); - -} // namespace test -} // namespace tink -} // namespace crypto - -#endif // TINK_PYTHON_TINK_CC_PYBIND_CC_FAKE_KMS_CLIENT_TESTONLY_H_ diff --git a/python/tink/cc/pybind/tink_bindings.cc b/python/tink/cc/pybind/tink_bindings.cc index b2b8ecbd6..6804a7db9 100644 --- a/python/tink/cc/pybind/tink_bindings.cc +++ b/python/tink/cc/pybind/tink_bindings.cc @@ -20,7 +20,6 @@ #include "tink/cc/pybind/aead.h" #include "tink/cc/pybind/cc_aws_kms_client.h" #include "tink/cc/pybind/cc_gcp_kms_client.h" -#include "tink/cc/pybind/cc_fake_kms_client_testonly.h" #include "tink/cc/pybind/cc_hpke_config.h" #include "tink/cc/pybind/cc_jwt_config.h" #include "tink/cc/pybind/cc_key_manager.h" @@ -39,6 +38,7 @@ #include "tink/cc/pybind/streaming_aead.h" #include "tink/cc/pybind/tink_exception.h" + namespace crypto { namespace tink { @@ -59,7 +59,6 @@ PYBIND11_MODULE(tink_bindings, m) { PybindRegisterDeterministicAead(&m); PybindRegisterPublicKeySign(&m); PybindRegisterMac(&m); - test::PybindRegisterCcFakeKmsClientTestonly(&m); PybindRegisterPrf(&m); PybindRegisterHybridDecrypt(&m); PybindRegisterOutputStreamAdapter(&m); |