load("@fbcode_macros//build_defs:cpp_binary.bzl", "cpp_binary")
load("@fbcode_macros//build_defs:cpp_library.bzl", "cpp_library")
load("@fbcode_macros//build_defs:cpp_unittest.bzl", "cpp_unittest")

oncall("secure_pipes")

cpp_unittest(
    name = "async_fizz_base_test",
    srcs = [
        "AsyncFizzBaseTest.cpp",
    ],
    deps = [
        "//fizz/protocol:async_fizz_base",
        "//folly/io/async/test:mocks",
        "//folly/portability:gmock",
        "//folly/portability:gtest",
    ],
)

cpp_library(
    name = "handshake_test_lib",
    headers = [
        "HandshakeTest.h",
        "LocalTransport.h",
    ],
    exported_deps = [
        "//fizz/backend:openssl",
        "//fizz/client:async_fizz_client",
        "//fizz/client/test:mocks",
        "//fizz/compression:zlib_certificate_compressor",
        "//fizz/compression:zlib_certificate_decompressor",
        "//fizz/crypto:random",
        "//fizz/crypto:utils",
        "//fizz/crypto/test:TestUtil",
        "//fizz/extensions/tokenbinding:token_binding_client_extension",
        "//fizz/extensions/tokenbinding:token_binding_context",
        "//fizz/extensions/tokenbinding:token_binding_server_extension",
        "//fizz/protocol/test:cert_util",
        "//fizz/protocol/test:matchers",
        "//fizz/server:async_fizz_server",
        "//fizz/server:cookie_types",
        "//fizz/server:ticket_types",
        "//fizz/server/test:mocks",
        "//folly/io:iobuf",
        "//folly/io/async:async_transport",
        "//folly/portability:gmock",
        "//folly/portability:gtest",
    ],
)

cpp_unittest(
    name = "handshake_test",
    srcs = [
        "HandshakeTest.cpp",
    ],
    supports_static_listing = False,
    deps = [
        ":handshake_test_lib",
        "//fizz/backend:openssl",
        "//fizz/client:async_fizz_client",
        "//fizz/client/test:mocks",
        "//fizz/compression:zlib_certificate_compressor",
        "//fizz/compression:zlib_certificate_decompressor",
        "//fizz/crypto:random",
        "//fizz/crypto:utils",
        "//fizz/crypto/test:TestUtil",
        "//fizz/extensions/tokenbinding:token_binding_client_extension",
        "//fizz/extensions/tokenbinding:token_binding_context",
        "//fizz/extensions/tokenbinding:token_binding_server_extension",
        "//fizz/protocol/test:cert_util",
        "//fizz/protocol/test:matchers",
        "//fizz/server:async_fizz_server",
        "//fizz/server:cookie_types",
        "//fizz/server:ticket_types",
        "//fizz/server/test:mocks",
        "//folly/portability:gmock",
        "//folly/portability:gtest",
    ],
)

cpp_binary(
    name = "bogo_shim",
    srcs = [
        "BogoShim.cpp",
    ],
    deps = [
        "//fizz/backend:openssl",
        "//fizz/client:async_fizz_client",
        "//fizz/crypto:random",
        "//fizz/crypto:utils",
        "//fizz/server:async_fizz_server",
        "//fizz/server:ticket_types",
        "//folly:string",
        "//folly/io/async:async_ssl_socket",
        "//folly/io/async:ssl_context",
        "//folly/portability:gflags",
    ],
)
