From 2efb0210afc50725417ab45800294d7036e5715b Mon Sep 17 00:00:00 2001 From: Eike Kettner Date: Thu, 28 May 2020 00:04:49 +0200 Subject: [PATCH] Authorize first on integration route --- .../restserver/routes/IntegrationEndpointRoutes.scala | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/restserver/src/main/scala/docspell/restserver/routes/IntegrationEndpointRoutes.scala b/modules/restserver/src/main/scala/docspell/restserver/routes/IntegrationEndpointRoutes.scala index f2278971..15ee7dfe 100644 --- a/modules/restserver/src/main/scala/docspell/restserver/routes/IntegrationEndpointRoutes.scala +++ b/modules/restserver/src/main/scala/docspell/restserver/routes/IntegrationEndpointRoutes.scala @@ -27,8 +27,8 @@ object IntegrationEndpointRoutes { HttpRoutes.of { case req @ POST -> Root / "item" / Ident(collective) => (for { - _ <- checkEnabled(cfg.integrationEndpoint) _ <- authRequest(req, cfg.integrationEndpoint) + _ <- checkEnabled(cfg.integrationEndpoint) _ <- lookupCollective(collective, backend) res <- EitherT.liftF[F, Response[F], Response[F]]( uploadFile(collective, backend, cfg, dsl)(req) @@ -37,9 +37,9 @@ object IntegrationEndpointRoutes { case req @ GET -> Root / "item" / Ident(collective) => (for { - _ <- checkEnabled(cfg.integrationEndpoint) - _ <- authRequest(req, cfg.integrationEndpoint) - _ <- lookupCollective(collective, backend) + _ <- authRequest(req, cfg.integrationEndpoint) + _ <- checkEnabled(cfg.integrationEndpoint) + _ <- lookupCollective(collective, backend) res <- EitherT.liftF[F, Response[F], Response[F]](Ok(())) } yield res).fold(identity, identity) }