-
-
Notifications
You must be signed in to change notification settings - Fork 176
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
61 changed files
with
6,474 additions
and
295 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# CHANGELOG | ||
|
||
## [next] | ||
|
||
* Remove signature verification as it is an incomplete implementation | ||
* Split helpers as they became a huge piece of code | ||
* Renamed addSignaturePlaceholder to pdfkitAddPlaceholder | ||
* Implemented plainAddPlaceholder that works without pdfkit but with string/Buffer operations instead | ||
* Started this CHNAGELOG | ||
|
||
## [0.3.0] | ||
|
||
* Added signature verification | ||
* Extracted helpers out to make them reusable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,5 +17,6 @@ module.exports = { | |
], | ||
coveragePathIgnorePatterns: [ | ||
'/node_modules/', | ||
'/src/helpers/pdfkit/', | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# SOURCES | ||
|
||
Just documenting where those PDFs came from: | ||
|
||
## contributing.pdf | ||
|
||
Exported/Printed from Chrome viewing an altered version of CONTRIBUTING.md on GitHub. | ||
|
||
## formexample.pdf | ||
|
||
[foersom.com](http://foersom.com/net/HowTo/data/OoPdfFormExample.pdf) | ||
|
||
## incrementally_signed.pdf | ||
|
||
w3dummy.pdf signed by tests with plainAddPlaceholder(). | ||
|
||
## signed.pdf | ||
|
||
Generated with PDFKit and signed by tests. | ||
|
||
## w3dummy.pdf | ||
|
||
[w3.org](https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf) |
File renamed without changes.
File renamed without changes.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Test signing errors on wrong certificate passphrase 1`] = `"PKCS#12 MAC could not be verified. Invalid password?"`; | ||
|
||
exports[`Test signing errors when no matching certificate is found in bags 1`] = `"Failed to find a certificate that matches the private key."`; | ||
|
||
exports[`Test signing expects P12 certificate to be Buffer 1`] = `"p12 certificate expected as Buffer."`; | ||
|
||
exports[`Test signing expects PDF to be Buffer 1`] = `"PDF expected as Buffer."`; | ||
|
||
exports[`Test signing expects PDF to contain a ByteRange placeholder 1`] = `"Could not find ByteRange placeholder: /ByteRange [0 /********** /********** /**********]"`; | ||
|
||
exports[`Test signing expects a reasonably sized placeholder 1`] = `"Signature exceeds placeholder length: 3224 > 4"`; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import PDFKitReferenceMock from './pdfkitReferenceMock'; | ||
|
||
describe('pdfkitReferenceMock', () => { | ||
it('stores index', () => { | ||
const index = 54321; | ||
const instance = new PDFKitReferenceMock(index); | ||
expect(instance.index).toBe(index); | ||
}); | ||
it('accepts and stores additional data', () => { | ||
const index = 123; | ||
const data = 'DATA'; | ||
const instance = new PDFKitReferenceMock(index, {a: data, b: data}); | ||
expect(instance.index).toBe(index); | ||
expect(instance.a).toBe(data); | ||
expect(instance.b).toBe(data); | ||
}); | ||
it('can be converted to string', () => { | ||
const index = 123; | ||
const instance = new PDFKitReferenceMock(index); | ||
expect(instance.toString()).toMatchSnapshot(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`pdfkitReferenceMock can be converted to string 1`] = `"123 0 R"`; |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Helpers index Exports expected helpers 1`] = ` | ||
Array [ | ||
"extractSignature", | ||
"pdfkitAddPlaceholder", | ||
"plainAddPlaceholder", | ||
"removeTrailingNewLine", | ||
] | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`pdfkitAddPlaceholder adds placeholder to PDFKit document 1`] = ` | ||
Array [ | ||
"signature", | ||
"form", | ||
"widget", | ||
] | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`pdfkitReferenceMock can be converted to string 1`] = `"123 0 R"`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export const DEFAULT_SIGNATURE_LENGTH = 8192; | ||
export const DEFAULT_BYTE_RANGE_PLACEHOLDER = '**********'; |
Oops, something went wrong.