serverless-offline 13.9.0 → 13.10.1

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,14 +1,18 @@
1
1
  {
2
2
  "name": "serverless-offline",
3
- "version": "13.9.0",
3
+ "version": "13.10.1",
4
4
  "description": "Emulate AWS λ and API Gateway locally when developing your Serverless project",
5
5
  "license": "MIT",
6
6
  "exports": {
7
- ".": "./src/index.js",
7
+ ".": {
8
+ "import": "./src/index.js",
9
+ "require": "./src/index.cjs",
10
+ "default": "./src/index.js"
11
+ },
8
12
  "./lambda": "./src/lambda/index.js"
9
13
  },
10
14
  "type": "module",
11
- "main": "src/index.js",
15
+ "main": "src/index.cjs",
12
16
  "scripts": {
13
17
  "code-quality": "npm run prettier && npm run lint",
14
18
  "lint": "eslint .",
@@ -16,11 +16,14 @@ export const supportedRuntimesArchitecture = {
16
16
  "nodejs18.x": [ARM64, X86_64],
17
17
  "nodejs20.x": [ARM64, X86_64],
18
18
  "nodejs22.x": [ARM64, X86_64],
19
+ "nodejs24.x": [ARM64, X86_64],
19
20
  "python3.7": [X86_64],
20
21
  "python3.8": [ARM64, X86_64],
21
22
  "python3.9": [ARM64, X86_64],
22
23
  "python3.10": [ARM64, X86_64],
23
24
  "python3.11": [ARM64, X86_64],
25
+ "python3.12": [ARM64, X86_64],
26
+ "python3.13": [ARM64, X86_64],
24
27
  "ruby2.7": [ARM64, X86_64],
25
28
  "ruby3.2": [ARM64, X86_64],
26
29
  java8: [X86_64],
@@ -48,6 +51,7 @@ export const supportedNodejs = new Set([
48
51
  "nodejs18.x",
49
52
  "nodejs20.x",
50
53
  "nodejs22.x",
54
+ "nodejs24.x",
51
55
  ])
52
56
 
53
57
  // PROVIDED
@@ -64,6 +68,8 @@ export const supportedPython = new Set([
64
68
  "python3.9",
65
69
  "python3.10",
66
70
  "python3.11",
71
+ "python3.12",
72
+ "python3.13",
67
73
  ])
68
74
 
69
75
  // RUBY
@@ -2,7 +2,7 @@ import { Buffer } from "node:buffer"
2
2
  import { readFile } from "node:fs/promises"
3
3
  import { createRequire } from "node:module"
4
4
  import { join, resolve } from "node:path"
5
- import { exit } from "node:process"
5
+ import { exit, env } from "node:process"
6
6
  import h2o2 from "@hapi/h2o2"
7
7
  import { Server } from "@hapi/hapi"
8
8
  import { log } from "../../utils/log.js"
@@ -613,7 +613,27 @@ export default class HttpServer {
613
613
  const hasCustomAuthProvider =
614
614
  customizations?.offline?.customAuthenticationProvider
615
615
 
616
- if (!endpoint.authorizer && !hasCustomAuthProvider) {
616
+ const authorizerOverrideHeader =
617
+ request.headers["sls-offline-authorizer-override"]
618
+ const authorizerOverrideEnv = env.AUTHORIZER
619
+ const hasAuthorizerOverride = [
620
+ authorizerOverrideHeader,
621
+ authorizerOverrideEnv,
622
+ ].some((value) => {
623
+ if (!value) return false
624
+ try {
625
+ parse(value)
626
+ return true
627
+ } catch {
628
+ return false
629
+ }
630
+ })
631
+
632
+ if (
633
+ !endpoint.authorizer &&
634
+ !hasCustomAuthProvider &&
635
+ !hasAuthorizerOverride
636
+ ) {
617
637
  log.debug("no authorizer configured, deleting authorizer payload")
618
638
  delete event.requestContext.authorizer
619
639
  }
package/src/index.cjs ADDED
@@ -0,0 +1,3 @@
1
+ "use strict"
2
+
3
+ module.exports = require("./index.js").default
@@ -52,16 +52,14 @@ export default class HandlerRunner {
52
52
 
53
53
  if (supportedNodejs.has(runtime)) {
54
54
  if (useInProcess) {
55
- const { default: InProcessRunner } = await import(
56
- "./in-process-runner/index.js"
57
- )
55
+ const { default: InProcessRunner } =
56
+ await import("./in-process-runner/index.js")
58
57
 
59
58
  return new InProcessRunner(this.#funOptions, this.#env)
60
59
  }
61
60
 
62
- const { default: WorkerThreadRunner } = await import(
63
- "./worker-thread-runner/index.js"
64
- )
61
+ const { default: WorkerThreadRunner } =
62
+ await import("./worker-thread-runner/index.js")
65
63
 
66
64
  return new WorkerThreadRunner(this.#funOptions, this.#env)
67
65
  }