• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

zkat / cacache / 417
89%

Build:
DEFAULT BRANCH: latest
Ran 03 Apr 2017 07:41AM UTC
Jobs 3
Files 17
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
417

push

travis-ci

web-flow
feat(integrity): subresource integrity support (#78)

BREAKING CHANGE: The entire API has been overhauled to use SRI hashes instead of digest/hashAlgorithm pairs. SRI hashes follow the Subresource Integrity standard and support strings and objects compatible with [`ssri`](https://npm.im/ssri).

* This change bumps the index version, which will invalidate all previous index entries. Content entries will remain intact, and existing caches will automatically reuse any content from before this breaking change.

* `cacache.get.info()`, `cacache.ls(), and `cacache.ls.stream()` will now return objects that looks like this:

```
{
  key: String,
  integrity: '<algorithm>-<base64hash>',
  path: ContentPath,
  time: Date<ms>,
  metadata: Any
}
```

* `opts.digest` and `opts.hashAlgorithm` are obsolete for any API calls that used them.

* Anywhere `opts.digest` was accepted, `opts.integrity` is now an option. Any valid SRI hash is accepted here -- multiple hash entries will be resolved according to the standard: first, the "strongest" hash algorithm will be picked, and then each of the entries for that algorithm will be matched against the content. Content will be validated if *any* of the entries match (so, a single integrity string can be used for multiple "versions" of the same document/data).

* `put.byDigest()`, `put.stream.byDigest`, `get.byDigest()` and `get.stream.byDigest() now expect an SRI instead of a `digest` + `opts.hashAlgorithm` pairing.

* `get.hasContent()` now expects an integrity hash instead of a digest. If content exists, it will return the specific single integrity hash that was found in the cache.

* `verify()` has learned to handle integrity-based caches, and forgotten how to handle old-style cache indices due to the format change.

* `cacache.rm.content()` now expects an integrity hash instead of a hex digest.

204 of 258 branches covered (79.07%)

94 of 94 new or added lines in 10 files covered. (100.0%)

542 of 578 relevant lines covered (93.77%)

38.78 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
1
100.0
get.js
2
100.0
lib/content/write.js
3
100.0
lib/content/read.js
Jobs
ID Job ID Ran Files Coverage
1 417.1 03 Apr 2017 07:42AM UTC 0
93.77
Travis Job 417.1
2 417.2 03 Apr 2017 07:41AM UTC 0
93.77
Travis Job 417.2
3 417.3 03 Apr 2017 07:41AM UTC 0
93.77
Travis Job 417.3
Source Files on build 417
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #417
  • b1e731f8 on github
  • Prev Build on latest (#410)
  • Next Build on latest (#418)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc