2022-01-03 19:36:51 +03:00
|
|
|
# Copyright (c) 2022 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",
|
|
|
|
)
|
|
|
|
|
2021-01-22 19:02:24 +03:00
|
|
|
exports_files(["release/oauth2-middleware-logback.xml"])
|
|
|
|
|
2020-08-28 18:28:06 +03:00
|
|
|
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"]),
|
2021-02-09 15:35:05 +03:00
|
|
|
scala_deps = [
|
|
|
|
"@maven//:com_typesafe_akka_akka_actor",
|
|
|
|
"@maven//:com_typesafe_akka_akka_http",
|
|
|
|
"@maven//:com_typesafe_akka_akka_http_core",
|
|
|
|
"@maven//:com_typesafe_akka_akka_parsing",
|
|
|
|
"@maven//:com_typesafe_akka_akka_stream",
|
|
|
|
"@maven//:io_spray_spray_json",
|
|
|
|
],
|
2020-09-30 14:38:54 +03:00
|
|
|
scalacopts = scalacopts,
|
|
|
|
visibility = ["//visibility:public"],
|
2020-12-07 18:17:46 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
da_scala_library(
|
|
|
|
name = "middleware-api",
|
|
|
|
srcs = glob(["src/main/scala/com/daml/auth/middleware/api/**/*.scala"]),
|
2021-02-09 15:35:05 +03:00
|
|
|
scala_deps = [
|
|
|
|
"@maven//:com_typesafe_akka_akka_actor",
|
|
|
|
"@maven//:com_typesafe_akka_akka_http",
|
|
|
|
"@maven//:com_typesafe_akka_akka_http_core",
|
|
|
|
"@maven//:com_typesafe_akka_akka_http_spray_json",
|
|
|
|
"@maven//:com_typesafe_akka_akka_parsing",
|
|
|
|
"@maven//:com_typesafe_akka_akka_stream",
|
|
|
|
"@maven//:io_spray_spray_json",
|
|
|
|
"@maven//:org_scalaz_scalaz_core",
|
|
|
|
],
|
2020-12-07 18:17:46 +03:00
|
|
|
scalacopts = scalacopts,
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
deps = [
|
|
|
|
"//daml-lf/data",
|
|
|
|
"//language-support/scala/bindings",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
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/**"]),
|
2021-02-09 15:35:05 +03:00
|
|
|
scala_deps = [
|
|
|
|
"@maven//:com_github_scopt_scopt",
|
|
|
|
"@maven//:com_lihaoyi_fastparse",
|
|
|
|
"@maven//:com_lihaoyi_geny",
|
|
|
|
"@maven//:com_lihaoyi_os_lib",
|
|
|
|
"@maven//:com_lihaoyi_sjsonnet",
|
|
|
|
"@maven//:com_lihaoyi_ujson",
|
|
|
|
"@maven//:com_lihaoyi_upickle_core",
|
|
|
|
"@maven//:com_typesafe_akka_akka_actor",
|
|
|
|
"@maven//:com_typesafe_akka_akka_http",
|
|
|
|
"@maven//:com_typesafe_akka_akka_http_core",
|
|
|
|
"@maven//:com_typesafe_akka_akka_http_spray_json",
|
|
|
|
"@maven//:com_typesafe_akka_akka_parsing",
|
|
|
|
"@maven//:com_typesafe_akka_akka_stream",
|
|
|
|
"@maven//:com_typesafe_scala_logging_scala_logging",
|
2021-12-16 19:36:32 +03:00
|
|
|
"@maven//:com_chuusai_shapeless",
|
|
|
|
"@maven//:com_github_pureconfig_pureconfig_core",
|
|
|
|
"@maven//:com_github_pureconfig_pureconfig_generic",
|
2021-02-09 15:35:05 +03:00
|
|
|
"@maven//:io_spray_spray_json",
|
|
|
|
"@maven//:org_scalaz_scalaz_core",
|
|
|
|
],
|
2021-05-12 00:54:14 +03:00
|
|
|
scalacopts = scalacopts,
|
2020-12-07 18:17:46 +03:00
|
|
|
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",
|
2021-01-29 12:32:07 +03:00
|
|
|
"//ledger-service/cli-opts",
|
2020-10-09 19:43:56 +03:00
|
|
|
"//ledger-service/jwt",
|
2022-01-07 13:35:31 +03:00
|
|
|
"//ledger-service/pureconfig-utils",
|
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",
|
2021-12-16 19:36:32 +03:00
|
|
|
"@maven//:com_typesafe_config",
|
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"]),
|
2021-02-09 15:35:05 +03:00
|
|
|
scala_deps = [
|
|
|
|
"@maven//:com_github_scopt_scopt",
|
|
|
|
"@maven//:com_typesafe_akka_akka_actor",
|
|
|
|
"@maven//:com_typesafe_akka_akka_http",
|
|
|
|
"@maven//:com_typesafe_akka_akka_http_core",
|
|
|
|
"@maven//:com_typesafe_akka_akka_http_spray_json",
|
|
|
|
"@maven//:com_typesafe_akka_akka_parsing",
|
|
|
|
"@maven//:com_typesafe_akka_akka_stream",
|
|
|
|
"@maven//:com_typesafe_scala_logging_scala_logging",
|
|
|
|
"@maven//:io_spray_spray_json",
|
|
|
|
"@maven//:org_scalaz_scalaz_core",
|
|
|
|
],
|
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//: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"]),
|
2021-02-09 15:35:05 +03:00
|
|
|
scala_deps = [
|
|
|
|
"@maven//:com_typesafe_akka_akka_actor",
|
|
|
|
"@maven//:com_typesafe_akka_akka_http",
|
|
|
|
"@maven//:com_typesafe_akka_akka_http_core",
|
|
|
|
"@maven//:com_typesafe_akka_akka_http_spray_json",
|
|
|
|
"@maven//:com_typesafe_akka_akka_parsing",
|
|
|
|
"@maven//:com_typesafe_akka_akka_stream",
|
|
|
|
"@maven//:io_spray_spray_json",
|
|
|
|
"@maven//:org_scalaz_scalaz_core",
|
|
|
|
],
|
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",
|
|
|
|
],
|
|
|
|
)
|
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"]),
|
2021-12-16 19:36:32 +03:00
|
|
|
data = [
|
|
|
|
":src/test/resources/oauth2-middleware.conf",
|
|
|
|
":src/test/resources/oauth2-middleware-minimal.conf",
|
|
|
|
],
|
2021-02-09 15:35:05 +03:00
|
|
|
scala_deps = [
|
|
|
|
"@maven//:com_typesafe_akka_akka_actor",
|
|
|
|
"@maven//:com_typesafe_akka_akka_http",
|
|
|
|
"@maven//:com_typesafe_akka_akka_http_core",
|
|
|
|
"@maven//:com_typesafe_akka_akka_http_spray_json",
|
2021-09-02 19:06:48 +03:00
|
|
|
"@maven//:com_typesafe_akka_akka_http_testkit",
|
2021-02-09 15:35:05 +03:00
|
|
|
"@maven//:com_typesafe_akka_akka_parsing",
|
|
|
|
"@maven//:com_typesafe_akka_akka_stream",
|
|
|
|
"@maven//:com_typesafe_scala_logging_scala_logging",
|
|
|
|
"@maven//:io_spray_spray_json",
|
|
|
|
"@maven//:org_scalaz_scalaz_core",
|
2022-01-07 13:35:31 +03:00
|
|
|
"@maven//:com_github_pureconfig_pureconfig_core",
|
2021-02-09 15:35:05 +03:00
|
|
|
],
|
2021-09-02 19:06:48 +03:00
|
|
|
scala_runtime_deps = [
|
|
|
|
"@maven//:com_typesafe_akka_akka_stream_testkit",
|
|
|
|
],
|
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",
|
2021-12-16 19:36:32 +03:00
|
|
|
"//bazel_tools/runfiles:scala_runfiles",
|
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",
|
2021-09-02 19:06:48 +03:00
|
|
|
"@maven//:com_typesafe_config",
|
2020-09-30 14:38:54 +03:00
|
|
|
],
|
|
|
|
)
|