mirror of
https://github.com/gotenberg/gotenberg.git
synced 2026-08-08 00:22:14 +01:00
chore: slight improvement of the encrypt feature to be more in line with others features
This commit is contained in:
@@ -815,6 +815,28 @@ Feature: /forms/chromium/convert/html
|
||||
Then there should be 1 PDF(s) in the response
|
||||
Then the response PDF(s) should be flatten
|
||||
|
||||
Scenario: POST /forms/chromium/convert/html (Encrypt - user password only)
|
||||
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 |
|
||||
| userPassword | foo | 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 the response PDF(s) should be encrypted
|
||||
|
||||
Scenario: POST /forms/chromium/convert/html (Encrypt - both user and owner passwords)
|
||||
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 |
|
||||
| userPassword | foo | field |
|
||||
| ownerPassword | bar | 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 the response PDF(s) should be encrypted
|
||||
|
||||
# FIXME: once decrypt is done, add encrypt and check after the content of the PDF.
|
||||
Scenario: POST /forms/chromium/convert/html (PDF/A-1b & PDF/UA-1 & Metadata & Flatten)
|
||||
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):
|
||||
@@ -920,75 +942,3 @@ Feature: /forms/chromium/convert/html
|
||||
| files | testdata/page-1-html/index.html | file |
|
||||
Then the response status code should be 200
|
||||
Then the response header "Content-Type" should be "application/pdf"
|
||||
|
||||
Scenario: POST /forms/chromium/convert/html with encryption (user password only)
|
||||
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 |
|
||||
| userPassword | test123 | field |
|
||||
| Gotenberg-Output-Filename | encrypted | 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:
|
||||
| encrypted.pdf |
|
||||
Then the "encrypted.pdf" PDF should be encrypted
|
||||
Then the "encrypted.pdf" PDF should have 1 page(s)
|
||||
|
||||
Scenario: POST /forms/chromium/convert/html with encryption (user and owner passwords)
|
||||
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 |
|
||||
| userPassword | user123 | field |
|
||||
| ownerPassword | owner456 | field |
|
||||
| Gotenberg-Output-Filename | encrypted | 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:
|
||||
| encrypted.pdf |
|
||||
Then the "encrypted.pdf" PDF should be encrypted
|
||||
Then the "encrypted.pdf" PDF should have 1 page(s)
|
||||
|
||||
Scenario: POST /forms/chromium/convert/html with encryption and PDF/A conversion
|
||||
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 |
|
||||
| userPassword | test123 | field |
|
||||
| pdfa | PDF/A-1a | field |
|
||||
| Gotenberg-Output-Filename | encrypted | 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:
|
||||
| encrypted.pdf |
|
||||
Then the "encrypted.pdf" PDF should be encrypted
|
||||
Then the "encrypted.pdf" PDF should have 1 page(s)
|
||||
|
||||
Scenario: POST /forms/chromium/convert/html with encryption and page splitting
|
||||
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/pages-12-html/index.html | file |
|
||||
| userPassword | test123 | field |
|
||||
| splitMode | intervals | field |
|
||||
| splitSpan | 5 | field |
|
||||
| Gotenberg-Output-Filename | encrypted | 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:
|
||||
| encrypted.zip |
|
||||
Then the "encrypted.zip" archive should contain encrypted PDF file(s)
|
||||
|
||||
Scenario: POST /forms/chromium/convert/html without encryption (empty password)
|
||||
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 |
|
||||
| userPassword | | field |
|
||||
| Gotenberg-Output-Filename | unencrypted | 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:
|
||||
| unencrypted.pdf |
|
||||
Then the "unencrypted.pdf" PDF should NOT be encrypted
|
||||
Then the "unencrypted.pdf" PDF should have 1 page(s)
|
||||
|
||||
Reference in New Issue
Block a user