| load("@tink_py//tools/build_defs:tink_python_rules.bzl", "tink_pybind_extension", "tink_pybind_library") |
| load("@tink_py_pip_deps//:requirements.bzl", "requirement") |
| |
| package( |
| default_visibility = ["//:__subpackages__"], |
| ) |
| |
| licenses(["notice"]) |
| |
| tink_pybind_library( |
| name = "import_helper", |
| srcs = ["import_helper.cc"], |
| hdrs = ["import_helper.h"], |
| visibility = ["//visibility:private"], |
| deps = [ |
| "@com_google_absl//absl/strings", |
| "@pybind11", |
| ], |
| ) |
| |
| tink_pybind_library( |
| name = "cc_key_manager", |
| srcs = ["cc_key_manager.cc"], |
| hdrs = ["cc_key_manager.h"], |
| deps = [ |
| ":import_helper", |
| ":status_casters", |
| "//tink/cc:cc_key_manager", |
| "@pybind11", |
| "@tink_cc//:aead", |
| "@tink_cc//:deterministic_aead", |
| "@tink_cc//:hybrid_decrypt", |
| "@tink_cc//:hybrid_encrypt", |
| "@tink_cc//:mac", |
| "@tink_cc//:public_key_sign", |
| "@tink_cc//:public_key_verify", |
| "@tink_cc//:streaming_aead", |
| ], |
| ) |
| |
| py_test( |
| name = "cc_key_manager_test", |
| srcs = ["cc_key_manager_test.py"], |
| deps = [ |
| ":tink_bindings", |
| requirement("absl-py"), |
| "//tink/aead", |
| "//tink/hybrid", |
| "//tink/proto:aes_eax_py_pb2", |
| "//tink/proto:aes_siv_py_pb2", |
| "//tink/proto:common_py_pb2", |
| "//tink/proto:ecdsa_py_pb2", |
| "//tink/proto:ecies_aead_hkdf_py_pb2", |
| "//tink/proto:hmac_py_pb2", |
| "//tink/proto:tink_py_pb2", |
| ], |
| ) |
| |
| tink_pybind_library( |
| name = "cc_tink_config", |
| srcs = ["cc_tink_config.cc"], |
| hdrs = ["cc_tink_config.h"], |
| deps = [ |
| ":status_casters", |
| "//tink/cc:cc_tink_config", |
| "@pybind11", |
| ], |
| ) |
| |
| py_test( |
| name = "cc_tink_config_test", |
| srcs = ["cc_tink_config_test.py"], |
| deps = [ |
| ":tink_bindings", |
| requirement("absl-py"), |
| requirement("six"), |
| ], |
| ) |
| |
| tink_pybind_library( |
| name = "python_file_object_adapter", |
| srcs = ["python_file_object_adapter.cc"], |
| hdrs = ["python_file_object_adapter.h"], |
| deps = [ |
| ":status_casters", |
| "//tink/cc:python_file_object_adapter", |
| "@pybind11", |
| ], |
| ) |
| |
| tink_pybind_library( |
| name = "output_stream_adapter", |
| srcs = ["output_stream_adapter.cc"], |
| hdrs = ["output_stream_adapter.h"], |
| deps = [ |
| ":status_casters", |
| "//tink/cc:output_stream_adapter", |
| "@pybind11", |
| ], |
| ) |
| |
| tink_pybind_library( |
| name = "cc_streaming_aead_wrappers", |
| srcs = ["cc_streaming_aead_wrappers.cc"], |
| hdrs = ["cc_streaming_aead_wrappers.h"], |
| deps = [ |
| ":import_helper", |
| ":status_casters", |
| "//tink/cc:cc_streaming_aead_wrappers", |
| "@pybind11", |
| ], |
| ) |
| |
| tink_pybind_library( |
| name = "input_stream_adapter", |
| srcs = ["input_stream_adapter.cc"], |
| hdrs = ["input_stream_adapter.h"], |
| deps = [ |
| ":status_casters", |
| "//tink/cc:input_stream_adapter", |
| "@pybind11", |
| ], |
| ) |
| |
| # Pybind11 Status, StatusOr casters and extension. |
| |
| tink_pybind_library( |
| name = "status_utils", |
| srcs = ["status_utils.cc"], |
| hdrs = ["status_utils.h"], |
| visibility = ["//visibility:private"], |
| deps = [ |
| ":import_helper", |
| "@pybind11", |
| "@tink_cc//util:status", |
| "@tink_cc//util:statusor", |
| ], |
| ) |
| |
| tink_pybind_library( |
| name = "status_casters", |
| hdrs = ["status_casters.h"], |
| deps = [ |
| ":status_utils", |
| "@pybind11", |
| "@tink_cc//util:status", |
| "@tink_cc//util:statusor", |
| ], |
| ) |
| |
| tink_pybind_library( |
| name = "status", |
| srcs = ["status.cc"], |
| hdrs = ["status.h"], |
| deps = [ |
| ":status_utils", |
| "@pybind11", |
| "@tink_cc//util:status", |
| ], |
| ) |
| |
| tink_pybind_library( |
| name = "status_injector", |
| srcs = ["status_injector.cc"], |
| hdrs = ["status_injector.h"], |
| deps = [ |
| ":status_casters", |
| "@pybind11", |
| "@tink_cc//util:status", |
| ], |
| ) |
| |
| py_test( |
| name = "status_test", |
| srcs = ["status_test.py"], |
| deps = [ |
| ":tink_testonly_bindings", |
| requirement("absl-py"), |
| requirement("six"), |
| ], |
| ) |
| |
| tink_pybind_library( |
| name = "aead", |
| srcs = ["aead.cc"], |
| hdrs = ["aead.h"], |
| deps = [ |
| ":status_casters", |
| "@pybind11", |
| "@tink_cc//:aead", |
| "@tink_cc//util:statusor", |
| ], |
| ) |
| |
| tink_pybind_library( |
| name = "deterministic_aead", |
| srcs = ["deterministic_aead.cc"], |
| hdrs = ["deterministic_aead.h"], |
| deps = [ |
| ":status_casters", |
| "@pybind11", |
| "@tink_cc//:deterministic_aead", |
| "@tink_cc//util:statusor", |
| ], |
| ) |
| |
| tink_pybind_library( |
| name = "streaming_aead", |
| srcs = ["streaming_aead.cc"], |
| hdrs = ["streaming_aead.h"], |
| deps = [ |
| "@pybind11", |
| "@tink_cc//:streaming_aead", |
| ], |
| ) |
| |
| tink_pybind_library( |
| name = "hybrid_decrypt", |
| srcs = ["hybrid_decrypt.cc"], |
| hdrs = ["hybrid_decrypt.h"], |
| deps = [ |
| ":status_casters", |
| "@pybind11", |
| "@tink_cc//:hybrid_decrypt", |
| "@tink_cc//util:statusor", |
| ], |
| ) |
| |
| tink_pybind_library( |
| name = "hybrid_encrypt", |
| srcs = ["hybrid_encrypt.cc"], |
| hdrs = ["hybrid_encrypt.h"], |
| deps = [ |
| ":status_casters", |
| "@pybind11", |
| "@tink_cc//:hybrid_encrypt", |
| "@tink_cc//util:statusor", |
| ], |
| ) |
| |
| tink_pybind_library( |
| name = "mac", |
| srcs = ["mac.cc"], |
| hdrs = ["mac.h"], |
| deps = [ |
| ":status_casters", |
| "@pybind11", |
| "@tink_cc//:mac", |
| "@tink_cc//util:status", |
| ], |
| ) |
| |
| tink_pybind_library( |
| name = "public_key_sign", |
| srcs = ["public_key_sign.cc"], |
| hdrs = ["public_key_sign.h"], |
| deps = [ |
| ":status_casters", |
| "@pybind11", |
| "@tink_cc//:public_key_sign", |
| "@tink_cc//util:statusor", |
| ], |
| ) |
| |
| tink_pybind_library( |
| name = "public_key_verify", |
| srcs = ["public_key_verify.cc"], |
| hdrs = ["public_key_verify.h"], |
| deps = [ |
| ":status_casters", |
| "@pybind11", |
| "@tink_cc//:public_key_verify", |
| "@tink_cc//util:status", |
| ], |
| ) |
| |
| tink_pybind_library( |
| name = "cc_gcp_kms_client", |
| srcs = ["cc_gcp_kms_client.cc"], |
| hdrs = ["cc_gcp_kms_client.h"], |
| deps = [ |
| "//tink/cc:output_stream_adapter", |
| "//tink/cc/pybind:status_casters", |
| "@pybind11", |
| "@tink_cc//:kms_clients", |
| "@tink_cc//integration/gcpkms:gcp_kms_client", |
| ], |
| ) |
| |
| tink_pybind_library( |
| name = "cc_aws_kms_client", |
| srcs = ["cc_aws_kms_client.cc"], |
| hdrs = ["cc_aws_kms_client.h"], |
| deps = [ |
| "//tink/cc:output_stream_adapter", |
| "//tink/cc/pybind:status_casters", |
| "@pybind11", |
| "@tink_cc//integration/awskms:aws_kms_client", |
| ], |
| ) |
| |
| tink_pybind_extension( |
| name = "tink_bindings", |
| srcs = ["tink_bindings.cc"], |
| deps = [ |
| ":aead", |
| ":cc_aws_kms_client", |
| ":cc_gcp_kms_client", |
| ":cc_key_manager", |
| ":cc_streaming_aead_wrappers", |
| ":cc_tink_config", |
| ":deterministic_aead", |
| ":hybrid_decrypt", |
| ":hybrid_encrypt", |
| ":input_stream_adapter", |
| ":mac", |
| ":output_stream_adapter", |
| ":public_key_sign", |
| ":public_key_verify", |
| ":python_file_object_adapter", |
| ":status", |
| ":status_casters", |
| ":streaming_aead", |
| "@tink_cc//:aead", |
| "@tink_cc//:deterministic_aead", |
| "@tink_cc//:hybrid_decrypt", |
| "@tink_cc//:hybrid_encrypt", |
| "@tink_cc//:mac", |
| "@tink_cc//:public_key_sign", |
| "@tink_cc//:public_key_verify", |
| "@tink_cc//:streaming_aead", |
| "@tink_cc//integration/awskms:aws_kms_client", |
| "@tink_cc//integration/gcpkms:gcp_kms_client", |
| "@tink_cc//util:status", |
| "@tink_cc//util:statusor", |
| ], |
| ) |
| |
| tink_pybind_extension( |
| name = "tink_testonly_bindings", |
| srcs = ["tink_testonly_bindings.cc"], |
| deps = [ |
| ":aead", |
| ":cc_aws_kms_client", |
| ":cc_gcp_kms_client", |
| ":cc_key_manager", |
| ":cc_streaming_aead_wrappers", |
| ":cc_tink_config", |
| ":deterministic_aead", |
| ":hybrid_decrypt", |
| ":hybrid_encrypt", |
| ":input_stream_adapter", |
| ":mac", |
| ":output_stream_adapter", |
| ":public_key_sign", |
| ":public_key_verify", |
| ":python_file_object_adapter", |
| ":status", |
| ":status_casters", |
| ":status_injector", |
| ":streaming_aead", |
| "@tink_cc//:aead", |
| "@tink_cc//:deterministic_aead", |
| "@tink_cc//:hybrid_decrypt", |
| "@tink_cc//:hybrid_encrypt", |
| "@tink_cc//:mac", |
| "@tink_cc//:public_key_sign", |
| "@tink_cc//:public_key_verify", |
| "@tink_cc//:streaming_aead", |
| "@tink_cc//integration/awskms:aws_kms_client", |
| "@tink_cc//integration/gcpkms:gcp_kms_client", |
| "@tink_cc//util:status", |
| "@tink_cc//util:statusor", |
| ], |
| ) |