mirror of
https://github.com/abrendan/MicDropMessages.git
synced 2025-08-25 05:52:02 +02:00
Initial commit
This commit is contained in:
12
node_modules/feature-policy/CHANGELOG.md
generated
vendored
Normal file
12
node_modules/feature-policy/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
# Changelog
|
||||
|
||||
## 0.3.0 - 2019-05-05
|
||||
### Added
|
||||
- 19 new features: `ambientLightSensor`, `documentDomain`, `documentWrite`, `encryptedMedia`, `fontDisplayLateSwap`, `layoutAnimations`, `legacyImageFormats`, `loadingFrameDefaultEager`, `oversizedImages`, `pictureInPicture`, `serial`, `syncScript`, `unoptimizedImages`, `unoptimizedLosslessImages`, `unoptimizedLossyImages`, `unsizedMedia`, `verticalScroll`, `wakeLock`, and `xr`
|
||||
- TypeScript definitions. See [#2](https://github.com/helmetjs/feature-policy/issues/2) and [helmet#188](https://github.com/helmetjs/helmet/issues/188)
|
||||
- Created a changelog
|
||||
|
||||
### Changed
|
||||
- Updated some package metadata
|
||||
|
||||
Changes in versions 0.2.0 and below can be found in [Helmet's changelog](https://github.com/helmetjs/helmet/blob/master/CHANGELOG.md).
|
21
node_modules/feature-policy/LICENSE
generated
vendored
Normal file
21
node_modules/feature-policy/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2018-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.
|
59
node_modules/feature-policy/README.md
generated
vendored
Normal file
59
node_modules/feature-policy/README.md
generated
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
Feature Policy
|
||||
==============
|
||||
[](https://travis-ci.org/helmetjs/feature-policy)
|
||||
|
||||
This is Express middleware to set the `Feature-Policy` header. You can read more about it [here](https://scotthelme.co.uk/a-new-security-header-feature-policy/) and [here](https://developers.google.com/web/updates/2018/06/feature-policy).
|
||||
|
||||
To use:
|
||||
|
||||
```javascript
|
||||
const featurePolicy = require('feature-policy')
|
||||
|
||||
// ...
|
||||
|
||||
app.use(featurePolicy({
|
||||
features: {
|
||||
fullscreen: ["'self'"],
|
||||
vibrate: ["'none'"],
|
||||
payment: ['example.com'],
|
||||
syncXhr: ["'none'"]
|
||||
}
|
||||
}))
|
||||
```
|
||||
|
||||
The following features are currently supported:
|
||||
|
||||
* `accelerometer`
|
||||
* `ambientLightSensor`
|
||||
* `autoplay`
|
||||
* `camera`
|
||||
* `documentDomain`
|
||||
* `documentWrite`
|
||||
* `encryptedMedia`
|
||||
* `fontDisplayLateSwap`
|
||||
* `fullscreen`
|
||||
* `geolocation`
|
||||
* `gyroscope`
|
||||
* `layoutAnimations`
|
||||
* `legacyImageFormats`
|
||||
* `loadingFrameDefaultEager`
|
||||
* `magnetometer`
|
||||
* `microphone`
|
||||
* `midi`
|
||||
* `oversizedImages`
|
||||
* `payment`
|
||||
* `pictureInPicture`
|
||||
* `serial`
|
||||
* `speaker`
|
||||
* `syncScript`
|
||||
* `syncXhr`
|
||||
* `unoptimizedImages`
|
||||
* `unoptimizedLosslessImages`
|
||||
* `unoptimizedLossyImages`
|
||||
* `unsizedMedia`
|
||||
* `usb`
|
||||
* `verticalScroll`
|
||||
* `vibrate`
|
||||
* `vr`
|
||||
* `wakeLock`
|
||||
* `xr`
|
9
node_modules/feature-policy/dist/index.d.ts
generated
vendored
Normal file
9
node_modules/feature-policy/dist/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
/// <reference types="node" />
|
||||
import { IncomingMessage, ServerResponse } from 'http';
|
||||
interface FeaturePolicyOptions {
|
||||
features: {
|
||||
[featureName: string]: string[];
|
||||
};
|
||||
}
|
||||
declare const _default: (options: FeaturePolicyOptions) => (_req: IncomingMessage, res: ServerResponse, next: () => void) => void;
|
||||
export = _default;
|
99
node_modules/feature-policy/dist/index.js
generated
vendored
Normal file
99
node_modules/feature-policy/dist/index.js
generated
vendored
Normal file
@@ -0,0 +1,99 @@
|
||||
"use strict";
|
||||
function isPlainObject(value) {
|
||||
return Boolean(value &&
|
||||
!Array.isArray(value) &&
|
||||
typeof value === 'object');
|
||||
}
|
||||
function getHeaderValueFromOptions(options) {
|
||||
var FEATURES = {
|
||||
accelerometer: 'accelerometer',
|
||||
ambientLightSensor: 'ambient-light-sensor',
|
||||
autoplay: 'autoplay',
|
||||
camera: 'camera',
|
||||
documentDomain: 'document-domain',
|
||||
documentWrite: 'document-write',
|
||||
encryptedMedia: 'encrypted-media',
|
||||
fontDisplayLateSwap: 'font-display-late-swap',
|
||||
fullscreen: 'fullscreen',
|
||||
geolocation: 'geolocation',
|
||||
gyroscope: 'gyroscope',
|
||||
layoutAnimations: 'layout-animations',
|
||||
legacyImageFormats: 'legacy-image-formats',
|
||||
loadingFrameDefaultEager: 'loading-frame-default-eager',
|
||||
magnetometer: 'magnetometer',
|
||||
microphone: 'microphone',
|
||||
midi: 'midi',
|
||||
notifications: 'notifications',
|
||||
oversizedImages: 'oversized-images',
|
||||
payment: 'payment',
|
||||
pictureInPicture: 'picture-in-picture',
|
||||
push: 'push',
|
||||
serial: 'serial',
|
||||
speaker: 'speaker',
|
||||
syncScript: 'sync-script',
|
||||
syncXhr: 'sync-xhr',
|
||||
unoptimizedImages: 'unoptimized-images',
|
||||
unoptimizedLosslessImages: 'unoptimized-lossless-images',
|
||||
unoptimizedLossyImages: 'unoptimized-lossy-images',
|
||||
unsizedMedia: 'unsized-media',
|
||||
usb: 'usb',
|
||||
verticalScroll: 'vertical-scroll',
|
||||
vibrate: 'vibrate',
|
||||
vr: 'vr',
|
||||
wakeLock: 'wake-lock',
|
||||
xr: 'xr',
|
||||
};
|
||||
if (!isPlainObject(options)) {
|
||||
throw new Error('featurePolicy must be called with an object argument. See the documentation.');
|
||||
}
|
||||
var features = options.features;
|
||||
if (!isPlainObject(features)) {
|
||||
throw new Error('featurePolicy must have a single key, "features", which is an object of features. See the documentation.');
|
||||
}
|
||||
var result = Object.keys(features).map(function (featureKeyCamelCase) {
|
||||
if (!Object.prototype.hasOwnProperty.call(FEATURES, featureKeyCamelCase)) {
|
||||
throw new Error("featurePolicy does not support the \"" + featureKeyCamelCase + "\" feature.");
|
||||
}
|
||||
var featureValue = features[featureKeyCamelCase];
|
||||
if (!Array.isArray(featureValue) || featureValue.length === 0) {
|
||||
throw new Error("The value of the \"" + featureKeyCamelCase + "\" feature must be a non-empty array.");
|
||||
}
|
||||
var containsStar = false;
|
||||
var containsNone = false;
|
||||
featureValue.forEach(function (allowed) {
|
||||
if (allowed === '*') {
|
||||
containsStar = true;
|
||||
}
|
||||
else if (allowed === "'none'") {
|
||||
containsNone = true;
|
||||
}
|
||||
else if (allowed === 'self') {
|
||||
throw new Error("'self' must be quoted.");
|
||||
}
|
||||
else if (allowed === 'none') {
|
||||
throw new Error("'none' must be quoted.");
|
||||
}
|
||||
});
|
||||
if (featureValue.length > 1) {
|
||||
if (containsStar) {
|
||||
throw new Error("The value of the \"" + featureKeyCamelCase + "\" feature cannot contain * and other values.");
|
||||
}
|
||||
else if (containsNone) {
|
||||
throw new Error("The value of the \"" + featureKeyCamelCase + "\" feature cannot contain 'none' and other values.");
|
||||
}
|
||||
}
|
||||
var featureKeyDashed = FEATURES[featureKeyCamelCase];
|
||||
return [featureKeyDashed].concat(featureValue).join(' ');
|
||||
}).join(';');
|
||||
if (result.length === 0) {
|
||||
throw new Error('At least one feature is required.');
|
||||
}
|
||||
return result;
|
||||
}
|
||||
module.exports = function featurePolicy(options) {
|
||||
var headerValue = getHeaderValueFromOptions(options);
|
||||
return function featurePolicy(_req, res, next) {
|
||||
res.setHeader('Feature-Policy', headerValue);
|
||||
next();
|
||||
};
|
||||
};
|
89
node_modules/feature-policy/package.json
generated
vendored
Normal file
89
node_modules/feature-policy/package.json
generated
vendored
Normal file
@@ -0,0 +1,89 @@
|
||||
{
|
||||
"_from": "feature-policy@0.3.0",
|
||||
"_id": "feature-policy@0.3.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-ZtijOTFN7TzCujt1fnNhfWPFPSHeZkesff9AXZj+UEjYBynWNUIYpC87Ve4wHzyexQsImicLu7WsC2LHq7/xrQ==",
|
||||
"_location": "/feature-policy",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "feature-policy@0.3.0",
|
||||
"name": "feature-policy",
|
||||
"escapedName": "feature-policy",
|
||||
"rawSpec": "0.3.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "0.3.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/helmet"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/feature-policy/-/feature-policy-0.3.0.tgz",
|
||||
"_shasum": "7430e8e54a40da01156ca30aaec1a381ce536069",
|
||||
"_spec": "feature-policy@0.3.0",
|
||||
"_where": "/home/runner/Socketio-Chat-Template/node_modules/helmet",
|
||||
"author": {
|
||||
"name": "Evan Hahn",
|
||||
"email": "me@evanhahn.com",
|
||||
"url": "https://evanhahn.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/helmetjs/feature-policy/issues",
|
||||
"email": "me@evanhahn.com"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {},
|
||||
"deprecated": false,
|
||||
"description": "Middleware to set the Feature-Policy HTTP header",
|
||||
"devDependencies": {
|
||||
"@types/connect": "^3.4.32",
|
||||
"@types/dashify": "^1.0.0",
|
||||
"@types/jest": "^24.0.12",
|
||||
"@types/supertest": "^2.0.7",
|
||||
"@typescript-eslint/eslint-plugin": "^1.7.0",
|
||||
"@typescript-eslint/parser": "^1.7.0",
|
||||
"connect": "^3.6.6",
|
||||
"dashify": "^2.0.0",
|
||||
"eslint": "^5.16.0",
|
||||
"eslint-config-helmet": "^0.2.0",
|
||||
"jest": "^24.8.0",
|
||||
"supertest": "^4.0.2",
|
||||
"ts-jest": "^24.0.2",
|
||||
"typescript": "^3.4.5"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4.0.0"
|
||||
},
|
||||
"files": [
|
||||
"CHANGELOG.md",
|
||||
"LICENSE",
|
||||
"README.md",
|
||||
"dist/index.js",
|
||||
"dist/index.d.ts"
|
||||
],
|
||||
"homepage": "https://helmetjs.github.io/docs/feature-policy/",
|
||||
"keywords": [
|
||||
"helmet",
|
||||
"security",
|
||||
"express",
|
||||
"connect",
|
||||
"feature-policy"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "./dist/index.js",
|
||||
"name": "feature-policy",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/helmetjs/feature-policy.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": "0.3.0"
|
||||
}
|
Reference in New Issue
Block a user