mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-06 15:15:58 +00:00
Authorize first on integration route
This commit is contained in:
parent
4e0d95a213
commit
2efb0210af
@ -27,8 +27,8 @@ object IntegrationEndpointRoutes {
|
|||||||
HttpRoutes.of {
|
HttpRoutes.of {
|
||||||
case req @ POST -> Root / "item" / Ident(collective) =>
|
case req @ POST -> Root / "item" / Ident(collective) =>
|
||||||
(for {
|
(for {
|
||||||
_ <- checkEnabled(cfg.integrationEndpoint)
|
|
||||||
_ <- authRequest(req, cfg.integrationEndpoint)
|
_ <- authRequest(req, cfg.integrationEndpoint)
|
||||||
|
_ <- checkEnabled(cfg.integrationEndpoint)
|
||||||
_ <- lookupCollective(collective, backend)
|
_ <- lookupCollective(collective, backend)
|
||||||
res <- EitherT.liftF[F, Response[F], Response[F]](
|
res <- EitherT.liftF[F, Response[F], Response[F]](
|
||||||
uploadFile(collective, backend, cfg, dsl)(req)
|
uploadFile(collective, backend, cfg, dsl)(req)
|
||||||
@ -37,9 +37,9 @@ object IntegrationEndpointRoutes {
|
|||||||
|
|
||||||
case req @ GET -> Root / "item" / Ident(collective) =>
|
case req @ GET -> Root / "item" / Ident(collective) =>
|
||||||
(for {
|
(for {
|
||||||
_ <- checkEnabled(cfg.integrationEndpoint)
|
_ <- authRequest(req, cfg.integrationEndpoint)
|
||||||
_ <- authRequest(req, cfg.integrationEndpoint)
|
_ <- checkEnabled(cfg.integrationEndpoint)
|
||||||
_ <- lookupCollective(collective, backend)
|
_ <- lookupCollective(collective, backend)
|
||||||
res <- EitherT.liftF[F, Response[F], Response[F]](Ok(()))
|
res <- EitherT.liftF[F, Response[F], Response[F]](Ok(()))
|
||||||
} yield res).fold(identity, identity)
|
} yield res).fold(identity, identity)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user