refactor(pdfengines): embeds => attachments

This commit is contained in:
Julien Neuhart
2026-03-08 15:49:09 +01:00
parent 7af3cd1ff5
commit cf9fd7eedc
92 changed files with 5763 additions and 3082 deletions

View File

@@ -988,28 +988,28 @@ Feature: /forms/chromium/convert/html
Then there should be 1 PDF(s) in the response
Then the response PDF(s) should be encrypted
@embed
Scenario: POST /forms/chromium/convert/html (Embeds)
@attachments
Scenario: POST /forms/chromium/convert/html (Attachments)
Given I have a default Gotenberg container
When I make a "POST" request to Gotenberg at the "/forms/chromium/convert/html" endpoint with the following form data and header(s):
| files | testdata/page-1-html/index.html | file |
| embeds | testdata/embed_1.xml | file |
| embeds | testdata/embed_2.xml | file |
| attachments | testdata/attachment_1.xml | file |
| attachments | testdata/attachment_2.xml | file |
| Gotenberg-Output-Filename | foo | header |
Then the response status code should be 200
Then the response header "Content-Type" should be "application/pdf"
Then there should be 1 PDF(s) in the response
Then there should be the following file(s) in the response:
| foo.pdf |
Then the response PDF(s) should have the "embed_1.xml" file embedded
Then the response PDF(s) should have the "embed_2.xml" file embedded
Then the response PDF(s) should have the "attachment_1.xml" file attached
Then the response PDF(s) should have the "attachment_2.xml" file attached
# FIXME: once decrypt is done, add encrypt and check after the content of the PDF.
@convert
@metadata
@flatten
@embed
Scenario: POST /forms/chromium/convert/html (PDF/A-1b & PDF/UA-1 & Metadata & Flatten & Embeds)
@attachments
Scenario: POST /forms/chromium/convert/html (PDF/A-1b & PDF/UA-1 & Metadata & Flatten & Attachments)
Given I have a default Gotenberg container
When I make a "POST" request to Gotenberg at the "/forms/chromium/convert/html" endpoint with the following form data and header(s):
| files | testdata/page-1-html/index.html | file |
@@ -1017,8 +1017,8 @@ Feature: /forms/chromium/convert/html
| pdfua | true | field |
| metadata | {"Author":"Julien Neuhart","Copyright":"Julien Neuhart","CreateDate":"2006-09-18T16:27:50-04:00","Creator":"Gotenberg","Keywords":["first","second"],"Marked":true,"ModDate":"2006-09-18T16:27:50-04:00","PDFVersion":1.7,"Producer":"Gotenberg","Subject":"Sample","Title":"Sample","Trapped":"Unknown"} | field |
| flatten | true | field |
| embeds | testdata/embed_1.xml | file |
| embeds | testdata/embed_2.xml | file |
| attachments | testdata/attachment_1.xml | file |
| attachments | testdata/attachment_2.xml | file |
| Gotenberg-Output-Filename | foo | header |
Then the response status code should be 200
Then the response header "Content-Type" should be "application/pdf"
@@ -1028,8 +1028,8 @@ Feature: /forms/chromium/convert/html
Then the response PDF(s) should be valid "PDF/A-1b" with a tolerance of 9 failed rule(s)
Then the response PDF(s) should be valid "PDF/UA-1" with a tolerance of 2 failed rule(s)
Then the response PDF(s) should be flatten
Then the response PDF(s) should have the "embed_1.xml" file embedded
Then the response PDF(s) should have the "embed_2.xml" file embedded
Then the response PDF(s) should have the "attachment_1.xml" file attached
Then the response PDF(s) should have the "attachment_2.xml" file attached
When I make a "POST" request to Gotenberg at the "/forms/pdfengines/metadata/read" endpoint with the following form data and header(s):
| files | teststore/foo.pdf | file |
Then the response status code should be 200
@@ -1061,16 +1061,19 @@ Feature: /forms/chromium/convert/html
| files | testdata/page-1-html/index.html | file |
Then the response status code should be 404
Scenario: POST /forms/chromium/convert/html (Gotenberg Trace)
@telemetry
Scenario: POST /forms/chromium/convert/html (Telemetry)
Given I have a default Gotenberg container
When I make a "POST" request to Gotenberg at the "/forms/chromium/convert/html" endpoint with the following form data and header(s):
| files | testdata/page-1-html/index.html | file |
| Gotenberg-Trace | forms_chromium_convert_html | header |
| files | testdata/page-1-html/index.html | file |
| X-Correlation-ID | forms_chromium_convert_html | header |
| traceparent | 00-12345678901234567890123456789012-1234567890123456-01 | header |
Then the response status code should be 200
Then the response header "Content-Type" should be "application/pdf"
Then the response header "Gotenberg-Trace" should be "forms_chromium_convert_html"
Then the response header "X-Correlation-ID" should be "forms_chromium_convert_html"
Then the Gotenberg container should log the following entries:
| "trace":"forms_chromium_convert_html" |
| "correlation_id":"forms_chromium_convert_html" |
| "trace_id":"12345678901234567890123456789012" |
@download-from
Scenario: POST /forms/chromium/convert/html (Download From)

View File

@@ -990,29 +990,29 @@ Feature: /forms/chromium/convert/markdown
Then there should be 1 PDF(s) in the response
Then the response PDF(s) should be encrypted
@embed
Scenario: POST /forms/chromium/convert/markdown (Embeds)
@attachments
Scenario: POST /forms/chromium/convert/markdown (Attachments)
Given I have a default Gotenberg container
When I make a "POST" request to Gotenberg at the "/forms/chromium/convert/markdown" endpoint with the following form data and header(s):
| files | testdata/page-1-markdown/index.html | file |
| files | testdata/page-1-markdown/page_1.md | file |
| embeds | testdata/embed_1.xml | file |
| embeds | testdata/embed_2.xml | file |
| attachments | testdata/attachment_1.xml | file |
| attachments | testdata/attachment_2.xml | file |
| Gotenberg-Output-Filename | foo | header |
Then the response status code should be 200
Then the response header "Content-Type" should be "application/pdf"
Then there should be 1 PDF(s) in the response
Then there should be the following file(s) in the response:
| foo.pdf |
Then the response PDF(s) should have the "embed_1.xml" file embedded
Then the response PDF(s) should have the "embed_2.xml" file embedded
Then the response PDF(s) should have the "attachment_1.xml" file attached
Then the response PDF(s) should have the "attachment_2.xml" file attached
# FIXME: once decrypt is done, add encrypt and check after the content of the PDF.
@convert
@metadata
@flatten
@embed
Scenario: POST /forms/chromium/convert/markdown (PDF/A-1b & PDF/UA-1 & Metadata & Flatten & Embeds)
@attachments
Scenario: POST /forms/chromium/convert/markdown (PDF/A-1b & PDF/UA-1 & Metadata & Flatten & Attachments)
Given I have a default Gotenberg container
When I make a "POST" request to Gotenberg at the "/forms/chromium/convert/markdown" endpoint with the following form data and header(s):
| files | testdata/page-1-markdown/index.html | file |
@@ -1021,8 +1021,8 @@ Feature: /forms/chromium/convert/markdown
| pdfua | true | field |
| metadata | {"Author":"Julien Neuhart","Copyright":"Julien Neuhart","CreateDate":"2006-09-18T16:27:50-04:00","Creator":"Gotenberg","Keywords":["first","second"],"Marked":true,"ModDate":"2006-09-18T16:27:50-04:00","PDFVersion":1.7,"Producer":"Gotenberg","Subject":"Sample","Title":"Sample","Trapped":"Unknown"} | field |
| flatten | true | field |
| embeds | testdata/embed_1.xml | file |
| embeds | testdata/embed_2.xml | file |
| attachments | testdata/attachment_1.xml | file |
| attachments | testdata/attachment_2.xml | file |
| Gotenberg-Output-Filename | foo | header |
Then the response status code should be 200
Then the response header "Content-Type" should be "application/pdf"
@@ -1032,8 +1032,8 @@ Feature: /forms/chromium/convert/markdown
Then the response PDF(s) should be valid "PDF/A-1b" with a tolerance of 9 failed rule(s)
Then the response PDF(s) should be valid "PDF/UA-1" with a tolerance of 2 failed rule(s)
Then the response PDF(s) should be flatten
Then the response PDF(s) should have the "embed_1.xml" file embedded
Then the response PDF(s) should have the "embed_2.xml" file embedded
Then the response PDF(s) should have the "attachment_1.xml" file attached
Then the response PDF(s) should have the "attachment_2.xml" file attached
When I make a "POST" request to Gotenberg at the "/forms/pdfengines/metadata/read" endpoint with the following form data and header(s):
| files | teststore/foo.pdf | file |
Then the response status code should be 200
@@ -1066,17 +1066,20 @@ Feature: /forms/chromium/convert/markdown
| files | testdata/page-1-markdown/page_1.md | file |
Then the response status code should be 404
Scenario: POST /forms/chromium/convert/markdown (Gotenberg Trace)
@telemetry
Scenario: POST /forms/chromium/convert/markdown (Telemetry)
Given I have a default Gotenberg container
When I make a "POST" request to Gotenberg at the "/forms/chromium/convert/markdown" endpoint with the following form data and header(s):
| files | testdata/page-1-markdown/index.html | file |
| files | testdata/page-1-markdown/page_1.md | file |
| Gotenberg-Trace | forms_chromium_convert_html | header |
| files | testdata/page-1-markdown/index.html | file |
| files | testdata/page-1-markdown/page_1.md | file |
| X-Correlation-ID | forms_chromium_convert_markdown | header |
| traceparent | 00-12345678901234567890123456789012-1234567890123456-01 | header |
Then the response status code should be 200
Then the response header "Content-Type" should be "application/pdf"
Then the response header "Gotenberg-Trace" should be "forms_chromium_convert_html"
Then the response header "X-Correlation-ID" should be "forms_chromium_convert_markdown"
Then the Gotenberg container should log the following entries:
| "trace":"forms_chromium_convert_html" |
| "correlation_id":"forms_chromium_convert_markdown" |
| "trace_id":"12345678901234567890123456789012" |
@download-from
Scenario: POST /forms/chromium/convert/markdown (Download From)

View File

