1# Copyright 2019 The gRPC Authors 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# http://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 15load("@rules_python//python:defs.bzl", "py_binary", "py_library", "py_test") 16 17filegroup( 18 name = "_credentials_files", 19 testonly = 1, 20 srcs = [ 21 "credentials/localhost.crt", 22 "credentials/localhost.key", 23 "credentials/root.crt", 24 ], 25) 26 27py_library( 28 name = "_credentials", 29 testonly = 1, 30 srcs = ["_credentials.py"], 31 data = [":_credentials_files"], 32) 33 34py_binary( 35 name = "customized_auth_client", 36 testonly = 1, 37 srcs = ["customized_auth_client.py"], 38 data = ["helloworld.proto"], 39 python_version = "PY3", 40 deps = [ 41 ":_credentials", 42 "//src/python/grpcio/grpc:grpcio", 43 "//tools/distrib/python/grpcio_tools:grpc_tools", 44 ], 45) 46 47py_binary( 48 name = "customized_auth_server", 49 testonly = 1, 50 srcs = ["customized_auth_server.py"], 51 data = ["helloworld.proto"], 52 python_version = "PY3", 53 deps = [ 54 ":_credentials", 55 "//src/python/grpcio/grpc:grpcio", 56 "//tools/distrib/python/grpcio_tools:grpc_tools", 57 ], 58) 59 60py_binary( 61 name = "async_customized_auth_client", 62 testonly = 1, 63 srcs = ["async_customized_auth_client.py"], 64 data = ["helloworld.proto"], 65 imports = ["."], 66 python_version = "PY3", 67 deps = [ 68 ":_credentials", 69 "//src/python/grpcio/grpc:grpcio", 70 "//tools/distrib/python/grpcio_tools:grpc_tools", 71 ], 72) 73 74py_binary( 75 name = "async_customized_auth_server", 76 testonly = 1, 77 srcs = ["async_customized_auth_server.py"], 78 data = ["helloworld.proto"], 79 imports = ["."], 80 python_version = "PY3", 81 deps = [ 82 ":_credentials", 83 "//src/python/grpcio/grpc:grpcio", 84 "//tools/distrib/python/grpcio_tools:grpc_tools", 85 ], 86) 87 88py_test( 89 name = "_auth_example_test", 90 srcs = ["test/_auth_example_test.py"], 91 python_version = "PY3", 92 deps = [ 93 ":_credentials", 94 ":async_customized_auth_client", 95 ":async_customized_auth_server", 96 ":customized_auth_client", 97 ":customized_auth_server", 98 "//src/python/grpcio/grpc:grpcio", 99 "//tools/distrib/python/grpcio_tools:grpc_tools", 100 ], 101) 102