node_modules ignore

This commit is contained in:
2025-05-08 23:43:47 +02:00
parent e19d52f172
commit 4574544c9f
65041 changed files with 10593536 additions and 0 deletions

20
server/node_modules/request-ip/LICENSE.md generated vendored Normal file
View File

@@ -0,0 +1,20 @@
The MIT License (MIT)
Copyright (c) 2022 Petar Bojinov - petarbojinov+github@gmail.com
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.

118
server/node_modules/request-ip/README.md generated vendored Normal file
View File

@@ -0,0 +1,118 @@
# request-ip
A tiny Node.js module for retrieving a request's IP address.
![](https://nodei.co/npm/request-ip.png?downloads=true&cacheBust=3)
![](https://travis-ci.org/pbojinov/request-ip.svg?branch=master)
[![Coverage Status](https://coveralls.io/repos/pbojinov/request-ip/badge.svg)](https://coveralls.io/r/pbojinov/request-ip)
![](https://img.shields.io/npm/l/express.svg)
[![npm version](https://badge.fury.io/js/request-ip.svg)](https://badge.fury.io/js/request-ip)
## Installation
Yarn
```
yarn add request-ip
```
npm
```bash
npm install request-ip --save
```
## Getting Started
```javascript
const requestIp = require('request-ip');
// inside middleware handler
const ipMiddleware = function(req, res, next) {
const clientIp = requestIp.getClientIp(req);
next();
};
// on localhost you'll see 127.0.0.1 if you're using IPv4
// or ::1, ::ffff:127.0.0.1 if you're using IPv6
```
### As Connect Middleware
```javascript
const requestIp = require('request-ip');
app.use(requestIp.mw())
app.use(function(req, res) {
const ip = req.clientIp;
res.end(ip);
});
```
To see a full working code for the middleware, check out the [examples](https://github.com/pbojinov/request-ip/tree/master/examples) folder.
The connect-middleware also supports retrieving the ip address under a custom attribute name, which also works as a container for any future settings.
## How It Works
It looks for specific headers in the request and falls back to some defaults if they do not exist.
The user ip is determined by the following order:
1. `X-Client-IP`
2. `X-Forwarded-For` (Header may return multiple IP addresses in the format: "client IP, proxy 1 IP, proxy 2 IP", so we take the first one.)
3. `CF-Connecting-IP` (Cloudflare)
4. `Fastly-Client-Ip` (Fastly CDN and Firebase hosting header when forwared to a cloud function)
5. `True-Client-Ip` (Akamai and Cloudflare)
6. `X-Real-IP` (Nginx proxy/FastCGI)
7. `X-Cluster-Client-IP` (Rackspace LB, Riverbed Stingray)
8. `X-Forwarded`, `Forwarded-For` and `Forwarded` (Variations of #2)
9. `appengine-user-ip` (Google App Engine)
10. `req.connection.remoteAddress`
11. `req.socket.remoteAddress`
12. `req.connection.socket.remoteAddress`
13. `req.info.remoteAddress`
14. `Cf-Pseudo-IPv4` (Cloudflare fallback)
15. `request.raw` (Fastify)
If an IP address cannot be found, it will return `null`.
## Samples Use Cases
* Getting a user's IP for geolocation.
## Running the Tests
Make sure you have the necessary dev dependencies needed to run the tests:
```
npm install
```
Run the integration tests
```
npm test
```
## Building
Compiles the current ES6 code to ES5 using Babel.
```
npm build
```
## Release Notes
See the wonderful [changelog](https://github.com/pbojinov/request-ip/blob/master/CHANGELOG.md)
To generate a new changelog, install [github-changelog-generator](https://github.com/skywinder/github-changelog-generator) then run `npm run changelog`. This will require being on Ruby >= 3
## Contributors
Thank you to all the [contributors](https://github.com/pbojinov/request-ip/graphs/contributors)!
## License
The MIT License (MIT) - 2022

147
server/node_modules/request-ip/lib/index.js generated vendored Normal file
View File

@@ -0,0 +1,147 @@
"use strict";
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
var is = require('./is');
function getClientIpFromXForwardedFor(value) {
if (!is.existy(value)) {
return null;
}
if (is.not.string(value)) {
throw new TypeError("Expected a string, got \"".concat(_typeof(value), "\""));
}
var forwardedIps = value.split(',').map(function (e) {
var ip = e.trim();
if (ip.includes(':')) {
var splitted = ip.split(':');
if (splitted.length === 2) {
return splitted[0];
}
}
return ip;
});
for (var i = 0; i < forwardedIps.length; i++) {
if (is.ip(forwardedIps[i])) {
return forwardedIps[i];
}
}
return null;
}
function getClientIp(req) {
if (req.headers) {
if (is.ip(req.headers['x-client-ip'])) {
return req.headers['x-client-ip'];
}
var xForwardedFor = getClientIpFromXForwardedFor(req.headers['x-forwarded-for']);
if (is.ip(xForwardedFor)) {
return xForwardedFor;
}
if (is.ip(req.headers['cf-connecting-ip'])) {
return req.headers['cf-connecting-ip'];
}
if (is.ip(req.headers['fastly-client-ip'])) {
return req.headers['fastly-client-ip'];
}
if (is.ip(req.headers['true-client-ip'])) {
return req.headers['true-client-ip'];
}
if (is.ip(req.headers['x-real-ip'])) {
return req.headers['x-real-ip'];
}
if (is.ip(req.headers['x-cluster-client-ip'])) {
return req.headers['x-cluster-client-ip'];
}
if (is.ip(req.headers['x-forwarded'])) {
return req.headers['x-forwarded'];
}
if (is.ip(req.headers['forwarded-for'])) {
return req.headers['forwarded-for'];
}
if (is.ip(req.headers.forwarded)) {
return req.headers.forwarded;
}
if (is.ip(req.headers['x-appengine-user-ip'])) {
return req.headers['x-appengine-user-ip'];
}
}
if (is.existy(req.connection)) {
if (is.ip(req.connection.remoteAddress)) {
return req.connection.remoteAddress;
}
if (is.existy(req.connection.socket) && is.ip(req.connection.socket.remoteAddress)) {
return req.connection.socket.remoteAddress;
}
}
if (is.existy(req.socket) && is.ip(req.socket.remoteAddress)) {
return req.socket.remoteAddress;
}
if (is.existy(req.info) && is.ip(req.info.remoteAddress)) {
return req.info.remoteAddress;
}
if (is.existy(req.requestContext) && is.existy(req.requestContext.identity) && is.ip(req.requestContext.identity.sourceIp)) {
return req.requestContext.identity.sourceIp;
}
if (req.headers) {
if (is.ip(req.headers['Cf-Pseudo-IPv4'])) {
return req.headers['Cf-Pseudo-IPv4'];
}
}
if (is.existy(req.raw)) {
return getClientIp(req.raw);
}
return null;
}
function mw(options) {
var configuration = is.not.existy(options) ? {} : options;
if (is.not.object(configuration)) {
throw new TypeError('Options must be an object!');
}
var attributeName = configuration.attributeName || 'clientIp';
return function (req, res, next) {
var ip = getClientIp(req);
Object.defineProperty(req, attributeName, {
get: function get() {
return ip;
},
configurable: true
});
next();
};
}
module.exports = {
getClientIpFromXForwardedFor: getClientIpFromXForwardedFor,
getClientIp: getClientIp,
mw: mw
};

42
server/node_modules/request-ip/lib/is.js generated vendored Normal file
View File

@@ -0,0 +1,42 @@
"use strict";
var regexes = {
ipv4: /^(?:(?:\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])\.){3}(?:\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])$/,
ipv6: /^((?=.*::)(?!.*::.+::)(::)?([\dA-F]{1,4}:(:|\b)|){5}|([\dA-F]{1,4}:){6})((([\dA-F]{1,4}((?!\3)::|:\b|$))|(?!\2\3)){2}|(((2[0-4]|1\d|[1-9])?\d|25[0-5])\.?\b){4})$/i
};
function not(func) {
return function () {
return !func.apply(null, Array.prototype.slice.call(arguments));
};
}
function existy(value) {
return value != null;
}
function ip(value) {
return existy(value) && regexes.ipv4.test(value) || regexes.ipv6.test(value);
}
function object(value) {
return Object(value) === value;
}
function string(value) {
return Object.prototype.toString.call(value) === '[object String]';
}
var is = {
existy: existy,
ip: ip,
object: object,
string: string,
not: {
existy: not(existy),
ip: not(ip),
object: not(object),
string: not(string)
}
};
module.exports = is;

73
server/node_modules/request-ip/package.json generated vendored Normal file
View File

@@ -0,0 +1,73 @@
{
"name": "request-ip",
"version": "3.3.0",
"description": "A small Node.js module to retrieve the request's IP address",
"keywords": [
"request ip",
"ip",
"address",
"request",
"proxy",
"client",
"header",
"X-Client-IP",
"X-Forwarded-For",
"CF-Connecting-IP",
"Fastly-Client-IP",
"True-Client-IP",
"X-Real-IP",
"X-Cluster-Client-IP",
"X-Forwarded",
"Forwarded-For",
"connection.remoteAddress",
"connection.socket.remoteAddress",
"req.info.remoteAddress",
"middleware",
"ipv4",
"ipv6",
"fastify",
"x-appengine-user-ip",
"cloudflare",
"Cf-Pseudo-IPv4"
],
"homepage": "https://github.com/pbojinov/request-ip",
"bugs": {
"url": "https://github.com/pbojinov/request-ip/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/pbojinov/request-ip.git"
},
"license": "MIT",
"author": "Petar Bojinov <petarbojinov+github@gmail.com>",
"contributors": [
{
"name": "Jon Peck",
"email": "jpeck@fluxsauce.com"
}
],
"files": [
"lib"
],
"main": "./lib/index.js",
"scripts": {
"build": "babel src --out-dir lib",
"changelog": "github_changelog_generator -u pbojinov -p request-ip",
"coverage": "nyc report --reporter=text-lcov | coveralls",
"test": "nyc --reporter=html --reporter=text --check-coverage --lines=100 --statements=100 tape ./test/*.js"
},
"prettier": "@shopify/prettier-config",
"devDependencies": {
"@babel/cli": "^7.0.0",
"@babel/core": "^7.0.0",
"@babel/preset-env": "^7.0.0",
"@shopify/eslint-plugin": "^41.3.0",
"@shopify/prettier-config": "^1.1.2",
"coveralls": "^3.0.2",
"eslint": "^8.16.0",
"nyc": "^13.1.0",
"request": "^2.54.0",
"tap-spec": "^5.0.0",
"tape": "^4.9.1"
}
}