@@ -1085,28 +1085,28 @@ Feature: /forms/chromium/convert/url
Then there should be 1 PDF(s) in the response
Then the response PDF(s) should be encrypted
@embed
Scenario: POST /foo/forms/chromium/convert/url (Embeds)
@attachments
Scenario: POST /foo/forms/chromium/convert/url (Attachments)
Given I have a default Gotenberg container
Given I have a static server
When I make a "POST" request to Gotenberg at the "/forms/chromium/convert/url" endpoint with the following form data and header(s):
| url | http://host.docker.internal:%d/html/testdata/page-1-html/index.html | field |
| embeds | testdata/embed_1.xml | file |
| embeds | testdata/embed_2.xml | file |
| attachments | testdata/attachment_1.xml | file |
| attachments | testdata/attachment_2.xml | file |
| Gotenberg-Output-Filename | foo | header |
Then the response status code should be 200
Then the response header "Content-Type" should be "application/pdf"
Then there should be 1 PDF(s) in the response
Then there should be the following file(s) in the webhook request:
| foo.pdf |
Then the response PDF(s) should have the "embed_1.xml" file embedded
Then the response PDF(s) should have the "embed_2.xml" file embedded
Then the response PDF(s) should have the "attachment_1.xml" file attached
Then the response PDF(s) should have the "attachment_2.xml" file attached
# FIXME: once decrypt is done, add encrypt and check after the content of the PDF.
@convert
@metadata
@flatten
@embed
@attachments
Scenario: POST /forms/chromium/convert/url (PDF/A-1b & PDF/UA-1 & Metadata & Flatten)
Given I have a default Gotenberg container
Given I have a static server
@@ -1116,8 +1116,8 @@ Feature: /forms/chromium/convert/url
| pdfua | true | field |
| metadata | {"Author":"Julien Neuhart","Copyright":"Julien Neuhart","CreateDate":"2006-09-18T16:27:50-04:00","Creator":"Gotenberg","Keywords":["first","second"],"Marked":true,"ModDate":"2006-09-18T16:27:50-04:00","PDFVersion":1.7,"Producer":"Gotenberg","Subject":"Sample","Title":"Sample","Trapped":"Unknown"} | field |
| flatten | true | field |
| embeds | testdata/embed_1.xml | file |
| embeds | testdata/embed_2.xml | file |
| attachments | testdata/attachment_1.xml | file |
| attachments | testdata/attachment_2.xml | file |
| Gotenberg-Output-Filename | foo | header |
Then the response status code should be 200
Then the response header "Content-Type" should be "application/pdf"
@@ -1127,8 +1127,8 @@ Feature: /forms/chromium/convert/url
Then the response PDF(s) should be valid "PDF/A-1b" with a tolerance of 9 failed rule(s)
Then the response PDF(s) should be valid "PDF/UA-1" with a tolerance of 2 failed rule(s)
Then the response PDF(s) should be flatten
Then the response PDF(s) should have the "embed_1.xml" file embedded
Then the response PDF(s) should have the "embed_2.xml" file embedded
Then the response PDF(s) should have the "attachment_1.xml" file attached
Then the response PDF(s) should have the "attachment_2.xml" file attached
When I make a "POST" request to Gotenberg at the "/forms/pdfengines/metadata/read" endpoint with the following form data and header(s):
| files | teststore/foo.pdf | file |
Then the response status code should be 200
@@ -1161,17 +1161,20 @@ Feature: /forms/chromium/convert/url
| url | http://host.docker.internal:%d/html/testdata/page-1-html/index.html | field |
Then the response status code should be 404
Scenario: POST /forms/chromium/convert/url (Gotenberg Trace)
@telemetry
Scenario: POST /forms/chromium/convert/url (Telemetry)
Given I have a default Gotenberg container
Given I have a static server
When I make a "POST" request to Gotenberg at the "/forms/chromium/convert/url" endpoint with the following form data and header(s):
| url | http://host.docker.internal:%d/html/testdata/page-1-html/index.html | field |
| Gotenberg-Trace | forms_chromium_convert_url | header |
| url | http://host.docker.internal:%d/html/testdata/page-1-html/index.html | field |
| X-Correlation-ID | forms_chromium_convert_url | header |
| traceparent | 00-12345678901234567890123456789012-1234567890123456-01 | header |
Then the response status code should be 200
Then the response header "Content-Type" should be "application/pdf"
Then the response header "Gotenberg-Trace" should be "forms_chromium_convert_url"
Then the response header "X-Correlation-ID" should be "forms_chromium_convert_url"
Then the Gotenberg container should log the following entries:
| "trace":"forms_chromium_convert_url" |
| "correlation_id":"forms_chromium_convert_url" |
| "trace_id":"12345678901234567890123456789012" |
@webhook
Scenario: POST /forms/chromium/convert/url (Webhook)

View File

@@ -25,11 +25,9 @@ Feature: /debug
"libreoffice",
"libreoffice-api",
"libreoffice-pdfengine",
"logging",
"pdfcpu",
"pdfengines",
"pdftk",
"prometheus",
"qpdf",
"webhook"
],
@@ -56,8 +54,12 @@ Feature: /debug
"flags": {
"api-bind-ip": "",
"api-body-limit": "",
"api-correlation-id-header": "X-Correlation-ID",
"api-disable-debug-route-telemetry": "false",
"api-disable-download-from": "false",
"api-disable-health-check-logging": "false",
"api-disable-health-check-route-telemetry": "false",
"api-disable-root-route-telemetry": "false",
"api-disable-version-route-telemetry": "false",
"api-download-from-allow-list": "",
"api-download-from-deny-list": "",
"api-download-from-max-retry": "4",
@@ -70,7 +72,6 @@ Feature: /debug
"api-timeout": "30s",
"api-tls-cert-file": "",
"api-tls-key-file": "",
"api-trace-header": "Gotenberg-Trace",
"chromium-allow-file-access-from-files": "false",
"chromium-allow-insecure-localhost": "false",
"chromium-allow-list": "",
@@ -83,39 +84,37 @@ Feature: /debug
"chromium-disable-web-security": "false",
"chromium-host-resolver-rules": "",
"chromium-ignore-certificate-errors": "false",
"chromium-incognito": "false",
"chromium-max-concurrency": "6",
"chromium-max-queue-size": "0",
"chromium-max-concurrency": "6",
"chromium-proxy-server": "",
"chromium-restart-after": "100",
"chromium-start-timeout": "20s",
"gotenberg-build-debug-data": "true",
"gotenberg-graceful-shutdown-duration": "30s",
"gotenberg-hide-banner": "false",
"libreoffice-auto-start": "false",
"libreoffice-disable-routes": "false",
"libreoffice-max-queue-size": "0",
"libreoffice-restart-after": "10",
"libreoffice-start-timeout": "20s",
"log-fields-prefix": "",
"log-format": "auto",
"log-level": "info",
"log-std-enable-gcp-fields": "false",
"log-std-format": "auto",
"pdfengines-convert-engines": "[libreoffice-pdfengine]",
"pdfengines-disable-routes": "false",
"pdfengines-engines": "[]",
"pdfengines-add-attachments-engines": "[pdfcpu]",
"pdfengines-encrypt-engines": "[qpdf,pdfcpu,pdftk]",
"pdfengines-flatten-engines": "[qpdf]",
"pdfengines-merge-engines": "[qpdf,pdfcpu,pdftk]",
"pdfengines-read-metadata-engines": "[exiftool]",
"pdfengines-split-engines": "[pdfcpu,qpdf,pdftk]",
"pdfengines-write-metadata-engines": "[exiftool]",
"prometheus-collect-interval": "1s",
"prometheus-disable-collect": "false",
"prometheus-disable-route-logging": "false",
"prometheus-namespace": "gotenberg",
"prometheus-metrics-path": "/prometheus/metrics",
"webhook-allow-list": "",
"webhook-client-timeout": "30s",
"webhook-deny-list": "",
"webhook-disable": "false",
"webhook-enable-sync-mode": "false",
"webhook-error-allow-list": "",
"webhook-error-deny-list": "",
"webhook-max-retry": "4",
@@ -125,7 +124,7 @@ Feature: /debug
}
"""
Scenario: GET /debug (Environment based timezone)
Scenario: GET /debug (Environment Based Timezone)
Given I have a Gotenberg container with the following environment variable(s):
| API_ENABLE_DEBUG_ROUTE | true |
| TZ | America/New_York |
@@ -145,11 +144,9 @@ Feature: /debug
"libreoffice",
"libreoffice-api",
"libreoffice-pdfengine",
"logging",
"pdfcpu",
"pdfengines",
"pdftk",
"prometheus",
"qpdf",
"webhook"
],
@@ -176,8 +173,12 @@ Feature: /debug
"flags": {
"api-bind-ip": "",
"api-body-limit": "",
"api-correlation-id-header": "X-Correlation-ID",
"api-disable-debug-route-telemetry": "false",
"api-disable-download-from": "false",
"api-disable-health-check-logging": "false",
"api-disable-health-check-route-telemetry": "false",
"api-disable-root-route-telemetry": "false",
"api-disable-version-route-telemetry": "false",
"api-download-from-allow-list": "",
"api-download-from-deny-list": "",
"api-download-from-max-retry": "4",
@@ -190,7 +191,6 @@ Feature: /debug
"api-timeout": "30s",
"api-tls-cert-file": "",
"api-tls-key-file": "",
"api-trace-header": "Gotenberg-Trace",
"chromium-allow-file-access-from-files": "false",
"chromium-allow-insecure-localhost": "false",
"chromium-allow-list": "",
@@ -203,7 +203,6 @@ Feature: /debug
"chromium-disable-web-security": "false",
"chromium-host-resolver-rules": "",
"chromium-ignore-certificate-errors": "false",
"chromium-incognito": "false",
"chromium-max-queue-size": "0",
"chromium-max-concurrency": "6",
"chromium-proxy-server": "",
@@ -211,31 +210,30 @@ Feature: /debug
"chromium-start-timeout": "20s",
"gotenberg-build-debug-data": "true",
"gotenberg-graceful-shutdown-duration": "30s",
"gotenberg-hide-banner": "false",
"libreoffice-auto-start": "false",
"libreoffice-disable-routes": "false",
"libreoffice-max-queue-size": "0",
"libreoffice-restart-after": "10",
"libreoffice-start-timeout": "20s",
"log-fields-prefix": "",
"log-format": "auto",
"log-level": "info",
"log-std-enable-gcp-fields": "false",
"log-std-format": "auto",
"pdfengines-convert-engines": "[libreoffice-pdfengine]",
"pdfengines-disable-routes": "false",
"pdfengines-engines": "[]",
"pdfengines-add-attachments-engines": "[pdfcpu]",
"pdfengines-encrypt-engines": "[qpdf,pdfcpu,pdftk]",
"pdfengines-flatten-engines": "[qpdf]",
"pdfengines-merge-engines": "[qpdf,pdfcpu,pdftk]",
"pdfengines-read-metadata-engines": "[exiftool]",
"pdfengines-split-engines": "[pdfcpu,qpdf,pdftk]",
"pdfengines-write-metadata-engines": "[exiftool]",
"prometheus-collect-interval": "1s",
"prometheus-disable-collect": "false",
"prometheus-disable-route-logging": "false",
"prometheus-namespace": "gotenberg",
"prometheus-metrics-path": "/prometheus/metrics",
"webhook-allow-list": "",
"webhook-client-timeout": "30s",
"webhook-deny-list": "",
"webhook-disable": "false",
"webhook-enable-sync-mode": "false",
"webhook-error-allow-list": "",
"webhook-error-deny-list": "",
"webhook-max-retry": "4",
@@ -264,15 +262,31 @@ Feature: /debug
}
"""
Scenario: GET /debug (Gotenberg Trace)
@telemetry
Scenario: GET /debug (Telemetry)
Given I have a Gotenberg container with the following environment variable(s):
| API_ENABLE_DEBUG_ROUTE | true |
When I make a "GET" request to Gotenberg at the "/debug" endpoint with the following header(s):
| Gotenberg-Trace | debug |
| X-Correlation-ID | debug |
| traceparent | 00-12345678901234567890123456789012-1234567890123456-01 |
Then the response status code should be 200
Then the response header "Gotenberg-Trace" should be "debug"
Then the response header "X-Correlation-ID" should be "debug"
Then the Gotenberg container should log the following entries:
| "trace":"debug" |
| "correlation_id":"debug" |
| "trace_id":"12345678901234567890123456789012" |
@telemetry
Scenario: GET /debug (No Telemetry)
Given I have a Gotenberg container with the following environment variable(s):
| API_ENABLE_DEBUG_ROUTE | true |
| API_DISABLE_DEBUG_ROUTE_TELEMETRY | true |
When I make a "GET" request to Gotenberg at the "/debug" endpoint with the following header(s):
| X-Correlation-ID | debug_no_telemetry |
| traceparent | 00-12345678901234567890123456789012-1234567890123456-01 |
Then the response status code should be 200
Then the Gotenberg container should NOT log the following entries:
| "correlation_id":"debug_no_telemetry" |
| "trace_id":"12345678901234567890123456789012" |
Scenario: GET /debug (Basic Auth)
Given I have a Gotenberg container with the following environment variable(s):

