1# Copyright 2019 Google LLC 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# https://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14 15# The 'network proxy' example demonstrates how to use network proxy server. 16 17load("@com_google_sandboxed_api//sandboxed_api/bazel:build_defs.bzl", "sapi_platform_copts") 18 19package(default_visibility = [ 20 "@com_google_sandboxed_api//sandboxed_api/sandbox2:__subpackages__", 21]) 22 23licenses(["notice"]) 24 25# Executor 26cc_binary( 27 name = "networkproxy_sandbox", 28 srcs = ["networkproxy_sandbox.cc"], 29 copts = sapi_platform_copts(), 30 data = [":networkproxy_bin"], 31 deps = [ 32 "@com_google_absl//absl/base:core_headers", 33 "@com_google_absl//absl/flags:flag", 34 "@com_google_absl//absl/flags:parse", 35 "@com_google_absl//absl/log", 36 "@com_google_absl//absl/log:globals", 37 "@com_google_absl//absl/log:initialize", 38 "@com_google_absl//absl/status:statusor", 39 "@com_google_absl//absl/strings:string_view", 40 "@com_google_absl//absl/time", 41 "@com_google_sandboxed_api//sandboxed_api:config", 42 "@com_google_sandboxed_api//sandboxed_api/sandbox2", 43 "@com_google_sandboxed_api//sandboxed_api/sandbox2:comms", 44 "@com_google_sandboxed_api//sandboxed_api/sandbox2/network_proxy:testing", 45 "@com_google_sandboxed_api//sandboxed_api/util:runfiles", 46 ], 47) 48 49# Sandboxee 50cc_binary( 51 name = "networkproxy_bin", 52 srcs = ["networkproxy_bin.cc"], 53 copts = sapi_platform_copts(), 54 deps = [ 55 "@com_google_absl//absl/base:log_severity", 56 "@com_google_absl//absl/flags:flag", 57 "@com_google_absl//absl/flags:parse", 58 "@com_google_absl//absl/log", 59 "@com_google_absl//absl/log:globals", 60 "@com_google_absl//absl/log:initialize", 61 "@com_google_absl//absl/status", 62 "@com_google_absl//absl/status:statusor", 63 "@com_google_absl//absl/strings:str_format", 64 "@com_google_absl//absl/strings:string_view", 65 "@com_google_sandboxed_api//sandboxed_api/sandbox2:client", 66 "@com_google_sandboxed_api//sandboxed_api/sandbox2:comms", 67 "@com_google_sandboxed_api//sandboxed_api/sandbox2/network_proxy:client", 68 "@com_google_sandboxed_api//sandboxed_api/util:fileops", 69 "@com_google_sandboxed_api//sandboxed_api/util:status", 70 ], 71) 72 73# Test 74sh_test( 75 name = "networkproxy_sandbox_test", 76 srcs = ["networkproxy_sandbox_test.sh"], 77 data = [":networkproxy_sandbox"], 78 tags = ["no_qemu_user_mode"], 79) 80