Initial commit

This commit is contained in:
abrendan
2023-11-30 14:15:19 +00:00
commit e4599df811
5457 changed files with 500139 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
# Changelog
## 2.1.0 - 2019-06-13
### Added
- Added TypeScript type definitions. See [#6](https://github.com/helmetjs/content-security-policy-builder/issues/6)
- Created a changelog
### Changed
- Excluded useless files from npm package
This changelog was started after the release of version 2.1.0.

21
node_modules/content-security-policy-builder/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2015-2019 Evan Hahn
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

23
node_modules/content-security-policy-builder/README.md generated vendored Normal file
View File

@@ -0,0 +1,23 @@
Content Security Policy builder
===============================
[![Build Status](https://travis-ci.org/helmetjs/content-security-policy-builder.svg?branch=master)](https://travis-ci.org/helmetjs/content-security-policy-builder)
Take an object and turn it into a Content Security Policy string. Useful for building Content Security Policy libraries.
It can handle a lot of things you can you throw at it; `camelCased` or `dash-separated` directives, arrays or strings, et cetera.
Usage:
```javascript
const builder = require('content-security-policy-builder')
// default-src 'self' default.com; script-src scripts.com; whatever-src something; object-src
builder({
directives: {
defaultSrc: ["'self'", 'default.com'],
scriptSrc: 'scripts.com',
'whatever-src': 'something',
objectSrc: true
}
})
```

View File

@@ -0,0 +1,7 @@
interface PolicyBuilderOptions {
directives: {
[directive: string]: string[] | string | boolean;
};
}
declare const _default: ({ directives }: PolicyBuilderOptions) => string;
export = _default;

View File

@@ -0,0 +1,33 @@
"use strict";
function dashify(str) {
return str
.replace(/([a-z])([A-Z])/g, '$1-$2')
.toLowerCase();
}
module.exports = function (_a) {
var directives = _a.directives;
var keysSeen = {};
return Object.keys(directives).reduce(function (result, originalKey) {
var directive = dashify(originalKey);
if (keysSeen[directive]) {
throw new Error(originalKey + " is specified more than once");
}
keysSeen[directive] = true;
var value = directives[originalKey];
if (Array.isArray(value)) {
value = value.join(' ');
}
else if (value === true) {
value = '';
}
else if (value === false) {
return result;
}
if (value) {
return result.concat(directive + " " + value);
}
else {
return result.concat(directive);
}
}, []).join('; ');
};

View File

@@ -0,0 +1,83 @@
{
"_from": "content-security-policy-builder@2.1.0",
"_id": "content-security-policy-builder@2.1.0",
"_inBundle": false,
"_integrity": "sha512-/MtLWhJVvJNkA9dVLAp6fg9LxD2gfI6R2Fi1hPmfjYXSahJJzcfvoeDOxSyp4NvxMuwWv3WMssE9o31DoULHrQ==",
"_location": "/content-security-policy-builder",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "content-security-policy-builder@2.1.0",
"name": "content-security-policy-builder",
"escapedName": "content-security-policy-builder",
"rawSpec": "2.1.0",
"saveSpec": null,
"fetchSpec": "2.1.0"
},
"_requiredBy": [
"/helmet-csp"
],
"_resolved": "https://registry.npmjs.org/content-security-policy-builder/-/content-security-policy-builder-2.1.0.tgz",
"_shasum": "0a2364d769a3d7014eec79ff7699804deb8cfcbb",
"_spec": "content-security-policy-builder@2.1.0",
"_where": "/home/runner/Socketio-Chat-Template/node_modules/helmet-csp",
"author": {
"name": "Evan Hahn",
"email": "me@evanhahn.com",
"url": "https://evanhahn.com"
},
"bugs": {
"url": "https://github.com/helmetjs/content-security-policy-builder/issues",
"email": "me@evanhahn.com"
},
"bundleDependencies": false,
"deprecated": false,
"description": "Build Content Security Policy directives.",
"devDependencies": {
"@types/jest": "^24.0.14",
"@typescript-eslint/eslint-plugin": "^1.9.0",
"@typescript-eslint/parser": "^1.9.0",
"eslint": "^5.16.0",
"eslint-config-helmet": "^0.2.0",
"jest": "^24.8.0",
"ts-jest": "^24.0.2",
"typescript": "^3.5.2"
},
"engines": {
"node": ">=4.0.0"
},
"files": [
"LICENSE",
"README.md",
"CHANGELOG.md",
"dist/index.js",
"dist/index.d.ts"
],
"homepage": "https://github.com/helmetjs/content-security-policy-builder",
"keywords": [
"security",
"content",
"security",
"policy",
"csp",
"builder"
],
"license": "MIT",
"main": "./dist/index.js",
"name": "content-security-policy-builder",
"repository": {
"type": "git",
"url": "git://github.com/helmetjs/content-security-policy-builder.git"
},
"scripts": {
"build": "npm run clean && tsc",
"clean": "rm -rf dist",
"lint": "eslint --fix '**/*.ts'",
"prepublishOnly": "npm run build",
"pretest": "npm run lint",
"test": "jest --config test/jest-config.json"
},
"typings": "./dist/index.d.ts",
"version": "2.1.0"
}