View File

@@ -29,22 +29,29 @@ Feature: /health
Then the Gotenberg container should log the following entries:
| "path":"/health" |
Scenario: GET /health (No Logging)
Given I have a Gotenberg container with the following environment variable(s):
| API_DISABLE_HEALTH_CHECK_LOGGING | true |
When I make a "GET" request to Gotenberg at the "/health" endpoint
Then the response status code should be 200
Then the Gotenberg container should NOT log the following entries:
| "path":"/health" |
Scenario: GET /health (Gotenberg Trace)
@telemetry
Scenario: GET /health (Telemetry)
Given I have a default Gotenberg container
When I make a "GET" request to Gotenberg at the "/health" endpoint with the following header(s):
| Gotenberg-Trace | get_health |
| X-Correlation-ID | get_health |
| traceparent | 00-12345678901234567890123456789012-1234567890123456-01 |
Then the response status code should be 200
Then the response header "Gotenberg-Trace" should be "get_health"
Then the response header "X-Correlation-ID" should be "get_health"
Then the Gotenberg container should log the following entries:
| "trace":"get_health" |
| "correlation_id":"get_health" |
| "trace_id":"12345678901234567890123456789012" |
@telemetry
Scenario: GET /health (No Telemetry)
Given I have a Gotenberg container with the following environment variable(s):
| API_DISABLE_HEALTH_CHECK_ROUTE_TELEMETRY | true |
When I make a "GET" request to Gotenberg at the "/health" endpoint with the following header(s):
| X-Correlation-ID | get_health_no_telemetry |
| traceparent | 00-12345678901234567890123456789012-1234567890123456-01 |
Then the response status code should be 200
Then the Gotenberg container should NOT log the following entries:
| "correlation_id":"get_health_no_telemetry" |
| "trace_id":"12345678901234567890123456789012" |
Scenario: GET /health (Basic Auth)
Given I have a Gotenberg container with the following environment variable(s):
@@ -71,22 +78,29 @@ Feature: /health
Then the Gotenberg container should log the following entries:
| "path":"/health" |
Scenario: HEAD /health (Gotenberg Trace)
@telemetry
Scenario: HEAD /health (Telemetry)
Given I have a default Gotenberg container
When I make a "HEAD" request to Gotenberg at the "/health" endpoint with the following header(s):
| Gotenberg-Trace | head_health |
| X-Correlation-ID | head_health |
| traceparent | 00-12345678901234567890123456789012-1234567890123456-01 |
Then the response status code should be 200
Then the response header "Gotenberg-Trace" should be "head_health"
Then the response header "X-Correlation-ID" should be "head_health"
Then the Gotenberg container should log the following entries:
| "trace":"head_health" |
| "correlation_id":"head_health" |
| "trace_id":"12345678901234567890123456789012" |
Scenario: HEAD /health (No Logging)
@telemetry
Scenario: HEAD /health (No Telemetry)
Given I have a Gotenberg container with the following environment variable(s):
| API_DISABLE_HEALTH_CHECK_LOGGING | true |
When I make a "HEAD" request to Gotenberg at the "/health" endpoint
| API_DISABLE_HEALTH_CHECK_ROUTE_TELEMETRY | true |
When I make a "HEAD" request to Gotenberg at the "/health" endpoint with the following header(s):
| X-Correlation-ID | head_health_no_telemetry |
| traceparent | 00-12345678901234567890123456789012-1234567890123456-01 |
Then the response status code should be 200
Then the Gotenberg container should NOT log the following entries:
| "path":"/health" |
| "correlation_id":"head_health_no_telemetry" |
| "trace_id":"12345678901234567890123456789012" |
Scenario: HEAD /health (Basic Auth)
Given I have a Gotenberg container with the following environment variable(s):

View File

@@ -563,28 +563,28 @@ Feature: /forms/libreoffice/convert
Then there should be 1 PDF(s) in the response
Then the response PDF(s) should be encrypted
@embed
Scenario: POST /forms/libreoffice/convert (Embeds)
@attachments
Scenario: POST /forms/libreoffice/convert (Attachments)
Given I have a default Gotenberg container
When I make a "POST" request to Gotenberg at the "/forms/libreoffice/convert" endpoint with the following form data and header(s):
| files | testdata/page_1.docx | file |
| embeds | testdata/embed_1.xml | file |
| embeds | testdata/embed_2.xml | file |
| Gotenberg-Output-Filename | foo | header |
| files | testdata/page_1.docx | file |
| attachments | testdata/attachment_1.xml | file |
| attachments | testdata/attachment_2.xml | file |
| Gotenberg-Output-Filename | foo | header |
Then the response status code should be 200
Then the response header "Content-Type" should be "application/pdf"
Then there should be 1 PDF(s) in the response
Then there should be the following file(s) in the response:
| foo.pdf |
Then the response PDF(s) should have the "embed_1.xml" file embedded
Then the response PDF(s) should have the "embed_2.xml" file embedded
Then the response PDF(s) should have the "attachment_1.xml" file attached
Then the response PDF(s) should have the "attachment_2.xml" file attached
# FIXME: once decrypt is done, add encrypt and check after the content of the PDF.
@convert
@metadata
@flatten
@embed
Scenario: POST /forms/libreoffice/convert (PDF/A-1b & PDF/UA-1 & Metadata & Flatten & Embeds)
@attachments
Scenario: POST /forms/libreoffice/convert (PDF/A-1b & PDF/UA-1 & Metadata & Flatten & Attachments)
Given I have a default Gotenberg container
When I make a "POST" request to Gotenberg at the "/forms/libreoffice/convert" endpoint with the following form data and header(s):
| files | testdata/page_1.docx | file |
@@ -592,8 +592,8 @@ Feature: /forms/libreoffice/convert
| pdfua | true | field |
| metadata | {"Author":"Julien Neuhart","Copyright":"Julien Neuhart","CreateDate":"2006-09-18T16:27:50-04:00","Creator":"Gotenberg","Keywords":["first","second"],"Marked":true,"ModDate":"2006-09-18T16:27:50-04:00","PDFVersion":1.7,"Producer":"Gotenberg","Subject":"Sample","Title":"Sample","Trapped":"Unknown"} | field |
| flatten | true | field |
| embeds | testdata/embed_1.xml | file |
| embeds | testdata/embed_2.xml | file |
| attachments | testdata/attachment_1.xml | file |
| attachments | testdata/attachment_2.xml | file |
| Gotenberg-Output-Filename | foo | header |
Then the response status code should be 200
Then the response header "Content-Type" should be "application/pdf"
@@ -603,8 +603,8 @@ Feature: /forms/libreoffice/convert
Then the response PDF(s) should be valid "PDF/A-1b" with a tolerance of 10 failed rule(s)
Then the response PDF(s) should be valid "PDF/UA-1" with a tolerance of 2 failed rule(s)
Then the response PDF(s) should be flatten
Then the response PDF(s) should have the "embed_1.xml" file embedded
Then the response PDF(s) should have the "embed_2.xml" file embedded
Then the response PDF(s) should have the "attachment_1.xml" file attached
Then the response PDF(s) should have the "attachment_2.xml" file attached
When I make a "POST" request to Gotenberg at the "/forms/pdfengines/metadata/read" endpoint with the following form data and header(s):
| files | teststore/foo.pdf | file |
Then the response status code should be 200
@@ -636,16 +636,19 @@ Feature: /forms/libreoffice/convert
| files | testdata/page_1.docx | file |
Then the response status code should be 404
Scenario: POST /forms/libreoffice/convert (Gotenberg Trace)
@telemetry
Scenario: POST /forms/libreoffice/convert (Telemetry)
Given I have a default Gotenberg container
When I make a "POST" request to Gotenberg at the "/forms/libreoffice/convert" endpoint with the following form data and header(s):
| files | testdata/page_1.docx | file |
| Gotenberg-Trace | forms_libreoffice_convert | header |
| files | testdata/page_1.docx | file |
| X-Correlation-ID | forms_libreoffice_convert | header |
| traceparent | 00-12345678901234567890123456789012-1234567890123456-01 | header |
Then the response status code should be 200
Then the response header "Content-Type" should be "application/pdf"
Then the response header "Gotenberg-Trace" should be "forms_libreoffice_convert"
Then the response header "X-Correlation-ID" should be "forms_libreoffice_convert"
Then the Gotenberg container should log the following entries:
| "trace":"forms_libreoffice_convert" |
| "correlation_id":"forms_libreoffice_convert" |
| "trace_id":"12345678901234567890123456789012" |
@download-from
Scenario: POST /forms/libreoffice/convert (Download From)

