-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add validation for exported ActivityPub tarballs #7
base: main
Are you sure you want to change the base?
Conversation
test/verify.spec.ts
Outdated
console.log(JSON.stringify(result.errors)) | ||
}) | ||
|
||
// it('should fail if outbox.json is missing', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These tests look useful. Can we include them uncommented?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah i will but it will add more tar files to the src, do you have a better way instead having them in the source code?
* @param tarBuffer - A Buffer containing the .tar archive. | ||
* @returns A promise that resolves to an object with `valid` (boolean) and `errors` (string[]). | ||
*/ | ||
export async function validateExportStream( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will you please make it so tarBuffer
can be a ReadableStream? That way, if the export is really big and the tar is really big, it doesn't have to be buffered in memory all at once.
I think you should be able have tar-stream parse the stream, async iterate through the tar entries, and ensure each entry is valid, all without every buffering all the entries in memory
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you r abs right, i should consider that, thanks
I think right now the |
@gobengo of course its not done and not in the build directory yet, also i should test it locally too |
…le validation logic
…tream; update dependencies
related PR did-coop/hollo#17 i have tested locally with hollo and everything working as expected |
No description provided.