nav tabs on admin dashboard
This commit is contained in:
+30
@@ -2,6 +2,36 @@
|
||||
|
||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||
|
||||
<a name="6.0.1"></a>
|
||||
## [6.0.1](https://github.com/zkat/ssri/compare/v6.0.0...v6.0.1) (2018-08-27)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **opts:** use figgy-pudding to specify consumed opts ([cf86553](https://github.com/zkat/ssri/commit/cf86553))
|
||||
|
||||
|
||||
|
||||
<a name="6.0.0"></a>
|
||||
# [6.0.0](https://github.com/zkat/ssri/compare/v5.3.0...v6.0.0) (2018-04-09)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **docs:** minor typo ([b71ef17](https://github.com/zkat/ssri/commit/b71ef17))
|
||||
|
||||
|
||||
### meta
|
||||
|
||||
* drop support for node@4 ([d9bf359](https://github.com/zkat/ssri/commit/d9bf359))
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* node@4 is no longer supported
|
||||
|
||||
|
||||
|
||||
<a name="5.3.0"></a>
|
||||
# [5.3.0](https://github.com/zkat/ssri/compare/v5.2.4...v5.3.0) (2018-03-13)
|
||||
|
||||
|
||||
+1
-1
@@ -189,7 +189,7 @@ desktopIntegrity.concat(mobileIntegrity)
|
||||
Returns the string representation of an `Integrity` object. All hash entries
|
||||
will be concatenated in the string by `opts.sep`, which defaults to `' '`.
|
||||
|
||||
If you want to serialize an object that didn't from from an `ssri` function,
|
||||
If you want to serialize an object that didn't come from an `ssri` function,
|
||||
use [`ssri.stringify()`](#stringify).
|
||||
|
||||
If `opts.strict` is true, the integrity string will be created using strict
|
||||
|
||||
+38
-22
@@ -1,8 +1,7 @@
|
||||
'use strict'
|
||||
|
||||
const Buffer = require('safe-buffer').Buffer
|
||||
|
||||
const crypto = require('crypto')
|
||||
const figgyPudding = require('figgy-pudding')
|
||||
const Transform = require('stream').Transform
|
||||
|
||||
const SPEC_ALGORITHMS = ['sha256', 'sha384', 'sha512']
|
||||
@@ -12,10 +11,24 @@ const SRI_REGEX = /^([^-]+)-([^?]+)([?\S*]*)$/
|
||||
const STRICT_SRI_REGEX = /^([^-]+)-([A-Za-z0-9+/=]{44,88})(\?[\x21-\x7E]*)*$/
|
||||
const VCHAR_REGEX = /^[\x21-\x7E]+$/
|
||||
|
||||
const SsriOpts = figgyPudding({
|
||||
algorithms: {default: ['sha512']},
|
||||
error: {default: false},
|
||||
integrity: {},
|
||||
options: {default: []},
|
||||
pickAlgorithm: {default: () => getPrioritizedHash},
|
||||
Promise: {default: () => Promise},
|
||||
sep: {default: ' '},
|
||||
single: {default: false},
|
||||
size: {},
|
||||
strict: {default: false}
|
||||
})
|
||||
|
||||
class Hash {
|
||||
get isHash () { return true }
|
||||
constructor (hash, opts) {
|
||||
const strict = !!(opts && opts.strict)
|
||||
opts = SsriOpts(opts)
|
||||
const strict = !!opts.strict
|
||||
this.source = hash.trim()
|
||||
// 3.1. Integrity metadata (called "Hash" by ssri)
|
||||
// https://w3c.github.io/webappsec-subresource-integrity/#integrity-metadata-description
|
||||
@@ -39,7 +52,8 @@ class Hash {
|
||||
return this.toString()
|
||||
}
|
||||
toString (opts) {
|
||||
if (opts && opts.strict) {
|
||||
opts = SsriOpts(opts)
|
||||
if (opts.strict) {
|
||||
// Strict mode enforces the standard as close to the foot of the
|
||||
// letter as it can.
|
||||
if (!(
|
||||
@@ -72,7 +86,7 @@ class Integrity {
|
||||
return this.toString()
|
||||
}
|
||||
toString (opts) {
|
||||
opts = opts || {}
|
||||
opts = SsriOpts(opts)
|
||||
let sep = opts.sep || ' '
|
||||
if (opts.strict) {
|
||||
// Entries must be separated by whitespace, according to spec.
|
||||
@@ -85,6 +99,7 @@ class Integrity {
|
||||
}).filter(x => x.length).join(sep)
|
||||
}
|
||||
concat (integrity, opts) {
|
||||
opts = SsriOpts(opts)
|
||||
const other = typeof integrity === 'string'
|
||||
? integrity
|
||||
: stringify(integrity, opts)
|
||||
@@ -94,6 +109,7 @@ class Integrity {
|
||||
return parse(this, {single: true}).hexDigest()
|
||||
}
|
||||
match (integrity, opts) {
|
||||
opts = SsriOpts(opts)
|
||||
const other = parse(integrity, opts)
|
||||
const algo = other.pickAlgorithm(opts)
|
||||
return (
|
||||
@@ -107,7 +123,8 @@ class Integrity {
|
||||
) || false
|
||||
}
|
||||
pickAlgorithm (opts) {
|
||||
const pickAlgorithm = (opts && opts.pickAlgorithm) || getPrioritizedHash
|
||||
opts = SsriOpts(opts)
|
||||
const pickAlgorithm = opts.pickAlgorithm
|
||||
const keys = Object.keys(this)
|
||||
if (!keys.length) {
|
||||
throw new Error(`No algorithms available for ${
|
||||
@@ -122,7 +139,7 @@ class Integrity {
|
||||
|
||||
module.exports.parse = parse
|
||||
function parse (sri, opts) {
|
||||
opts = opts || {}
|
||||
opts = SsriOpts(opts)
|
||||
if (typeof sri === 'string') {
|
||||
return _parse(sri, opts)
|
||||
} else if (sri.algorithm && sri.digest) {
|
||||
@@ -153,6 +170,7 @@ function _parse (integrity, opts) {
|
||||
|
||||
module.exports.stringify = stringify
|
||||
function stringify (obj, opts) {
|
||||
opts = SsriOpts(opts)
|
||||
if (obj.algorithm && obj.digest) {
|
||||
return Hash.prototype.toString.call(obj, opts)
|
||||
} else if (typeof obj === 'string') {
|
||||
@@ -164,7 +182,8 @@ function stringify (obj, opts) {
|
||||
|
||||
module.exports.fromHex = fromHex
|
||||
function fromHex (hexDigest, algorithm, opts) {
|
||||
const optString = (opts && opts.options && opts.options.length)
|
||||
opts = SsriOpts(opts)
|
||||
const optString = opts.options && opts.options.length
|
||||
? `?${opts.options.join('?')}`
|
||||
: ''
|
||||
return parse(
|
||||
@@ -176,8 +195,8 @@ function fromHex (hexDigest, algorithm, opts) {
|
||||
|
||||
module.exports.fromData = fromData
|
||||
function fromData (data, opts) {
|
||||
opts = opts || {}
|
||||
const algorithms = opts.algorithms || ['sha512']
|
||||
opts = SsriOpts(opts)
|
||||
const algorithms = opts.algorithms
|
||||
const optString = opts.options && opts.options.length
|
||||
? `?${opts.options.join('?')}`
|
||||
: ''
|
||||
@@ -198,7 +217,7 @@ function fromData (data, opts) {
|
||||
|
||||
module.exports.fromStream = fromStream
|
||||
function fromStream (stream, opts) {
|
||||
opts = opts || {}
|
||||
opts = SsriOpts(opts)
|
||||
const P = opts.Promise || Promise
|
||||
const istream = integrityStream(opts)
|
||||
return new P((resolve, reject) => {
|
||||
@@ -214,7 +233,7 @@ function fromStream (stream, opts) {
|
||||
|
||||
module.exports.checkData = checkData
|
||||
function checkData (data, sri, opts) {
|
||||
opts = opts || {}
|
||||
opts = SsriOpts(opts)
|
||||
sri = parse(sri, opts)
|
||||
if (!Object.keys(sri).length) {
|
||||
if (opts.error) {
|
||||
@@ -253,9 +272,9 @@ function checkData (data, sri, opts) {
|
||||
|
||||
module.exports.checkStream = checkStream
|
||||
function checkStream (stream, sri, opts) {
|
||||
opts = opts || {}
|
||||
opts = SsriOpts(opts)
|
||||
const P = opts.Promise || Promise
|
||||
const checker = integrityStream(Object.assign({}, opts, {
|
||||
const checker = integrityStream(opts.concat({
|
||||
integrity: sri
|
||||
}))
|
||||
return new P((resolve, reject) => {
|
||||
@@ -271,7 +290,7 @@ function checkStream (stream, sri, opts) {
|
||||
|
||||
module.exports.integrityStream = integrityStream
|
||||
function integrityStream (opts) {
|
||||
opts = opts || {}
|
||||
opts = SsriOpts(opts)
|
||||
// For verification
|
||||
const sri = opts.integrity && parse(opts.integrity, opts)
|
||||
const goodSri = sri && Object.keys(sri).length
|
||||
@@ -279,10 +298,7 @@ function integrityStream (opts) {
|
||||
const digests = goodSri && sri[algorithm]
|
||||
// Calculating stream
|
||||
const algorithms = Array.from(
|
||||
new Set(
|
||||
(opts.algorithms || ['sha512'])
|
||||
.concat(algorithm ? [algorithm] : [])
|
||||
)
|
||||
new Set(opts.algorithms.concat(algorithm ? [algorithm] : []))
|
||||
)
|
||||
const hashes = algorithms.map(crypto.createHash)
|
||||
let streamSize = 0
|
||||
@@ -327,9 +343,9 @@ function integrityStream (opts) {
|
||||
|
||||
module.exports.create = createIntegrity
|
||||
function createIntegrity (opts) {
|
||||
opts = opts || {}
|
||||
const algorithms = opts.algorithms || ['sha512']
|
||||
const optString = opts.options && opts.options.length
|
||||
opts = SsriOpts(opts)
|
||||
const algorithms = opts.algorithms
|
||||
const optString = opts.options.length
|
||||
? `?${opts.options.join('?')}`
|
||||
: ''
|
||||
|
||||
|
||||
+11
-11
@@ -1,26 +1,26 @@
|
||||
{
|
||||
"_from": "ssri@^5.2.4",
|
||||
"_id": "ssri@5.3.0",
|
||||
"_from": "ssri@^6.0.1",
|
||||
"_id": "ssri@6.0.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-XRSIPqLij52MtgoQavH/x/dU1qVKtWUAAZeOHsR9c2Ddi4XerFy3mc1alf+dLJKl9EUIm/Ht+EowFkTUOA6GAQ==",
|
||||
"_integrity": "sha512-3Wge10hNcT1Kur4PDFwEieXSCMCJs/7WvSACcrMYrNp+b8kDL1/0wJch5Ni2WrtwEa2IO8OsVfeKIciKCDx/QA==",
|
||||
"_location": "/ssri",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "ssri@^5.2.4",
|
||||
"raw": "ssri@^6.0.1",
|
||||
"name": "ssri",
|
||||
"escapedName": "ssri",
|
||||
"rawSpec": "^5.2.4",
|
||||
"rawSpec": "^6.0.1",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^5.2.4"
|
||||
"fetchSpec": "^6.0.1"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/cacache"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/ssri/-/ssri-5.3.0.tgz",
|
||||
"_shasum": "ba3872c9c6d33a0704a7d71ff045e5ec48999d06",
|
||||
"_spec": "ssri@^5.2.4",
|
||||
"_resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.1.tgz",
|
||||
"_shasum": "2a3c41b28dd45b62b63676ecb74001265ae9edd8",
|
||||
"_spec": "ssri@^6.0.1",
|
||||
"_where": "C:\\xampp\\htdocs\\w4rpservices\\node_modules\\cacache",
|
||||
"author": {
|
||||
"name": "Kat Marchán",
|
||||
@@ -39,7 +39,7 @@
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"safe-buffer": "^5.1.1"
|
||||
"figgy-pudding": "^3.5.1"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Standard Subresource Integrity library -- parses, serializes, generates, and verifies integrity metadata according to the SRI spec.",
|
||||
@@ -85,5 +85,5 @@
|
||||
"update-coc": "weallbehave -o . && git add CODE_OF_CONDUCT.md && git commit -m 'docs(coc): updated CODE_OF_CONDUCT.md'",
|
||||
"update-contrib": "weallcontribute -o . && git add CONTRIBUTING.md && git commit -m 'docs(contributing): updated CONTRIBUTING.md'"
|
||||
},
|
||||
"version": "5.3.0"
|
||||
"version": "6.0.1"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user