View File

@@ -1,72 +1,72 @@
@pdfengines
@pdfengines-embed
@embed
Feature: /forms/pdfengines/embed
@pdfengines-attachments
@attachments
Feature: /forms/pdfengines/attachments/add
Scenario: POST /forms/pdfengines/embed
Scenario: POST /forms/pdfengines/attachments/add
Given I have a default Gotenberg container
When I make a "POST" request to Gotenberg at the "/forms/pdfengines/embed" endpoint with the following form data and header(s):
| files | testdata/page_1.pdf | file |
| embeds | testdata/embed_1.xml | file |
| embeds | testdata/embed_2.xml | file |
When I make a "POST" request to Gotenberg at the "/forms/pdfengines/attachments/add" endpoint with the following form data and header(s):
| files | testdata/page_1.pdf | file |
| attachments | testdata/attachment_1.xml | file |
| attachments | testdata/attachment_2.xml | file |
Then the response status code should be 200
Then the response header "Content-Type" should be "application/pdf"
Then there should be 1 PDF(s) in the response
Then there should be the following file(s) in the response:
| page_1.pdf |
Then the response PDF(s) should have the "embed_1.xml" file embedded
Then the response PDF(s) should have the "embed_2.xml" file embedded
Then the response PDF(s) should have the "attachment_1.xml" file attached
Then the response PDF(s) should have the "attachment_2.xml" file attached
@download-from
Scenario: POST /forms/pdfengines/embed with (Download From)
Scenario: POST /forms/pdfengines/attachments/add (Download From)
Given I have a default Gotenberg container
Given I have a static server
When I make a "POST" request to Gotenberg at the "/forms/pdfengines/embed" endpoint with the following form data and header(s):
| files | testdata/page_1.pdf | file |
| downloadFrom | [{"url":"http://host.docker.internal:%d/static/testdata/embed_1.xml","embedded": true},{"url":"http://host.docker.internal:%d/static/testdata/embed_2.xml","embedded": false}] | field |
When I make a "POST" request to Gotenberg at the "/forms/pdfengines/attachments/add" endpoint with the following form data and header(s):
| files | testdata/page_1.pdf | file |
| downloadFrom | [{"url":"http://host.docker.internal:%d/static/testdata/attachment_1.xml","attachment": true},{"url":"http://host.docker.internal:%d/static/testdata/attachment_2.xml","attachment": false}] | field |
Then the response status code should be 200
Then the response header "Content-Type" should be "application/pdf"
Then there should be 1 PDF(s) in the response
Then there should be the following file(s) in the response:
| page_1.pdf |
Then the response PDF(s) should have the "embed_1.xml" file embedded
Then the response PDF(s) should NOT have the "embed_2.xml" file embedded
Then the response PDF(s) should have the "attachment_1.xml" file attached
Then the response PDF(s) should NOT have the "attachment_2.xml" file attached
@webhook
Scenario: POST /forms/pdfengines/embed (Webhook)
Scenario: POST /forms/pdfengines/attachments/add (Webhook)
Given I have a default Gotenberg container
Given I have a webhook server
When I make a "POST" request to Gotenberg at the "/forms/pdfengines/embed" endpoint with the following form data and header(s):
When I make a "POST" request to Gotenberg at the "/forms/pdfengines/attachments/add" endpoint with the following form data and header(s):
| files | testdata/page_1.pdf | file |
| embeds | testdata/embed_1.xml | file |
| embeds | testdata/embed_2.xml | file |
| attachments | testdata/attachment_1.xml | file |
| attachments | testdata/attachment_2.xml | file |
| Gotenberg-Webhook-Url | http://host.docker.internal:%d/webhook | header |
| Gotenberg-Webhook-Error-Url | http://host.docker.internal:%d/webhook/error | header |
Then the response status code should be 204
When I wait for the asynchronous request to the webhook
Then the webhook request header "Content-Type" should be "application/pdf"
Then there should be 1 PDF(s) in the webhook request
Then the webhook request PDF(s) should have the "embed_1.xml" file embedded
Then the webhook request PDF(s) should have the "embed_2.xml" file embedded
Then the webhook request PDF(s) should have the "attachment_1.xml" file attached
Then the webhook request PDF(s) should have the "attachment_2.xml" file attached
Scenario: POST /forms/pdfengines/embed (Basic Auth)
Scenario: POST /forms/pdfengines/attachments/add (Basic Auth)
Given I have a Gotenberg container with the following environment variable(s):
| API_ENABLE_BASIC_AUTH | true |
| GOTENBERG_API_BASIC_AUTH_USERNAME | foo |
| GOTENBERG_API_BASIC_AUTH_PASSWORD | bar |
When I make a "POST" request to Gotenberg at the "/forms/pdfengines/embed" endpoint with the following form data and header(s):
| files | testdata/page_1.pdf | file |
| embeds | testdata/embed_1.xml | file |
| embeds | testdata/embed_2.xml | file |
When I make a "POST" request to Gotenberg at the "/forms/pdfengines/attachments/add" endpoint with the following form data and header(s):
| files | testdata/page_1.pdf | file |
| attachments | testdata/attachment_1.xml | file |
| attachments | testdata/attachment_2.xml | file |
Then the response status code should be 401
Scenario: POST /foo/forms/pdfengines/embed (Root Path)
Scenario: POST /foo/forms/pdfengines/attachments/add (Root Path)
Given I have a Gotenberg container with the following environment variable(s):
| API_ENABLE_DEBUG_ROUTE | true |
| API_ROOT_PATH | /foo/ |
When I make a "POST" request to Gotenberg at the "/foo/forms/pdfengines/embed" endpoint with the following form data and header(s):
| files | testdata/page_1.pdf | file |
| embeds | testdata/embed_1.xml | file |
| embeds | testdata/embed_2.xml | file |
When I make a "POST" request to Gotenberg at the "/foo/forms/pdfengines/attachments/add" endpoint with the following form data and header(s):
| files | testdata/page_1.pdf | file |
| attachments | testdata/attachment_1.xml | file |
| attachments | testdata/attachment_2.xml | file |
Then the response status code should be 200
Then the response header "Content-Type" should be "application/pdf"

View File

@@ -1,339 +0,0 @@
@pdfengines
@pdfengines-bookmarks
@bookmarks
Feature: /forms/pdfengines/bookmarks/{write|read}
Scenario: POST /forms/pdfengines/bookmarks/{write|read} (Single PDF & Bookmarks list)
Given I have a default Gotenberg container
When I make a "POST" request to Gotenberg at the "/forms/pdfengines/bookmarks/write" endpoint with the following form data and header(s):
| files | testdata/page_1.pdf | file |
| bookmarks | [{"title":"Index","page":1,"children":[{"title":"Sub-index","page":1}]}] | field |
| Gotenberg-Output-Filename | foo | header |
Then the response status code should be 200
Then the response header "Content-Type" should be "application/pdf"
Then there should be 1 PDF(s) in the response
When I make a "POST" request to Gotenberg at the "/forms/pdfengines/bookmarks/read" endpoint with the following form data and header(s):
| files | teststore/foo.pdf | file |
Then the response status code should be 200
Then the response header "Content-Type" should be "application/json"
Then the response body should match JSON:
"""
{
"foo.pdf": [
{
"title": "Index",
"page": 1,
"children": [
{
"title": "Sub-index",
"page": 1
}
]
}
]
}
"""
Scenario: POST /forms/pdfengines/bookmarks/{write|read} (Single PDF & Bookmarks Map)
Given I have a default Gotenberg container
When I make a "POST" request to Gotenberg at the "/forms/pdfengines/bookmarks/write" endpoint with the following form data and header(s):
| files | testdata/page_1.pdf | file |
| bookmarks | {"page_1.pdf":[{"title":"Index","page":1}]} | field |
| Gotenberg-Output-Filename | foo | header |
Then the response status code should be 200
Then the response header "Content-Type" should be "application/pdf"
Then there should be 1 PDF(s) in the response
When I make a "POST" request to Gotenberg at the "/forms/pdfengines/bookmarks/read" endpoint with the following form data and header(s):
| files | teststore/foo.pdf | file |
Then the response status code should be 200
Then the response header "Content-Type" should be "application/json"
Then the response body should match JSON:
"""
{
"foo.pdf": [
{
"title": "Index",
"page": 1
}
]
}
"""
Scenario: POST /forms/pdfengines/bookmarks/{write|read} (Many PDFs & Bookmarks List)
Given I have a default Gotenberg container
When I make a "POST" request to Gotenberg at the "/forms/pdfengines/bookmarks/write" endpoint with the following form data and header(s):
| files. | testdata/page_1.pdf | file |
| files | testdata/page_2.pdf | file |
| bookmarks | [{"title":"Index","page":1}] | field |
Then the response status code should be 200
Then the response header "Content-Type" should be "application/zip"
Then there should be 2 PDF(s) in the response
When I make a "POST" request to Gotenberg at the "/forms/pdfengines/bookmarks/read" endpoint with the following form data and header(s):
| files | teststore/page_1.pdf | file |
| files | teststore/page_2.pdf | file |
Then the response status code should be 200
Then the response header "Content-Type" should be "application/json"
Then the response body should match JSON:
"""
{
"page_1.pdf": [
{
"title": "Index",
"page": 1
}
],
"page_2.pdf": [
{
"title": "Index",
"page": 1
}
]
}
"""
Scenario: POST /forms/pdfengines/bookmarks/{write|read} (Many PDFs & Bookmarks Map)
Given I have a default Gotenberg container
When I make a "POST" request to Gotenberg at the "/forms/pdfengines/bookmarks/write" endpoint with the following form data and header(s):
| files. | testdata/page_1.pdf | file |
| files | testdata/page_2.pdf | file |
| bookmarks | {"page_1.pdf":[{"title":"Index","page":1}],"page_2.pdf":[{"title":"Index","page":1}]} | field |
Then the response status code should be 200
Then the response header "Content-Type" should be "application/zip"
Then there should be 2 PDF(s) in the response
When I make a "POST" request to Gotenberg at the "/forms/pdfengines/bookmarks/read" endpoint with the following form data and header(s):
| files | teststore/page_1.pdf | file |
| files | teststore/page_2.pdf | file |
Then the response status code should be 200
Then the response header "Content-Type" should be "application/json"
Then the response body should match JSON:
"""
{
"page_1.pdf": [
{
"title": "Index",
"page": 1
}
],
"page_2.pdf": [
{
"title": "Index",
"page": 1
}
]
}
"""
Scenario: POST /forms/pdfengines/bookmarks/read (Empty List)
Given I have a default Gotenberg container
When I make a "POST" request to Gotenberg at the "/forms/pdfengines/bookmarks/read" endpoint with the following form data and header(s):
| files | testdata/page_1.pdf | file |
Then the response status code should be 200
Then the response header "Content-Type" should be "application/json"
Then the response body should match JSON:
"""
{
"page_1.pdf": []
}
"""
Scenario: POST /forms/pdfengines/bookmarks/write (Bad Request)
Given I have a default Gotenberg container
When I make a "POST" request to Gotenberg at the "/forms/pdfengines/bookmarks/write" endpoint with the following form data and header(s):
| Gotenberg-Output-Filename | foo | header |
Then the response status code should be 400
Then the response header "Content-Type" should be "text/plain; charset=UTF-8"
Then the response body should match string:
"""
Invalid form data: form field 'bookmarks' is required; no form file found for extensions: [.pdf]
"""
Given I have a default Gotenberg container
When I make a "POST" request to Gotenberg at the "/forms/pdfengines/bookmarks/write" endpoint with the following form data and header(s):
| files | testdata/page_1.pdf | file |
| bookmarks | foo | field |
Then the response status code should be 400
Then the response header "Content-Type" should be "text/plain; charset=UTF-8"
Then the response body should match string:
"""
Invalid form data: form field 'bookmarks' is invalid (got 'foo', resulting to unmarshal bookmarks: invalid character 'o' in literal false (expecting 'a'))
"""
Scenario: POST /forms/pdfengines/bookmarks/read (Bad Request)
Given I have a default Gotenberg container
When I make a "POST" request to Gotenberg at the "/forms/pdfengines/bookmarks/read" endpoint with the following form data and header(s):
| Gotenberg-Output-Filename | foo | header |
Then the response status code should be 400
Then the response header "Content-Type" should be "text/plain; charset=UTF-8"
Then the response body should match string:
"""
Invalid form data: no form file found for extensions: [.pdf]
"""
Scenario: POST /forms/pdfengines/bookmarks/write (Routes Disabled)
Given I have a Gotenberg container with the following environment variable(s):
| PDFENGINES_DISABLE_ROUTES | true |
When I make a "POST" request to Gotenberg at the "/forms/pdfengines/bookmarks/write" endpoint with the following form data and header(s):
| files | testdata/page_1.pdf | file |
| bookmarks | [{"title":"Index","page":1}] | field |
Then the response status code should be 404
Scenario: POST /forms/pdfengines/bookmarks/read (Routes Disabled)
Given I have a Gotenberg container with the following environment variable(s):
| PDFENGINES_DISABLE_ROUTES | true |
When I make a "POST" request to Gotenberg at the "/forms/pdfengines/bookmarks/write" endpoint with the following form data and header(s):
| files | testdata/page_1.pdf | file |
Then the response status code should be 404
Scenario: POST /forms/pdfengines/bookmarks/write (Gotenberg Trace)
Given I have a default Gotenberg container
When I make a "POST" request to Gotenberg at the "/forms/pdfengines/bookmarks/write" endpoint with the following form data and header(s):
| files | testdata/page_1.pdf | file |
| bookmarks | [{"title":"Index","page":1}] | field |
| Gotenberg-Trace | forms_pdfengines_bookmarks_write | header |
Then the response status code should be 200
Then the response header "Content-Type" should be "application/pdf"
Then the response header "Gotenberg-Trace" should be "forms_pdfengines_bookmarks_write"
Then the Gotenberg container should log the following entries:
| "trace":"forms_pdfengines_bookmarks_write" |
Scenario: POST /forms/pdfengines/bookmarks/read (Gotenberg Trace)
Given I have a default Gotenberg container
When I make a "POST" request to Gotenberg at the "/forms/pdfengines/bookmarks/read" endpoint with the following form data and header(s):
| files | testdata/page_1.pdf | file |
| Gotenberg-Trace | forms_pdfengines_bookmarks_read | header |
Then the response status code should be 200
Then the response header "Content-Type" should be "application/json"
Then the response header "Gotenberg-Trace" should be "forms_pdfengines_bookmarks_read"
Then the Gotenberg container should log the following entries:
| "trace":"forms_pdfengines_bookmarks_read" |
@output-filename
Scenario: POST /forms/pdfengines/bookmarks/write (Output Filename - Single PDF)
Given I have a default Gotenberg container
When I make a "POST" request to Gotenberg at the "/forms/pdfengines/bookmarks/write" endpoint with the following form data and header(s):
| files | testdata/page_1.pdf | file |
| bookmarks | [{"title":"Index","page":1}] | field |
| Gotenberg-Output-Filename | foo | header |
Then the response status code should be 200
Then the response header "Content-Type" should be "application/pdf"
Then there should be the following file(s) in the response:
| foo.pdf |
@output-filename
Scenario: POST /forms/pdfengines/bookmarks/write (Output Filename - Many PDFs)
Given I have a default Gotenberg container
When I make a "POST" request to Gotenberg at the "/forms/pdfengines/bookmarks/write" endpoint with the following form data and header(s):
| files | testdata/page_1.pdf | file |
| files | testdata/page_2.pdf | file |
| bookmarks | [{"title":"Index","page":1}] | field |
| Gotenberg-Output-Filename | foo | header |
Then the response status code should be 200
Then the response header "Content-Type" should be "application/zip"
Then there should be the following file(s) in the response:
| foo.zip |
| page_1.pdf |
| page_2.pdf |
@download-from
Scenario: POST /forms/pdfengines/bookmarks/write (Download From)
Given I have a default Gotenberg container
Given I have a static server
When I make a "POST" request to Gotenberg at the "/forms/pdfengines/bookmarks/write" endpoint with the following form data and header(s):
| bookmarks | [{"title":"Index","page":1}] | field |
| downloadFrom | [{"url":"http://host.docker.internal:%d/static/testdata/page_1.pdf","extraHttpHeaders":{"X-Foo":"bar"}}] | field |
| Gotenberg-Output-Filename | foo | header |
Then the file request header "X-Foo" should be "bar"
Then the response status code should be 200
Then the response header "Content-Type" should be "application/pdf"
@download-from
Scenario: POST /forms/pdfengines/bookmarks/read (Download From)
Given I have a default Gotenberg container
Given I have a static server
When I make a "POST" request to Gotenberg at the "/forms/pdfengines/bookmarks/read" endpoint with the following form data and header(s):
| downloadFrom | [{"url":"http://host.docker.internal:%d/static/testdata/page_1.pdf","extraHttpHeaders":{"X-Foo":"bar"}}] | field |
Then the file request header "X-Foo" should be "bar"
Then the response status code should be 200
Then the response header "Content-Type" should be "application/json"
@webhook
Scenario: POST /forms/pdfengines/bookmarks/write (Webhook)
Given I have a default Gotenberg container
Given I have a webhook server
When I make a "POST" request to Gotenberg at the "/forms/pdfengines/bookmarks/write" endpoint with the following form data and header(s):
| files | testdata/page_1.pdf | file |
| bookmarks | [{"title":"Index","page":1}] | field |
| Gotenberg-Webhook-Url | http://host.docker.internal:%d/webhook | header |
| Gotenberg-Webhook-Error-Url | http://host.docker.internal:%d/webhook/error | header |
| Gotenberg-Output-Filename | foo | header |
Then the response status code should be 204
When I wait for the asynchronous request to the webhook
Then the webhook request header "Content-Type" should be "application/pdf"
Then there should be 1 PDF(s) in the webhook request
When I make a "POST" request to Gotenberg at the "/forms/pdfengines/bookmarks/read" endpoint with the following form data and header(s):
| files | teststore/foo.pdf | file |
Then the response status code should be 200
Then the response header "Content-Type" should be "application/json"
Then the response body should match JSON:
"""
{
"foo.pdf": [
{
"title": "Index",
"page": 1
}
]
}
"""
@webhook
Scenario: POST /forms/pdfengines/bookmarks/read (Webhook)
Given I have a default Gotenberg container
Given I have a webhook server
When I make a "POST" request to Gotenberg at the "/forms/pdfengines/bookmarks/read" endpoint with the following form data and header(s):
| files | testdata/page_1.pdf | file |
| Gotenberg-Webhook-Url | http://host.docker.internal:%d/webhook | header |
| Gotenberg-Webhook-Error-Url | http://host.docker.internal:%d/webhook/error | header |
Then the response status code should be 204
When I wait for the asynchronous request to the webhook
Then the webhook request header "Content-Type" should be "application/json"
Then the webhook request body should match JSON:
"""
{
"status": 400,
"message": "The webhook middleware can only work with multipart/form-data routes that results in output files"
}
"""
Scenario: POST /forms/pdfengines/bookmarks/write (Basic Auth)
Given I have a Gotenberg container with the following environment variable(s):
| API_ENABLE_BASIC_AUTH | true |
| GOTENBERG_API_BASIC_AUTH_USERNAME | foo |
| GOTENBERG_API_BASIC_AUTH_PASSWORD | bar |
When I make a "POST" request to Gotenberg at the "/forms/pdfengines/bookmarks/write" endpoint with the following form data and header(s):
| files | testdata/page_1.pdf | file |
| bookmarks | [{"title":"Index","page":1}] | field |
Then the response status code should be 401
Scenario: POST /forms/pdfengines/bookmarks/read (Basic Auth)
Given I have a Gotenberg container with the following environment variable(s):
| API_ENABLE_BASIC_AUTH | true |
| GOTENBERG_API_BASIC_AUTH_USERNAME | foo |
| GOTENBERG_API_BASIC_AUTH_PASSWORD | bar |
When I make a "POST" request to Gotenberg at the "/forms/pdfengines/bookmarks/write" endpoint with the following form data and header(s):
| files | testdata/page_1.pdf | file |
Then the response status code should be 401
Scenario: POST /foo/forms/pdfengines/bookmarks/{write|read} (Root Path)
Given I have a Gotenberg container with the following environment variable(s):
| API_ENABLE_DEBUG_ROUTE | true |
| API_ROOT_PATH | /foo/ |
When I make a "POST" request to Gotenberg at the "/foo/forms/pdfengines/bookmarks/write" endpoint with the following form data and header(s):
| files | testdata/page_1.pdf | file |
| bookmarks | [{"title":"Index","page":1}] | field |
| Gotenberg-Output-Filename | foo | header |
Then the response status code should be 200
Then the response header "Content-Type" should be "application/pdf"
When I make a "POST" request to Gotenberg at the "/foo/forms/pdfengines/bookmarks/read" endpoint with the following form data and header(s):
| files | teststore/foo.pdf | file |
Then the response status code should be 200
Then the response header "Content-Type" should be "application/json"

View File

@@ -105,17 +105,20 @@ Feature: /forms/pdfengines/convert
Invalid form data: form field 'pdfua' is invalid (got 'foo', resulting to strconv.ParseBool: parsing "foo": invalid syntax)
"""
Scenario: POST /forms/pdfengines/convert (Gotenberg Trace)
@telemetry
Scenario: POST /forms/pdfengines/convert (Telemetry)
Given I have a default Gotenberg container
When I make a "POST" request to Gotenberg at the "/forms/pdfengines/convert" endpoint with the following form data and header(s):
| files | testdata/page_1.pdf | file |
| pdfa | PDF/A-1b | field |
| Gotenberg-Trace | forms_pdfengines_convert | header |
| files | testdata/page_1.pdf | file |
| pdfa | PDF/A-1b | field |
| X-Correlation-ID | forms_pdfengines_convert | header |
| traceparent | 00-12345678901234567890123456789012-1234567890123456-01 | header |
Then the response status code should be 200
Then the response header "Content-Type" should be "application/pdf"
Then the response header "Gotenberg-Trace" should be "forms_pdfengines_convert"
Then the response header "X-Correlation-ID" should be "forms_pdfengines_convert"
Then the Gotenberg container should log the following entries:
| "trace":"forms_pdfengines_convert" |
| "correlation_id":"forms_pdfengines_convert" |
| "trace_id":"12345678901234567890123456789012" |
@output-filename
Scenario: POST /forms/pdfengines/convert (Output Filename - Single PDF)

View File

@@ -123,17 +123,20 @@ Feature: /forms/pdfengines/encrypt
| files | testdata/page_1.pdf | file |
Then the response status code should be 404
Scenario: POST /forms/pdfengines/encrypt (Gotenberg Trace)
@telemetry
Scenario: POST /forms/pdfengines/encrypt (Telemetry)
Given I have a default Gotenberg container
When I make a "POST" request to Gotenberg at the "/forms/pdfengines/encrypt" endpoint with the following form data and header(s):
| files | testdata/page_1.pdf | file |
| userPassword | foo | field |
| Gotenberg-Trace | forms_pdfengines_encrypt | header |
| files | testdata/page_1.pdf | file |
| userPassword | foo | field |
| X-Correlation-ID | forms_pdfengines_encrypt | header |
| traceparent | 00-12345678901234567890123456789012-1234567890123456-01 | header |
Then the response status code should be 200
Then the response header "Content-Type" should be "application/pdf"
Then the response header "Gotenberg-Trace" should be "forms_pdfengines_encrypt"
Then the response header "X-Correlation-ID" should be "forms_pdfengines_encrypt"
Then the Gotenberg container should log the following entries:
| "trace":"forms_pdfengines_encrypt" |
| "correlation_id":"forms_pdfengines_encrypt" |
| "trace_id":"12345678901234567890123456789012" |
@download-from
Scenario: POST /forms/pdfengines/encrypt (Download From)

View File

@@ -40,16 +40,19 @@ Feature: /forms/pdfengines/flatten
| files | testdata/page_1.pdf | file |
Then the response status code should be 404
Scenario: POST /forms/pdfengines/flatten (Gotenberg Trace)
@telemetry
Scenario: POST /forms/pdfengines/flatten (Telemetry)
Given I have a default Gotenberg container
When I make a "POST" request to Gotenberg at the "/forms/pdfengines/flatten" endpoint with the following form data and header(s):
| files | testdata/page_1.pdf | file |
| Gotenberg-Trace | forms_pdfengines_flatten | header |
| files | testdata/page_1.pdf | file |
| X-Correlation-ID | forms_pdfengines_flatten | header |
| traceparent | 00-12345678901234567890123456789012-1234567890123456-01 | header |
Then the response status code should be 200
Then the response header "Content-Type" should be "application/pdf"
Then the response header "Gotenberg-Trace" should be "forms_pdfengines_flatten"
Then the response header "X-Correlation-ID" should be "forms_pdfengines_flatten"
Then the Gotenberg container should log the following entries:
| "trace":"forms_pdfengines_flatten" |
| "correlation_id":"forms_pdfengines_flatten" |
| "trace_id":"12345678901234567890123456789012" |
@output-filename
Scenario: POST /forms/pdfengines/flatten (Output Filename - Single PDF)

View File

@@ -252,25 +252,25 @@ Feature: /forms/pdfengines/merge
Then there should be 1 PDF(s) in the response
Then the response PDF(s) should be encrypted
@embed
Scenario: POST /foo/forms/pdfengines/merge (Embeds)
@attachments
Scenario: POST /foo/forms/pdfengines/merge (Attachments)
Given I have a default Gotenberg container
When I make a "POST" request to Gotenberg at the "/forms/pdfengines/merge" endpoint with the following form data and header(s):
| files | testdata/page_1.pdf | file |
| files | testdata/page_2.pdf | file |
| embeds | testdata/embed_1.xml | file |
| embeds | testdata/embed_2.xml | file |
| Gotenberg-Output-Filename | foo | header |
| files | testdata/page_1.pdf | file |
| files | testdata/page_2.pdf | file |
| attachments | testdata/attachment_1.xml | file |
| attachments | testdata/attachment_2.xml | file |
| Gotenberg-Output-Filename | foo | header |
Then the response status code should be 200
Then the response PDF(s) should have the "embed_1.xml" file embedded
Then the response PDF(s) should have the "embed_2.xml" file embedded
Then the response PDF(s) should have the "attachment_1.xml" file attached
Then the response PDF(s) should have the "attachment_2.xml" file attached
# FIXME: once decrypt is done, add encrypt and check after the content of the PDF.
@convert
@metadata
@flatten
@embed
Scenario: POST /forms/pdfengines/merge (PDF/A-1b & PDF/UA-1 & Metadata & Flatten & Embeds)
@attachments
Scenario: POST /forms/pdfengines/merge (PDF/A-1b & PDF/UA-1 & Metadata & Flatten & Attachments)
Given I have a default Gotenberg container
When I make a "POST" request to Gotenberg at the "/forms/pdfengines/merge" endpoint with the following form data and header(s):
| files | testdata/page_1.pdf | file |
@@ -279,8 +279,8 @@ Feature: /forms/pdfengines/merge
| pdfua | true | field |
| metadata | {"Author":"Julien Neuhart","Copyright":"Julien Neuhart","CreateDate":"2006-09-18T16:27:50-04:00","Creator":"Gotenberg","Keywords":["first","second"],"Marked":true,"ModDate":"2006-09-18T16:27:50-04:00","PDFVersion":1.7,"Producer":"Gotenberg","Subject":"Sample","Title":"Sample","Trapped":"Unknown"} | field |
| flatten | true | field |
| embeds | testdata/embed_1.xml | file |
| embeds | testdata/embed_2.xml | file |
| attachments | testdata/attachment_1.xml | file |
| attachments | testdata/attachment_2.xml | file |
| Gotenberg-Output-Filename | foo | header |
Then the response status code should be 200
Then the response header "Content-Type" should be "application/pdf"
@@ -299,8 +299,8 @@ Feature: /forms/pdfengines/merge
Then the response PDF(s) should be valid "PDF/A-1b" with a tolerance of 10 failed rule(s)
Then the response PDF(s) should be valid "PDF/UA-1" with a tolerance of 2 failed rule(s)
Then the response PDF(s) should be flatten
Then the response PDF(s) should have the "embed_1.xml" file embedded
Then the response PDF(s) should have the "embed_2.xml" file embedded
Then the response PDF(s) should have the "attachment_1.xml" file attached
Then the response PDF(s) should have the "attachment_2.xml" file attached
When I make a "POST" request to Gotenberg at the "/forms/pdfengines/metadata/read" endpoint with the following form data and header(s):
| files | teststore/foo.pdf | file |
Then the response status code should be 200
@@ -333,17 +333,20 @@ Feature: /forms/pdfengines/merge
| files | testdata/page_2.pdf | file |
Then the response status code should be 404
Scenario: POST /forms/pdfengines/merge (Gotenberg Trace)
@telemetry
Scenario: POST /forms/pdfengines/merge (Telemetry)
Given I have a default Gotenberg container
When I make a "POST" request to Gotenberg at the "/forms/pdfengines/merge" endpoint with the following form data and header(s):
| files | testdata/page_1.pdf | file |
| files | testdata/page_2.pdf | file |
| Gotenberg-Trace | forms_pdfengines_merge | header |
| files | testdata/page_1.pdf | file |
| files | testdata/page_2.pdf | file |
| X-Correlation-ID | forms_pdfengines_merge | header |
| traceparent | 00-12345678901234567890123456789012-1234567890123456-01 | header |
Then the response status code should be 200
Then the response header "Content-Type" should be "application/pdf"
Then the response header "Gotenberg-Trace" should be "forms_pdfengines_merge"
Then the response header "X-Correlation-ID" should be "forms_pdfengines_merge"
Then the Gotenberg container should log the following entries:
| "trace":"forms_pdfengines_merge" |
| "correlation_id":"forms_pdfengines_merge" |
| "trace_id":"12345678901234567890123456789012" |
@download-from
Scenario: POST /forms/pdfengines/merge (Download From)

View File

@@ -1,7 +1,7 @@
@pdfengines
@pdfengines-metadata
@metadata
Feature: /forms/pdfengines/metadata/{write|read}
Feature: /forms/pdfengines/{write|read}
Scenario: POST /forms/pdfengines/metadata/{write|read} (Single PDF)
Given I have a default Gotenberg container
@@ -131,28 +131,34 @@ Feature: /forms/pdfengines/metadata/{write|read}
| files | testdata/page_1.pdf | file |
Then the response status code should be 404
Scenario: POST /forms/pdfengines/metadata/write (Gotenberg Trace)
@telemetry
Scenario: POST /forms/pdfengines/metadata/write (Telemetry)
Given I have a default Gotenberg container
When I make a "POST" request to Gotenberg at the "/forms/pdfengines/metadata/write" endpoint with the following form data and header(s):
| files | testdata/page_1.pdf | file |
| metadata | {"Author":"Julien Neuhart","Copyright":"Julien Neuhart","CreateDate":"2006-09-18T16:27:50-04:00","Creator":"Gotenberg","Keywords":["first","second"],"Marked":true,"ModDate":"2006-09-18T16:27:50-04:00","PDFVersion":1.7,"Producer":"Gotenberg","Subject":"Sample","Title":"Sample","Trapped":"Unknown"} | field |
| Gotenberg-Trace | forms_pdfengines_metadata_write | header |
| files | testdata/page_1.pdf | file |
| metadata | {"Author":"Julien Neuhart","Copyright":"Julien Neuhart","CreateDate":"2006-09-18T16:27:50-04:00","Creator":"Gotenberg","Keywords":["first","second"],"Marked":true,"ModDate":"2006-09-18T16:27:50-04:00","PDFVersion":1.7,"Producer":"Gotenberg","Subject":"Sample","Title":"Sample","Trapped":"Unknown"} | field |
| X-Correlation-ID | forms_pdfengines_metadata_write | header |
| traceparent | 00-12345678901234567890123456789012-1234567890123456-01 | header |
Then the response status code should be 200
Then the response header "Content-Type" should be "application/pdf"
Then the response header "Gotenberg-Trace" should be "forms_pdfengines_metadata_write"
Then the response header "X-Correlation-ID" should be "forms_pdfengines_metadata_write"
Then the Gotenberg container should log the following entries:
| "trace":"forms_pdfengines_metadata_write" |
| "correlation_id":"forms_pdfengines_metadata_write" |
| "trace_id":"12345678901234567890123456789012" |
Scenario: POST /forms/pdfengines/metadata/read (Gotenberg Trace)
@telemetry
Scenario: POST /forms/pdfengines/metadata/read (Telemetry)
Given I have a default Gotenberg container
When I make a "POST" request to Gotenberg at the "/forms/pdfengines/metadata/read" endpoint with the following form data and header(s):
| files | testdata/page_1.pdf | file |
| Gotenberg-Trace | forms_pdfengines_metadata_read | header |
| files | testdata/page_1.pdf | file |
| X-Correlation-ID | forms_pdfengines_metadata_read | header |
| traceparent | 00-12345678901234567890123456789012-1234567890123456-01 | header |
Then the response status code should be 200
Then the response header "Content-Type" should be "application/json"
Then the response header "Gotenberg-Trace" should be "forms_pdfengines_metadata_read"
Then the response header "X-Correlation-ID" should be "forms_pdfengines_metadata_read"
Then the Gotenberg container should log the following entries:
| "trace":"forms_pdfengines_metadata_read" |
| "correlation_id":"forms_pdfengines_metadata_read" |
| "trace_id":"12345678901234567890123456789012" |
@output-filename
Scenario: POST /forms/pdfengines/metadata/write (Output Filename - Single PDF)

View File

@@ -473,41 +473,41 @@ Feature: /forms/pdfengines/split
Then there should be 2 PDF(s) in the response
Then the response PDF(s) should be encrypted
@embed
Scenario: POST /foo/forms/pdfengines/split (Embeds)
@attachments
Scenario: POST /foo/forms/pdfengines/split (Attachments)
Given I have a default Gotenberg container
When I make a "POST" request to Gotenberg at the "/forms/pdfengines/split" endpoint with the following form data and header(s):
| files | testdata/pages_3.pdf | file |
| embeds | testdata/embed_1.xml | file |
| embeds | testdata/embed_2.xml | file |
| splitMode | intervals | field |
| splitSpan | 2 | field |
| files | testdata/pages_3.pdf | file |
| attachments | testdata/attachment_1.xml | file |
| attachments | testdata/attachment_2.xml | file |
| splitMode | intervals | field |
| splitSpan | 2 | field |
Then the response status code should be 200
And the response header "Content-Type" should be "application/zip"
And there should be 2 PDF(s) in the response
And there should be the following file(s) in the response:
| pages_3_0.pdf |
| pages_3_1.pdf |
Then the response PDF(s) should have the "embed_1.xml" file embedded
Then the response PDF(s) should have the "embed_2.xml" file embedded
Then the response PDF(s) should have the "attachment_1.xml" file attached
Then the response PDF(s) should have the "attachment_2.xml" file attached
# FIXME: once decrypt is done, add encrypt and check after the content of the PDFs.
@convert
@metadata
@flatten
@embed
Scenario: POST /forms/pdfengines/split (PDF/A-1b & PDF/UA-1 & Metadata & Flatten & Embeds)
@attachments
Scenario: POST /forms/pdfengines/split (PDF/A-1b & PDF/UA-1 & Metadata & Flatten & Attachments)
Given I have a default Gotenberg container
When I make a "POST" request to Gotenberg at the "/forms/pdfengines/split" endpoint with the following form data and header(s):
| files | testdata/pages_3.pdf | file |
| splitMode | intervals | field |
| splitSpan | 2 | field |
| pdfa | PDF/A-1b | field |
| pdfua | true | field |
| metadata | {"Author":"Julien Neuhart","Copyright":"Julien Neuhart","CreateDate":"2006-09-18T16:27:50-04:00","Creator":"Gotenberg","Keywords":["first","second"],"Marked":true,"ModDate":"2006-09-18T16:27:50-04:00","PDFVersion":1.7,"Producer":"Gotenberg","Subject":"Sample","Title":"Sample","Trapped":"Unknown"} | field |
| flatten | true | field |
| embeds | testdata/embed_1.xml | file |
| embeds | testdata/embed_2.xml | file |
| files | testdata/pages_3.pdf | file |
| splitMode | intervals | field |
| splitSpan | 2 | field |
| pdfa | PDF/A-1b | field |
| pdfua | true | field |
| metadata | {"Author":"Julien Neuhart","Copyright":"Julien Neuhart","CreateDate":"2006-09-18T16:27:50-04:00","Creator":"Gotenberg","Keywords":["first","second"],"Marked":true,"ModDate":"2006-09-18T16:27:50-04:00","PDFVersion":1.7,"Producer":"Gotenberg","Subject":"Sample","Title":"Sample","Trapped":"Unknown"} | field |
| flatten | true | field |
| attachments | testdata/attachment_1.xml | file |
| attachments | testdata/attachment_2.xml | file |
Then the response status code should be 200
Then the response header "Content-Type" should be "application/zip"
Then there should be 2 PDF(s) in the response
@@ -531,8 +531,8 @@ Feature: /forms/pdfengines/split
Then the response PDF(s) should be valid "PDF/A-1b" with a tolerance of 10 failed rule(s)
Then the response PDF(s) should be valid "PDF/UA-1" with a tolerance of 2 failed rule(s)
Then the response PDF(s) should be flatten
Then the response PDF(s) should have the "embed_1.xml" file embedded
Then the response PDF(s) should have the "embed_2.xml" file embedded
Then the response PDF(s) should have the "attachment_1.xml" file attached
Then the response PDF(s) should have the "attachment_2.xml" file attached
When I make a "POST" request to Gotenberg at the "/forms/pdfengines/metadata/read" endpoint with the following form data and header(s):
| files | teststore/pages_3_0.pdf | file |
| files | teststore/pages_3_1.pdf | file |
@@ -581,18 +581,21 @@ Feature: /forms/pdfengines/split
| splitSpan | 2 | field |
Then the response status code should be 404
Scenario: POST /forms/pdfengines/split (Gotenberg Trace)
@telemetry
Scenario: POST /forms/pdfengines/split (Telemetry)
Given I have a default Gotenberg container
When I make a "POST" request to Gotenberg at the "/forms/pdfengines/split" endpoint with the following form data and header(s):
| files | testdata/pages_3.pdf | file |
| splitMode | intervals | field |
| splitSpan | 2 | field |
| Gotenberg-Trace | forms_pdfengines_split | header |
| files | testdata/pages_3.pdf | file |
| splitMode | intervals | field |
| splitSpan | 2 | field |
| X-Correlation-ID | forms_pdfengines_split | header |
| traceparent | 00-12345678901234567890123456789012-1234567890123456-01 | header |
Then the response status code should be 200
Then the response header "Content-Type" should be "application/zip"
Then the response header "Gotenberg-Trace" should be "forms_pdfengines_split"
Then the response header "X-Correlation-ID" should be "forms_pdfengines_split"
Then the Gotenberg container should log the following entries:
| "trace":"forms_pdfengines_split" |
| "correlation_id":"forms_pdfengines_split" |
| "trace_id":"12345678901234567890123456789012" |
@output-filename
Scenario: POST /forms/pdfengines/split (Output Filename - Single PDF)

View File

@@ -1,116 +0,0 @@
# TODO:
# 1. Count restarts.
# 2. Count queue size.
@prometheus-metrics
Feature: /prometheus/metrics
Scenario: GET /prometheus/metrics (Enabled)
Given I have a default Gotenberg container
When I make a "GET" request to Gotenberg at the "/prometheus/metrics" endpoint
Then the response status code should be 200
Then the response header "Content-Type" should be "text/plain; version=0.0.4; charset=utf-8; escaping=underscores"
Then the response body should match string:
"""
# HELP gotenberg_chromium_requests_queue_size Current number of Chromium conversion requests waiting to be treated.
# TYPE gotenberg_chromium_requests_queue_size gauge
gotenberg_chromium_requests_queue_size 0
# HELP gotenberg_chromium_restarts_count Current number of Chromium restarts.
# TYPE gotenberg_chromium_restarts_count gauge
gotenberg_chromium_restarts_count 0
# HELP gotenberg_libreoffice_requests_queue_size Current number of LibreOffice conversion requests waiting to be treated.
# TYPE gotenberg_libreoffice_requests_queue_size gauge
gotenberg_libreoffice_requests_queue_size 0
# HELP gotenberg_libreoffice_restarts_count Current number of LibreOffice restarts.
# TYPE gotenberg_libreoffice_restarts_count gauge
gotenberg_libreoffice_restarts_count 0
"""
Then the Gotenberg container should log the following entries:
| "path":"/prometheus/metrics" |
Scenario: GET /custom/metrics (Custom Metrics Path)
Given I have a Gotenberg container with the following environment variable(s):
| PROMETHEUS_METRICS_PATH | /custom/metrics |
When I make a "GET" request to Gotenberg at the "/custom/metrics" endpoint
Then the response status code should be 200
Then the response header "Content-Type" should be "text/plain; version=0.0.4; charset=utf-8; escaping=underscores"
Then the response body should match string:
"""
# HELP gotenberg_chromium_requests_queue_size Current number of Chromium conversion requests waiting to be treated.
# TYPE gotenberg_chromium_requests_queue_size gauge
gotenberg_chromium_requests_queue_size 0
# HELP gotenberg_chromium_restarts_count Current number of Chromium restarts.
# TYPE gotenberg_chromium_restarts_count gauge
gotenberg_chromium_restarts_count 0
# HELP gotenberg_libreoffice_requests_queue_size Current number of LibreOffice conversion requests waiting to be treated.
# TYPE gotenberg_libreoffice_requests_queue_size gauge
gotenberg_libreoffice_requests_queue_size 0
# HELP gotenberg_libreoffice_restarts_count Current number of LibreOffice restarts.
# TYPE gotenberg_libreoffice_restarts_count gauge
gotenberg_libreoffice_restarts_count 0
"""
Then the Gotenberg container should log the following entries:
| "path":"/custom/metrics" |
Scenario: GET /prometheus/metrics (Custom Namespace)
Given I have a Gotenberg container with the following environment variable(s):
| PROMETHEUS_NAMESPACE | foo |
When I make a "GET" request to Gotenberg at the "/prometheus/metrics" endpoint
Then the response status code should be 200
Then the response header "Content-Type" should be "text/plain; version=0.0.4; charset=utf-8; escaping=underscores"
Then the response body should match string:
"""
# HELP foo_chromium_requests_queue_size Current number of Chromium conversion requests waiting to be treated.
# TYPE foo_chromium_requests_queue_size gauge
foo_chromium_requests_queue_size 0
# HELP foo_chromium_restarts_count Current number of Chromium restarts.
# TYPE foo_chromium_restarts_count gauge
foo_chromium_restarts_count 0
# HELP foo_libreoffice_requests_queue_size Current number of LibreOffice conversion requests waiting to be treated.
# TYPE foo_libreoffice_requests_queue_size gauge
foo_libreoffice_requests_queue_size 0
# HELP foo_libreoffice_restarts_count Current number of LibreOffice restarts.
# TYPE foo_libreoffice_restarts_count gauge
foo_libreoffice_restarts_count 0
"""
Scenario: GET /prometheus/metrics (Disabled)
Given I have a Gotenberg container with the following environment variable(s):
| PROMETHEUS_DISABLE_COLLECT | true |
When I make a "GET" request to Gotenberg at the "/prometheus/metrics" endpoint
Then the response status code should be 404
Scenario: GET /prometheus/metrics (No Logging)
Given I have a Gotenberg container with the following environment variable(s):
| PROMETHEUS_DISABLE_ROUTE_LOGGING | true |
When I make a "GET" request to Gotenberg at the "/prometheus/metrics" endpoint
Then the response status code should be 200
Then the Gotenberg container should NOT log the following entries:
| "path":"/prometheus/metrics" |
Scenario: GET /prometheus/metrics (Gotenberg Trace)
Given I have a default Gotenberg container
When I make a "GET" request to Gotenberg at the "/prometheus/metrics" endpoint with the following header(s):
| Gotenberg-Trace | prometheus_metrics |
Then the response status code should be 200
Then the response header "Gotenberg-Trace" should be "prometheus_metrics"
Then the Gotenberg container should log the following entries:
| "trace":"prometheus_metrics" |
Scenario: GET /prometheus/metrics (Basic Auth)
Given I have a Gotenberg container with the following environment variable(s):
| API_ENABLE_BASIC_AUTH | true |
| GOTENBERG_API_BASIC_AUTH_USERNAME | foo |
| GOTENBERG_API_BASIC_AUTH_PASSWORD | bar |
When I make a "GET" request to Gotenberg at the "/prometheus/metrics" endpoint
Then the response status code should be 401
Scenario: GET /foo/prometheus/metrics (Root Path)
Given I have a Gotenberg container with the following environment variable(s):
| API_ENABLE_DEBUG_ROUTE | true |
| API_ROOT_PATH | /foo/ |
When I make a "GET" request to Gotenberg at the "/foo/prometheus/metrics" endpoint
Then the response status code should be 200

View File

@@ -11,14 +11,29 @@ Feature: /
Hey, Gotenberg has no UI, it's an API. Head to the <a href="https://gotenberg.dev">documentation</a> to learn how to interact with it 🚀
"""
Scenario: GET / (Gotenberg Trace)
@telemetry
Scenario: GET / (Telemetry)
Given I have a default Gotenberg container
When I make a "GET" request to Gotenberg at the "/" endpoint with the following header(s):
| Gotenberg-Trace | root |
| X-Correlation-ID | root |
| traceparent | 00-12345678901234567890123456789012-1234567890123456-01 |
Then the response status code should be 200
Then the response header "Gotenberg-Trace" should be "root"
Then the response header "X-Correlation-ID" should be "root"
Then the Gotenberg container should log the following entries:
| "trace":"root" |
| "correlation_id":"root" |
| "trace_id":"12345678901234567890123456789012" |
@telemetry
Scenario: GET / (No Telemetry)
Given I have a Gotenberg container with the following environment variable(s):
| API_DISABLE_ROOT_ROUTE_TELEMETRY | true |
When I make a "GET" request to Gotenberg at the "/" endpoint with the following header(s):
| X-Correlation-ID | root_no_telemetry |
| traceparent | 00-12345678901234567890123456789012-1234567890123456-01 |
Then the response status code should be 200
Then the Gotenberg container should NOT log the following entries:
| "correlation_id":"root_no_telemetry" |
| "trace_id":"12345678901234567890123456789012" |
Scenario: GET / (Basic Auth)
Given I have a Gotenberg container with the following environment variable(s):
@@ -39,14 +54,16 @@ Feature: /
When I make a "GET" request to Gotenberg at the "/favicon.ico" endpoint
Then the response status code should be 204
Scenario: GET /favicon.ico (Gotenberg Trace)
@telemetry
Scenario: GET /favicon.ico (No Telemetry)
Given I have a default Gotenberg container
When I make a "GET" request to Gotenberg at the "/favicon.ico" endpoint with the following header(s):
| Gotenberg-Trace | favicon |
| X-Correlation-ID | favicon_no_telemetry |
| traceparent | 00-12345678901234567890123456789012-1234567890123456-01 |
Then the response status code should be 204
Then the response header "Gotenberg-Trace" should be "favicon"
Then the Gotenberg container should log the following entries:
| "trace":"favicon" |
Then the Gotenberg container should NOT log the following entries:
| "correlation_id":"favicon_no_telemetry" |
| "trace_id":"12345678901234567890123456789012" |
Scenario: GET /favicon.ico (Basic Auth)
Given I have a Gotenberg container with the following environment variable(s):

