mirror of
https://github.com/abrendan/MicDropMessages.git
synced 2025-08-25 05:52:02 +02:00
Initial commit
This commit is contained in:
13
node_modules/frameguard/CHANGELOG.md
generated
vendored
Normal file
13
node_modules/frameguard/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
# Changelog
|
||||
|
||||
## Unreleased
|
||||
### Added
|
||||
- Added TypeScript type definitions. See [#1](https://github.com/helmetjs/frameguard/pull/16) and [helmetjs/helmet#188](https://github.com/helmetjs/helmet/issues/188)
|
||||
- Created a changelog
|
||||
|
||||
### Changed
|
||||
- Updated some package metadata
|
||||
- Update some documentation
|
||||
- Excluded some files from npm package
|
||||
|
||||
Changes in versions 3.0.0 and below can be found in [Helmet's changelog](https://github.com/helmetjs/helmet/blob/master/CHANGELOG.md).
|
21
node_modules/frameguard/LICENSE
generated
vendored
Normal file
21
node_modules/frameguard/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014-2019 Evan Hahn, Adam Baldwin
|
||||
|
||||
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.
|
26
node_modules/frameguard/README.md
generated
vendored
Normal file
26
node_modules/frameguard/README.md
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
Frameguard
|
||||
==========
|
||||
[](https://travis-ci.org/helmetjs/frameguard)
|
||||
|
||||
The `X-Frame-Options` HTTP header restricts who can put your site in a frame which can help mitigate things like [clickjacking attacks](https://en.wikipedia.org/wiki/Clickjacking). It has three modes: `DENY`, `SAMEORIGIN`, and `ALLOW-FROM`, defaulting to `SAMEORIGIN`. If your app does not need to be framed (and most don't) you can use `DENY`. If your site can be in frames from the same origin, you can set it to `SAMEORIGIN`. If you want to allow it from a specific URL, you can allow that with `ALLOW-FROM` and a URL.
|
||||
|
||||
Usage:
|
||||
|
||||
```javascript
|
||||
const frameguard = require('frameguard')
|
||||
|
||||
// Don't allow me to be in ANY frames:
|
||||
app.use(frameguard({ action: 'deny' }))
|
||||
|
||||
// Only let me be framed by people of the same origin:
|
||||
app.use(frameguard({ action: 'sameorigin' }))
|
||||
app.use(frameguard()) // defaults to sameorigin
|
||||
|
||||
// Allow from a specific host:
|
||||
app.use(frameguard({
|
||||
action: 'allow-from',
|
||||
domain: 'https://example.com'
|
||||
}))
|
||||
```
|
||||
|
||||
This has pretty good (but not 100%) browser support: IE8+, Opera 10.50+, Safari 4+, Chrome 4.1+, and Firefox 3.6.9+. The `ALLOW-FROM` header option is [not supported in Chrome or Safari](https://developer.mozilla.org/en-US/docs/Web/HTTP/X-Frame-Options#Browser_compatibility). Those browsers will ignore the entire header, [and the frame *will* be displayed](https://www.owasp.org/index.php/Clickjacking_Defense_Cheat_Sheet#Limitations_2), so you probably want to avoid using that option.
|
8
node_modules/frameguard/dist/index.d.ts
generated
vendored
Normal file
8
node_modules/frameguard/dist/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
/// <reference types="node" />
|
||||
import { IncomingMessage, ServerResponse } from 'http';
|
||||
interface FrameguardOptions {
|
||||
action?: string;
|
||||
domain?: string;
|
||||
}
|
||||
declare const _default: (options?: FrameguardOptions | undefined) => (_req: IncomingMessage, res: ServerResponse, next: () => void) => void;
|
||||
export = _default;
|
57
node_modules/frameguard/dist/index.js
generated
vendored
Normal file
57
node_modules/frameguard/dist/index.js
generated
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
"use strict";
|
||||
function parseActionOption(actionOption) {
|
||||
var invalidActionErr = new Error('action must be undefined, "DENY", "ALLOW-FROM", or "SAMEORIGIN".');
|
||||
if (actionOption === undefined) {
|
||||
actionOption = 'SAMEORIGIN';
|
||||
}
|
||||
else if (actionOption instanceof String) {
|
||||
actionOption = actionOption.valueOf();
|
||||
}
|
||||
var result;
|
||||
if (typeof actionOption === 'string') {
|
||||
result = actionOption.toUpperCase();
|
||||
}
|
||||
else {
|
||||
throw invalidActionErr;
|
||||
}
|
||||
if (result === 'ALLOWFROM') {
|
||||
result = 'ALLOW-FROM';
|
||||
}
|
||||
else if (result === 'SAME-ORIGIN') {
|
||||
result = 'SAMEORIGIN';
|
||||
}
|
||||
if (['DENY', 'ALLOW-FROM', 'SAMEORIGIN'].indexOf(result) === -1) {
|
||||
throw invalidActionErr;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
function parseDomainOption(domainOption) {
|
||||
if (domainOption instanceof String) {
|
||||
domainOption = domainOption.valueOf();
|
||||
}
|
||||
if (typeof domainOption !== 'string') {
|
||||
throw new Error('ALLOW-FROM action requires a string domain parameter.');
|
||||
}
|
||||
else if (!domainOption.length) {
|
||||
throw new Error('domain parameter must not be empty.');
|
||||
}
|
||||
return domainOption;
|
||||
}
|
||||
function getHeaderValueFromOptions(options) {
|
||||
options = options || {};
|
||||
var action = parseActionOption(options.action);
|
||||
if (action === 'ALLOW-FROM') {
|
||||
var domain = parseDomainOption(options.domain);
|
||||
return action + " " + domain;
|
||||
}
|
||||
else {
|
||||
return action;
|
||||
}
|
||||
}
|
||||
module.exports = function frameguard(options) {
|
||||
var headerValue = getHeaderValueFromOptions(options);
|
||||
return function frameguard(_req, res, next) {
|
||||
res.setHeader('X-Frame-Options', headerValue);
|
||||
next();
|
||||
};
|
||||
};
|
95
node_modules/frameguard/package.json
generated
vendored
Normal file
95
node_modules/frameguard/package.json
generated
vendored
Normal file
@@ -0,0 +1,95 @@
|
||||
{
|
||||
"_from": "frameguard@3.1.0",
|
||||
"_id": "frameguard@3.1.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-TxgSKM+7LTA6sidjOiSZK9wxY0ffMPY3Wta//MqwmX0nZuEHc8QrkV8Fh3ZhMJeiH+Uyh/tcaarImRy8u77O7g==",
|
||||
"_location": "/frameguard",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "frameguard@3.1.0",
|
||||
"name": "frameguard",
|
||||
"escapedName": "frameguard",
|
||||
"rawSpec": "3.1.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "3.1.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/helmet"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/frameguard/-/frameguard-3.1.0.tgz",
|
||||
"_shasum": "bd1442cca1d67dc346a6751559b6d04502103a22",
|
||||
"_spec": "frameguard@3.1.0",
|
||||
"_where": "/home/runner/Socketio-Chat-Template/node_modules/helmet",
|
||||
"author": {
|
||||
"name": "Adam Baldwin",
|
||||
"email": "adam@npmjs.com",
|
||||
"url": "https://evilpacket.net"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/helmetjs/frameguard/issues",
|
||||
"email": "me@evanhahn.com"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Evan Hahn",
|
||||
"email": "me@evanhahn.com",
|
||||
"url": "https://evanhahn.com"
|
||||
}
|
||||
],
|
||||
"deprecated": false,
|
||||
"description": "Middleware to set X-Frame-Options headers",
|
||||
"devDependencies": {
|
||||
"@types/connect": "^3.4.32",
|
||||
"@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",
|
||||
"eslint": "^5.16.0",
|
||||
"eslint-config-helmet": "^0.2.0",
|
||||
"jest": "^24.7.1",
|
||||
"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/frameguard/",
|
||||
"keywords": [
|
||||
"helmet",
|
||||
"security",
|
||||
"express",
|
||||
"connect",
|
||||
"x-frame-options",
|
||||
"clickjack",
|
||||
"frame"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "./dist/index.js",
|
||||
"name": "frameguard",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/helmetjs/frameguard.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": "3.1.0"
|
||||
}
|
Reference in New Issue
Block a user