serverless-offline 11.2.1 → 11.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"dedicatedTo": "Blue, a great migrating bird.",
|
|
3
3
|
"name": "serverless-offline",
|
|
4
|
-
"version": "11.2.
|
|
4
|
+
"version": "11.2.3",
|
|
5
5
|
"description": "Emulate AWS λ and API Gateway locally when developing your Serverless project",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"exports": {
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
]
|
|
83
83
|
},
|
|
84
84
|
"dependencies": {
|
|
85
|
-
"@aws-sdk/client-lambda": "^3.
|
|
85
|
+
"@aws-sdk/client-lambda": "^3.200.0",
|
|
86
86
|
"@hapi/boom": "^10.0.0",
|
|
87
87
|
"@hapi/h2o2": "^10.0.0",
|
|
88
88
|
"@hapi/hapi": "^20.2.2",
|
|
@@ -91,13 +91,14 @@
|
|
|
91
91
|
"chalk": "^5.1.2",
|
|
92
92
|
"execa": "^6.1.0",
|
|
93
93
|
"fs-extra": "^10.1.0",
|
|
94
|
+
"is-wsl": "^2.2.0",
|
|
94
95
|
"java-invoke-local": "0.0.6",
|
|
95
|
-
"jose": "^4.10.
|
|
96
|
+
"jose": "^4.10.4",
|
|
96
97
|
"js-string-escape": "^1.0.1",
|
|
97
98
|
"jsonpath-plus": "^7.2.0",
|
|
98
99
|
"jsonschema": "^1.4.1",
|
|
99
100
|
"jszip": "^3.10.1",
|
|
100
|
-
"luxon": "^3.0
|
|
101
|
+
"luxon": "^3.1.0",
|
|
101
102
|
"node-fetch": "^3.2.10",
|
|
102
103
|
"node-schedule": "^2.1.0",
|
|
103
104
|
"object.hasown": "^1.1.1",
|
|
@@ -3,6 +3,7 @@ import { log } from '@serverless/utils/log.js'
|
|
|
3
3
|
import { decodeJwt } from 'jose'
|
|
4
4
|
|
|
5
5
|
const { isArray } = Array
|
|
6
|
+
const { now } = Date
|
|
6
7
|
|
|
7
8
|
export default function createAuthScheme(jwtOptions) {
|
|
8
9
|
const authorizerName = jwtOptions.name
|
|
@@ -38,7 +39,7 @@ export default function createAuthScheme(jwtOptions) {
|
|
|
38
39
|
const claims = decodeJwt(jwtToken)
|
|
39
40
|
|
|
40
41
|
const expirationDate = new Date(claims.exp * 1000)
|
|
41
|
-
if (expirationDate.
|
|
42
|
+
if (expirationDate.getTime() < now()) {
|
|
42
43
|
return Boom.unauthorized('JWT Token expired')
|
|
43
44
|
}
|
|
44
45
|
|
|
@@ -7,6 +7,7 @@ import { LambdaClient, GetLayerVersionCommand } from '@aws-sdk/client-lambda'
|
|
|
7
7
|
import { log, progress } from '@serverless/utils/log.js'
|
|
8
8
|
import { execa } from 'execa'
|
|
9
9
|
import { ensureDir, pathExists } from 'fs-extra'
|
|
10
|
+
import isWsl from 'is-wsl'
|
|
10
11
|
import jszip from 'jszip'
|
|
11
12
|
import pRetry from 'p-retry'
|
|
12
13
|
import DockerImage from './DockerImage.js'
|
|
@@ -148,7 +149,7 @@ export default class DockerContainer {
|
|
|
148
149
|
dockerArgs.push('-e', `${key}=${value}`)
|
|
149
150
|
})
|
|
150
151
|
|
|
151
|
-
if (platform() === 'linux') {
|
|
152
|
+
if (platform() === 'linux' && !isWsl) {
|
|
152
153
|
// Add `host.docker.internal` DNS name to access host from inside the container
|
|
153
154
|
// https://github.com/docker/for-linux/issues/264
|
|
154
155
|
const gatewayIp = await this.#getBridgeGatewayIp()
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export default function generateHapiPath(path, options, serverless) {
|
|
2
|
-
// path must start with '/'
|
|
3
2
|
let hapiPath = path.startsWith('/') ? path : `/${path}`
|
|
4
3
|
|
|
5
4
|
if (!options.noPrependStageInUrl) {
|
|
@@ -12,7 +11,7 @@ export default function generateHapiPath(path, options, serverless) {
|
|
|
12
11
|
hapiPath = `/${options.prefix}${hapiPath}`
|
|
13
12
|
}
|
|
14
13
|
|
|
15
|
-
if (hapiPath !== '/' && hapiPath.endsWith('/')
|
|
14
|
+
if (hapiPath !== '/' && hapiPath.endsWith('/')) {
|
|
16
15
|
hapiPath = hapiPath.slice(0, -1)
|
|
17
16
|
}
|
|
18
17
|
|