View File

@@ -11,14 +11,29 @@ Feature: /version
{version}
"""
Scenario: GET /version (Gotenberg Trace)
@telemetry
Scenario: GET /version (Telemetry)
Given I have a default Gotenberg container
When I make a "GET" request to Gotenberg at the "/version" endpoint with the following header(s):
| Gotenberg-Trace | version |
| X-Correlation-ID | version |
| traceparent | 00-12345678901234567890123456789012-1234567890123456-01 |
Then the response status code should be 200
Then the response header "Gotenberg-Trace" should be "version"
Then the response header "X-Correlation-ID" should be "version"
Then the Gotenberg container should log the following entries:
| "trace":"version" |
| "correlation_id":"version" |
| "trace_id":"12345678901234567890123456789012" |
@telemetry
Scenario: GET /version (No Telemetry)
Given I have a Gotenberg container with the following environment variable(s):
| API_DISABLE_VERSION_ROUTE_TELEMETRY | true |
When I make a "GET" request to Gotenberg at the "/version" endpoint with the following header(s):
| X-Correlation-ID | version_no_telemetry |
| traceparent | 00-12345678901234567890123456789012-1234567890123456-01 |
Then the response status code should be 200
Then the Gotenberg container should NOT log the following entries:
| "correlation_id":"version_no_telemetry" |
| "trace_id":"12345678901234567890123456789012" |
Scenario: GET /version (Basic Auth)
Given I have a Gotenberg container with the following environment variable(s):
@@ -30,7 +45,6 @@ Feature: /version
Scenario: GET /foo/version (Root Path)
Given I have a Gotenberg container with the following environment variable(s):
| API_ENABLE_DEBUG_ROUTE | true |
| API_ROOT_PATH | /foo/ |
| API_ROOT_PATH | /foo/ |
When I make a "GET" request to Gotenberg at the "/foo/version" endpoint
Then the response status code should be 200