-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Fleet] Split unpacking an archive and caching its files into separat…
…e functions (#83085) ## Summary * Separate unpacking an archive from caching it or other side-effects * Parse and validate an archive before caching it * Validation has no coupling with caching side-effects or any other code outside the `validation.ts` file ```diff - const paths = await unpackArchiveToCache(archiveBuffer, contentType); - const archivePackageInfo = parseAndVerifyArchive(paths); + const entries = await unpackArchiveEntries(archiveBuffer, contentType); + const { archivePackageInfo } = await parseAndVerifyArchiveEntries(entries); + const paths = addEntriesToMemoryStore(entries); ``` ### Checklist - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
- Loading branch information
John Schulz
authored
Nov 10, 2020
1 parent
44d45ff
commit d66ca49
Showing
3 changed files
with
60 additions
and
27 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
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