BUILD.bazel 2.6 KB

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