Allow to check availability of the integration endpoint

This commit is contained in:
Eike Kettner
2020-05-27 23:55:45 +02:00
parent 7b64cdd0c1
commit 4e0d95a213
2 changed files with 79 additions and 45 deletions

View File

@ -34,6 +34,14 @@ object IntegrationEndpointRoutes {
uploadFile(collective, backend, cfg, dsl)(req)
)
} yield res).fold(identity, identity)
case req @ GET -> Root / "item" / Ident(collective) =>
(for {
_ <- checkEnabled(cfg.integrationEndpoint)
_ <- authRequest(req, cfg.integrationEndpoint)
_ <- lookupCollective(collective, backend)
res <- EitherT.liftF[F, Response[F], Response[F]](Ok(()))
} yield res).fold(identity, identity)
}
}