@netlify/plugin-nextjs 5.14.7 → 5.15.0
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.
|
@@ -56,7 +56,8 @@ function shouldEnableSkewProtection(ctx) {
|
|
|
56
56
|
enabledOrDisabledReason: "off-default" /* OPT_OUT_DEFAULT */
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
|
-
|
|
59
|
+
const token = process.env.NETLIFY_SKEW_PROTECTION_TOKEN || process.env.DEPLOY_ID;
|
|
60
|
+
if ((!token || token === "0") && optInOptions.has(enabledOrDisabledReason)) {
|
|
60
61
|
return {
|
|
61
62
|
enabled: false,
|
|
62
63
|
enabledOrDisabledReason: enabledOrDisabledReason === "on-env-var" /* OPT_IN_ENV_VAR */ && ctx.constants.IS_LOCAL ? (
|
|
@@ -66,16 +67,18 @@ function shouldEnableSkewProtection(ctx) {
|
|
|
66
67
|
// this is silent disablement to avoid spam logs for users opted in via feature flag
|
|
67
68
|
// that don't explicitly opt in via env var
|
|
68
69
|
"off-no-valid-deploy-id" /* OPT_OUT_NO_VALID_DEPLOY_ID */
|
|
69
|
-
)
|
|
70
|
+
),
|
|
71
|
+
token
|
|
70
72
|
};
|
|
71
73
|
}
|
|
72
74
|
return {
|
|
73
75
|
enabled: optInOptions.has(enabledOrDisabledReason),
|
|
74
|
-
enabledOrDisabledReason
|
|
76
|
+
enabledOrDisabledReason,
|
|
77
|
+
token
|
|
75
78
|
};
|
|
76
79
|
}
|
|
77
80
|
var setSkewProtection = async (ctx, span) => {
|
|
78
|
-
const { enabled, enabledOrDisabledReason } = shouldEnableSkewProtection(ctx);
|
|
81
|
+
const { enabled, enabledOrDisabledReason, token } = shouldEnableSkewProtection(ctx);
|
|
79
82
|
span.setAttribute("skewProtection", enabledOrDisabledReason);
|
|
80
83
|
if (!enabled) {
|
|
81
84
|
if (enabledOrDisabledReason === "off-no-valid-deploy-id-env-var" /* OPT_OUT_NO_VALID_DEPLOY_ID_ENV_VAR */) {
|
|
@@ -92,7 +95,7 @@ var setSkewProtection = async (ctx, span) => {
|
|
|
92
95
|
} else {
|
|
93
96
|
console.log("Setting up Next.js Skew Protection.");
|
|
94
97
|
}
|
|
95
|
-
process.env.NEXT_DEPLOYMENT_ID =
|
|
98
|
+
process.env.NEXT_DEPLOYMENT_ID = token;
|
|
96
99
|
await mkdir(dirname(ctx.skewProtectionConfigPath), {
|
|
97
100
|
recursive: true
|
|
98
101
|
});
|
|
@@ -86,7 +86,7 @@ var pipeline = (0, import_util.promisify)(import_stream.pipeline);
|
|
|
86
86
|
|
|
87
87
|
// package.json
|
|
88
88
|
var name = "@netlify/plugin-nextjs";
|
|
89
|
-
var version = "5.
|
|
89
|
+
var version = "5.15.0";
|
|
90
90
|
|
|
91
91
|
// src/run/handlers/tags-handler.cts
|
|
92
92
|
var import_storage = require("../storage/storage.cjs");
|