2021-01-01 21:49:51 +03:00
|
|
|
# Copyright (c) 2021 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
2020-08-28 18:28:06 +03:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
|
|
|
load(
|
|
|
|
"//bazel_tools:scala.bzl",
|
|
|
|
"da_scala_binary",
|
|
|
|
"da_scala_library",
|
|
|
|
"da_scala_test",
|
|
|
|
)
|
|
|
|
|
|
|
|
scalacopts = []
|
|
|
|
|
2020-09-30 14:38:54 +03:00
|
|
|
da_scala_library(
|
2020-12-07 18:17:46 +03:00
|
|
|
name = "oauth2-api",
|
|
|
|
srcs = glob(["src/main/scala/com/daml/auth/oauth2/api/**/*.scala"]),
|
2020-09-30 14:38:54 +03:00
|
|
|
scalacopts = scalacopts,
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
deps = [
|
2020-12-07 18:17:46 +03:00
|
|
|
"@maven//:com_typesafe_akka_akka_actor_2_12",
|
|
|
|
"@maven//:com_typesafe_akka_akka_http_2_12",
|
|
|
|
"@maven//:com_typesafe_akka_akka_http_core_2_12",
|
|
|
|
"@maven//:com_typesafe_akka_akka_parsing_2_12",
|
|
|
|
"@maven//:com_typesafe_akka_akka_stream_2_12",
|
|
|
|
"@maven//:io_spray_spray_json_2_12",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
da_scala_library(
|
|
|
|
name = "middleware-api",
|
|
|
|
srcs = glob(["src/main/scala/com/daml/auth/middleware/api/**/*.scala"]),
|
|
|
|
scalacopts = scalacopts,
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
deps = [
|
|
|
|
"//daml-lf/data",
|
|
|
|
"//language-support/scala/bindings",
|
|
|
|
"@maven//:com_typesafe_akka_akka_actor_2_12",
|
|
|
|
"@maven//:com_typesafe_akka_akka_http_2_12",
|
|
|
|
"@maven//:com_typesafe_akka_akka_http_core_2_12",
|
2020-12-10 20:26:06 +03:00
|
|
|
"@maven//:com_typesafe_akka_akka_http_spray_json_2_12",
|
2020-12-07 18:17:46 +03:00
|
|
|
"@maven//:com_typesafe_akka_akka_parsing_2_12",
|
2020-12-10 20:26:06 +03:00
|
|
|
"@maven//:com_typesafe_akka_akka_stream_2_12",
|
2020-12-07 18:17:46 +03:00
|
|
|
"@maven//:io_spray_spray_json_2_12",
|
|
|
|
"@maven//:org_scalaz_scalaz_core_2_12",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
da_scala_library(
|
|
|
|
name = "oauth2-middleware",
|
|
|
|
srcs = glob(["src/main/scala/com/daml/auth/middleware/oauth2/**/*.scala"]),
|
2021-01-11 20:27:46 +03:00
|
|
|
resources = glob(["src/main/resources/com/daml/auth/middleware/oauth2/**"]),
|
2020-12-07 18:17:46 +03:00
|
|
|
scalacopts = scalacopts,
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
deps = [
|
|
|
|
":middleware-api",
|
|
|
|
":oauth2-api",
|
2020-10-09 19:43:56 +03:00
|
|
|
"//daml-lf/data",
|
2020-10-16 18:37:36 +03:00
|
|
|
"//language-support/scala/bindings",
|
2020-10-09 19:43:56 +03:00
|
|
|
"//ledger-service/jwt",
|
2020-10-26 20:53:37 +03:00
|
|
|
"//ledger/cli-opts",
|
2020-10-09 19:43:56 +03:00
|
|
|
"//ledger/ledger-api-auth",
|
2020-09-30 14:38:54 +03:00
|
|
|
"//libs-scala/ports",
|
|
|
|
"@maven//:com_github_scopt_scopt_2_12",
|
2021-01-11 20:27:46 +03:00
|
|
|
"@maven//:com_lihaoyi_fastparse_2_12",
|
|
|
|
"@maven//:com_lihaoyi_geny_2_12",
|
|
|
|
"@maven//:com_lihaoyi_os_lib_2_12",
|
|
|
|
"@maven//:com_lihaoyi_sjsonnet_2_12",
|
|
|
|
"@maven//:com_lihaoyi_ujson_2_12",
|
|
|
|
"@maven//:com_lihaoyi_upickle_core_2_12",
|
2020-09-30 14:38:54 +03:00
|
|
|
"@maven//:com_typesafe_akka_akka_actor_2_12",
|
|
|
|
"@maven//:com_typesafe_akka_akka_http_2_12",
|
|
|
|
"@maven//:com_typesafe_akka_akka_http_core_2_12",
|
|
|
|
"@maven//:com_typesafe_akka_akka_http_spray_json_2_12",
|
|
|
|
"@maven//:com_typesafe_akka_akka_parsing_2_12",
|
|
|
|
"@maven//:com_typesafe_akka_akka_stream_2_12",
|
|
|
|
"@maven//:com_typesafe_scala_logging_scala_logging_2_12",
|
|
|
|
"@maven//:io_spray_spray_json_2_12",
|
2020-10-09 19:43:56 +03:00
|
|
|
"@maven//:org_scalaz_scalaz_core_2_12",
|
2020-09-30 14:38:54 +03:00
|
|
|
"@maven//:org_slf4j_slf4j_api",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
da_scala_binary(
|
2020-12-07 18:17:46 +03:00
|
|
|
name = "oauth2-middleware-binary",
|
|
|
|
main_class = "com.daml.auth.middleware.oauth2.Main",
|
2020-09-30 14:38:54 +03:00
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
runtime_deps = [
|
|
|
|
"@maven//:ch_qos_logback_logback_classic",
|
|
|
|
],
|
|
|
|
deps = [
|
2020-12-07 18:17:46 +03:00
|
|
|
":oauth2-middleware",
|
2020-09-30 14:38:54 +03:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2020-08-28 18:28:06 +03:00
|
|
|
da_scala_library(
|
2020-12-07 18:17:46 +03:00
|
|
|
name = "oauth2-test-server",
|
|
|
|
srcs = glob(["src/main/scala/com/daml/auth/oauth2/test/server/**/*.scala"]),
|
2020-08-28 18:28:06 +03:00
|
|
|
scalacopts = scalacopts,
|
2020-12-07 18:17:46 +03:00
|
|
|
visibility = ["//triggers/service:__subpackages__"],
|
2020-08-28 18:28:06 +03:00
|
|
|
deps = [
|
2020-12-07 18:17:46 +03:00
|
|
|
":oauth2-api",
|
2020-11-10 12:27:21 +03:00
|
|
|
"//language-support/scala/bindings",
|
2020-08-28 18:28:06 +03:00
|
|
|
"//ledger-service/jwt",
|
|
|
|
"//ledger/ledger-api-auth",
|
|
|
|
"//libs-scala/ports",
|
|
|
|
"@maven//:com_github_scopt_scopt_2_12",
|
|
|
|
"@maven//:com_typesafe_akka_akka_actor_2_12",
|
|
|
|
"@maven//:com_typesafe_akka_akka_http_2_12",
|
|
|
|
"@maven//:com_typesafe_akka_akka_http_core_2_12",
|
|
|
|
"@maven//:com_typesafe_akka_akka_http_spray_json_2_12",
|
|
|
|
"@maven//:com_typesafe_akka_akka_stream_2_12",
|
|
|
|
"@maven//:com_typesafe_scala_logging_scala_logging_2_12",
|
|
|
|
"@maven//:io_spray_spray_json_2_12",
|
|
|
|
"@maven//:org_scalaz_scalaz_core_2_12",
|
|
|
|
"@maven//:org_slf4j_slf4j_api",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
da_scala_binary(
|
2020-12-07 18:17:46 +03:00
|
|
|
name = "oauth2-test-server-binary",
|
2020-08-28 18:28:06 +03:00
|
|
|
main_class = "com.daml.oauth.server.Main",
|
|
|
|
runtime_deps = [
|
|
|
|
"@maven//:ch_qos_logback_logback_classic",
|
|
|
|
],
|
|
|
|
deps = [
|
2020-12-07 18:17:46 +03:00
|
|
|
":oauth2-test-server",
|
2020-08-28 18:28:06 +03:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
da_scala_test(
|
2020-12-07 18:17:46 +03:00
|
|
|
name = "oauth2-test-server-tests",
|
|
|
|
srcs = glob(["src/test/scala/com/daml/auth/oauth2/test/server/**/*.scala"]),
|
2020-08-28 18:28:06 +03:00
|
|
|
scalacopts = scalacopts,
|
|
|
|
deps = [
|
2020-12-07 18:17:46 +03:00
|
|
|
":oauth2-api",
|
|
|
|
":oauth2-test-server",
|
2020-11-10 12:27:21 +03:00
|
|
|
"//language-support/scala/bindings",
|
2020-08-28 18:28:06 +03:00
|
|
|
"//ledger-api/rs-grpc-bridge",
|
|
|
|
"//ledger-api/testing-utils",
|
|
|
|
"//ledger-service/jwt",
|
|
|
|
"//ledger/ledger-api-auth",
|
2020-10-20 12:26:28 +03:00
|
|
|
"//ledger/ledger-resources",
|
2020-11-17 15:06:42 +03:00
|
|
|
"//libs-scala/adjustable-clock",
|
2020-08-28 18:28:06 +03:00
|
|
|
"//libs-scala/ports",
|
|
|
|
"//libs-scala/resources",
|
|
|
|
"@maven//:com_typesafe_akka_akka_actor_2_12",
|
|
|
|
"@maven//:com_typesafe_akka_akka_http_2_12",
|
|
|
|
"@maven//:com_typesafe_akka_akka_http_core_2_12",
|
|
|
|
"@maven//:com_typesafe_akka_akka_http_spray_json_2_12",
|
|
|
|
"@maven//:com_typesafe_akka_akka_parsing_2_12",
|
|
|
|
"@maven//:com_typesafe_akka_akka_stream_2_12",
|
|
|
|
"@maven//:io_spray_spray_json_2_12",
|
|
|
|
"@maven//:org_scalaz_scalaz_core_2_12",
|
|
|
|
],
|
|
|
|
)
|
2020-09-30 14:38:54 +03:00
|
|
|
|
|
|
|
da_scala_test(
|
2020-12-07 18:17:46 +03:00
|
|
|
name = "oauth2-middleware-tests",
|
|
|
|
srcs = glob(["src/test/scala/com/daml/auth/middleware/oauth2/**/*.scala"]),
|
2020-09-30 14:38:54 +03:00
|
|
|
scalacopts = scalacopts,
|
|
|
|
deps = [
|
2020-12-07 18:17:46 +03:00
|
|
|
":middleware-api",
|
|
|
|
":oauth2-api",
|
|
|
|
":oauth2-middleware",
|
|
|
|
":oauth2-test-server",
|
2020-10-09 19:43:56 +03:00
|
|
|
"//daml-lf/data",
|
2020-10-16 18:37:36 +03:00
|
|
|
"//language-support/scala/bindings",
|
2020-09-30 14:38:54 +03:00
|
|
|
"//ledger-api/rs-grpc-bridge",
|
|
|
|
"//ledger-api/testing-utils",
|
2020-10-09 19:43:56 +03:00
|
|
|
"//ledger-service/jwt",
|
|
|
|
"//ledger/ledger-api-auth",
|
2020-10-20 12:26:28 +03:00
|
|
|
"//ledger/ledger-resources",
|
2020-11-17 15:06:42 +03:00
|
|
|
"//libs-scala/adjustable-clock",
|
2020-09-30 14:38:54 +03:00
|
|
|
"//libs-scala/ports",
|
|
|
|
"//libs-scala/resources",
|
2021-01-11 20:27:46 +03:00
|
|
|
"//libs-scala/scala-utils",
|
2020-11-17 15:06:42 +03:00
|
|
|
"@maven//:com_auth0_java_jwt",
|
2020-09-30 14:38:54 +03:00
|
|
|
"@maven//:com_typesafe_akka_akka_actor_2_12",
|
2021-01-06 19:02:05 +03:00
|
|
|
"@maven//:com_typesafe_akka_akka_http_2_12",
|
2020-09-30 14:38:54 +03:00
|
|
|
"@maven//:com_typesafe_akka_akka_http_core_2_12",
|
2021-01-06 19:02:05 +03:00
|
|
|
"@maven//:com_typesafe_akka_akka_http_spray_json_2_12",
|
2020-09-30 14:38:54 +03:00
|
|
|
"@maven//:com_typesafe_akka_akka_parsing_2_12",
|
|
|
|
"@maven//:com_typesafe_akka_akka_stream_2_12",
|
|
|
|
"@maven//:com_typesafe_scala_logging_scala_logging_2_12",
|
2021-01-06 19:02:05 +03:00
|
|
|
"@maven//:io_spray_spray_json_2_12",
|
2020-10-09 19:43:56 +03:00
|
|
|
"@maven//:org_scalaz_scalaz_core_2_12",
|
2020-09-30 14:38:54 +03:00
|
|
|
],
|
|
|
|
)
|