Skip to content
This repository has been archived by the owner on Jul 3, 2019. It is now read-only.

feat(integrity): replace http client #72

Merged
merged 1 commit into from
Apr 5, 2017
Merged

feat(integrity): replace http client #72

merged 1 commit into from
Apr 5, 2017

Conversation

zkat
Copy link
Owner

@zkat zkat commented Apr 4, 2017

Fixes: #56
Fixes: #47
Fixes: #41
Fixes: #3

This PR changes pacote over from using npm-registry-client for
its http stuff with a whole layer slapped on top to using
make-fetch-happen. There's some features that are now missing,
but those can be filled in before release.

New features:

  • Faster, more robust http client.

  • Subresource Integrity support for tarball shasums. corgi.dist.integrity will be respected

  • npm-notice warnings

  • opts.refreshCache will force a conditional request to make sure the cache is up to date.

BREAKING CHANGE: This PR replaces a pretty fundamental chunk of pacote.

  • Caching now follows standard-ish cache rules for http-related requests.

  • manifest() no longer includes the _shasum field. It's been replaced by _integrity, which is a Subresource Integrity hash string containing equivalent data. These strings can be parsed and managed using https://npm.im/ssri.

  • Any functions that accepted opts.digest and/or opts.hashAlgorithm now expect opts.integrity instead.

  • Packuments and finalized manifests are now cached using sha512. Tarballs can start using that hash (or any other more secure hash) once registries start supporting them: packument.dist.integrity will be prioritized over packument.shasum.

  • If opts.offline is used, a ENOCACHE error will be returned.

Fixes: #75
Fixes: #56
Fixes: #47
Fixes: #41
Fixes: #3

This PR changes pacote over from using npm-registry-client for
its http stuff with a whole layer slapped on top to using
make-fetch-happen. There's some features that are now missing,
but those can be filled in before release.

New features:

* Faster, more robust http client.

* Subresource Integrity support for tarball shasums. `corgi.dist.integrity` will be respected

* `npm-notice` warnings

* `opts.refreshCache` will force a conditional request to make sure the cache is up to date.

BREAKING CHANGE: This PR replaces a pretty fundamental chunk of pacote.

* Caching now follows standard-ish cache rules for http-related requests.

* manifest() no longer includes the `_shasum` field. It's been replaced by `_integrity`, which is a Subresource Integrity hash string containing equivalent data. These strings can be parsed and managed using https://npm.im/ssri.

* Any functions that accepted `opts.digest` and/or `opts.hashAlgorithm` now expect `opts.integrity` instead.

* Packuments and finalized manifests are now cached using sha512. Tarballs can start using that hash (or any other more secure hash) once registries start supporting them: `packument.dist.integrity` will be prioritized over `packument.shasum`.

* If opts.offline is used, a `ENOCACHE` error will be returned.
@zkat zkat merged commit 189cdd2 into latest Apr 5, 2017
@zkat zkat deleted the zkat/new-fetcher branch April 5, 2017 08:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant