mirror of
https://github.com/S2-/minifyfromhtml.git
synced 2025-08-05 13:00:08 +02:00
update node modules
This commit is contained in:
3
node_modules/aws4/.github/FUNDING.yml
generated
vendored
Normal file
3
node_modules/aws4/.github/FUNDING.yml
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: mhart
|
23
node_modules/aws4/README.md
generated
vendored
23
node_modules/aws4/README.md
generated
vendored
@@ -20,11 +20,11 @@ Example
|
||||
-------
|
||||
|
||||
```javascript
|
||||
var http = require('https')
|
||||
var https = require('https')
|
||||
var aws4 = require('aws4')
|
||||
|
||||
// to illustrate usage, we'll create a utility function to request and pipe to stdout
|
||||
function request(opts) { http.request(opts, function(res) { res.pipe(process.stdout) }).end(opts.body || '') }
|
||||
function request(opts) { https.request(opts, function(res) { res.pipe(process.stdout) }).end(opts.body || '') }
|
||||
|
||||
// aws4 will sign an options object as you'd pass to http.request, with an AWS service and region
|
||||
var opts = { host: 'my-bucket.s3.us-west-1.amazonaws.com', path: '/my-object', service: 's3', region: 'us-west-1' }
|
||||
@@ -94,6 +94,15 @@ request(aws4.sign({
|
||||
...
|
||||
*/
|
||||
|
||||
// The raw RequestSigner can be used to generate CodeCommit Git passwords
|
||||
var signer = new aws4.RequestSigner({
|
||||
service: 'codecommit',
|
||||
host: 'git-codecommit.us-east-1.amazonaws.com',
|
||||
method: 'GIT',
|
||||
path: '/v1/repos/MyAwesomeRepo',
|
||||
})
|
||||
var password = signer.getDateTime() + 'Z' + signer.signature()
|
||||
|
||||
// see example.js for examples with other services
|
||||
```
|
||||
|
||||
@@ -102,11 +111,10 @@ API
|
||||
|
||||
### aws4.sign(requestOptions, [credentials])
|
||||
|
||||
This calculates and populates the `Authorization` header of
|
||||
`requestOptions`, and any other necessary AWS headers and/or request
|
||||
options. Returns `requestOptions` as a convenience for chaining.
|
||||
Calculates and populates any necessary AWS headers and/or request
|
||||
options on `requestOptions`. Returns `requestOptions` as a convenience for chaining.
|
||||
|
||||
`requestOptions` is an object holding the same options that the node.js
|
||||
`requestOptions` is an object holding the same options that the Node.js
|
||||
[http.request](https://nodejs.org/docs/latest/api/http.html#http_http_request_options_callback)
|
||||
function takes.
|
||||
|
||||
@@ -119,6 +127,7 @@ populated if they don't already exist:
|
||||
- `body` (will use `''` if not given)
|
||||
- `service` (will try to be calculated from `hostname` or `host` if not given)
|
||||
- `region` (will try to be calculated from `hostname` or `host` or use `'us-east-1'` if not given)
|
||||
- `signQuery` (to sign the query instead of adding an `Authorization` header, defaults to false)
|
||||
- `headers['Host']` (will use `hostname` or `host` or be calculated if not given)
|
||||
- `headers['Content-Type']` (will use `'application/x-www-form-urlencoded; charset=utf-8'`
|
||||
if not given and there is a `body`)
|
||||
@@ -170,5 +179,5 @@ Thanks to [@jed](https://github.com/jed) for his
|
||||
committed and subsequently extracted this code.
|
||||
|
||||
Also thanks to the
|
||||
[official node.js AWS SDK](https://github.com/aws/aws-sdk-js) for giving
|
||||
[official Node.js AWS SDK](https://github.com/aws/aws-sdk-js) for giving
|
||||
me a start on implementing the v4 signature.
|
||||
|
18
node_modules/aws4/aws4.js
generated
vendored
18
node_modules/aws4/aws4.js
generated
vendored
@@ -26,6 +26,20 @@ function encodeRfc3986Full(str) {
|
||||
return encodeRfc3986(encodeURIComponent(str))
|
||||
}
|
||||
|
||||
// A bit of a combination of:
|
||||
// https://github.com/aws/aws-sdk-java-v2/blob/dc695de6ab49ad03934e1b02e7263abbd2354be0/core/auth/src/main/java/software/amazon/awssdk/auth/signer/internal/AbstractAws4Signer.java#L59
|
||||
// https://github.com/aws/aws-sdk-js/blob/18cb7e5b463b46239f9fdd4a65e2ff8c81831e8f/lib/signers/v4.js#L191-L199
|
||||
// https://github.com/mhart/aws4fetch/blob/b3aed16b6f17384cf36ea33bcba3c1e9f3bdfefd/src/main.js#L25-L34
|
||||
var HEADERS_TO_IGNORE = {
|
||||
'authorization': true,
|
||||
'connection': true,
|
||||
'x-amzn-trace-id': true,
|
||||
'user-agent': true,
|
||||
'expect': true,
|
||||
'presigned-expires': true,
|
||||
'range': true,
|
||||
}
|
||||
|
||||
// request: { path | body, [host], [method], [headers], [service], [region] }
|
||||
// credentials: { accessKeyId, secretAccessKey, [sessionToken] }
|
||||
function RequestSigner(request, credentials) {
|
||||
@@ -259,7 +273,7 @@ RequestSigner.prototype.canonicalString = function() {
|
||||
if (normalizePath && piece === '..') {
|
||||
path.pop()
|
||||
} else if (!normalizePath || piece !== '.') {
|
||||
if (decodePath) piece = decodeURIComponent(piece).replace(/\+/g, ' ')
|
||||
if (decodePath) piece = decodeURIComponent(piece.replace(/\+/g, ' '))
|
||||
path.push(encodeRfc3986Full(piece))
|
||||
}
|
||||
return path
|
||||
@@ -284,6 +298,7 @@ RequestSigner.prototype.canonicalHeaders = function() {
|
||||
return header.toString().trim().replace(/\s+/g, ' ')
|
||||
}
|
||||
return Object.keys(headers)
|
||||
.filter(function(key) { return HEADERS_TO_IGNORE[key.toLowerCase()] == null })
|
||||
.sort(function(a, b) { return a.toLowerCase() < b.toLowerCase() ? -1 : 1 })
|
||||
.map(function(key) { return key.toLowerCase() + ':' + trimAll(headers[key]) })
|
||||
.join('\n')
|
||||
@@ -292,6 +307,7 @@ RequestSigner.prototype.canonicalHeaders = function() {
|
||||
RequestSigner.prototype.signedHeaders = function() {
|
||||
return Object.keys(this.request.headers)
|
||||
.map(function(key) { return key.toLowerCase() })
|
||||
.filter(function(key) { return HEADERS_TO_IGNORE[key] == null })
|
||||
.sort()
|
||||
.join(';')
|
||||
}
|
||||
|
14
node_modules/aws4/package.json
generated
vendored
14
node_modules/aws4/package.json
generated
vendored
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"_from": "aws4@^1.8.0",
|
||||
"_id": "aws4@1.10.0",
|
||||
"_id": "aws4@1.11.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-3YDiu347mtVtjpyV3u5kVqQLP242c06zwDOgpeRnybmXlYYsLbtTrUBUm8i8srONt+FWobl5aibnU1030PeeuA==",
|
||||
"_integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==",
|
||||
"_location": "/aws4",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
@@ -18,8 +18,8 @@
|
||||
"_requiredBy": [
|
||||
"/request"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/aws4/-/aws4-1.10.0.tgz",
|
||||
"_shasum": "a17b3a8ea811060e74d47d306122400ad4497ae2",
|
||||
"_resolved": "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz",
|
||||
"_shasum": "d61f46d83b2519250e2784daf5b09479a8b41c59",
|
||||
"_spec": "aws4@^1.8.0",
|
||||
"_where": "D:\\Projects\\minifyfromhtml\\node_modules\\request",
|
||||
"author": {
|
||||
@@ -34,8 +34,8 @@
|
||||
"deprecated": false,
|
||||
"description": "Signs and prepares requests using AWS Signature Version 4",
|
||||
"devDependencies": {
|
||||
"mocha": "^7.1.2",
|
||||
"should": "^13.2.3"
|
||||
"mocha": "^2.5.3",
|
||||
"should": "^8.4.0"
|
||||
},
|
||||
"homepage": "https://github.com/mhart/aws4#readme",
|
||||
"license": "MIT",
|
||||
@@ -49,5 +49,5 @@
|
||||
"integration": "node ./test/slow.js",
|
||||
"test": "mocha ./test/fast.js -R list"
|
||||
},
|
||||
"version": "1.10.0"
|
||||
"version": "1.11.0"
|
||||
}
|
||||
|
Reference in New Issue
Block a user