From acc8ed6bcf05649e1274fb07364c996b3919bc27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Knut=20Bj=C3=B8rnar=20W=C3=A5lberg?= Date: Sun, 4 Aug 2024 21:22:33 +0200 Subject: [PATCH] eux-pdf-flattener --- .../src/main/kotlin/no/nav/eux/pdf/webapp/PdfApiImpl.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/eux-pdf-flattener-webapp/src/main/kotlin/no/nav/eux/pdf/webapp/PdfApiImpl.kt b/eux-pdf-flattener-webapp/src/main/kotlin/no/nav/eux/pdf/webapp/PdfApiImpl.kt index 31d602b..b712a15 100644 --- a/eux-pdf-flattener-webapp/src/main/kotlin/no/nav/eux/pdf/webapp/PdfApiImpl.kt +++ b/eux-pdf-flattener-webapp/src/main/kotlin/no/nav/eux/pdf/webapp/PdfApiImpl.kt @@ -2,6 +2,7 @@ package no.nav.eux.pdf.webapp import no.nav.eux.pdf.openapi.api.PdfApi import no.nav.eux.pdf.service.FlattenPdfService +import no.nav.security.token.support.core.api.Protected import org.springframework.core.io.ByteArrayResource import org.springframework.core.io.Resource import org.springframework.http.ResponseEntity @@ -12,6 +13,7 @@ class PdfApiImpl( val pdfService: FlattenPdfService ) : PdfApi { + @Protected override fun flattenPdf(file: Resource?): ResponseEntity { return ByteArrayResource(pdfService.flattenPdf(file!!.contentAsByteArray)).toOkResponseEntity() }