@nocode-factory/sanity-kit 2.11.0 → 2.13.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.
- package/README.md +13 -0
- package/bin/check-environments.mjs +227 -0
- package/bin/ncf-kit.mjs +14 -0
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/web-server.js +38 -11
- package/dist/web-server.js.map +1 -1
- package/dist/web.js +44 -3
- package/dist/web.js.map +1 -1
- package/package.json +1 -1
- package/src/hooks/useOpenOnline.ts +5 -3
- package/src/web/PreviewBanner.tsx +67 -2
- package/src/web/previewGrant.ts +51 -17
package/README.md
CHANGED
|
@@ -105,6 +105,19 @@ Les outils de schéma sont aussi dans l'entrée `@nocode-factory/sanity-kit/sche
|
|
|
105
105
|
|
|
106
106
|
`npx ncf-kit doctor` vérifie chaque branchement.
|
|
107
107
|
|
|
108
|
+
## Test prod / préprod (bloquant)
|
|
109
|
+
|
|
110
|
+
Le kit livre le test qui garantit que la production n'affiche **jamais** de brouillon
|
|
111
|
+
et que la préproduction reste privée. Dans le `package.json` du site :
|
|
112
|
+
|
|
113
|
+
```json
|
|
114
|
+
"postbuild": "ncf-kit check-environments"
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Après chaque `next build` (donc à chaque déploiement Vercel), il démarre le site construit
|
|
118
|
+
en production puis en préproduction simulées et fait 25 contrôles. Un seul échec fait
|
|
119
|
+
échouer le build : rien n'est mis en ligne. `--page <chemin>` choisit la page témoin.
|
|
120
|
+
|
|
108
121
|
## Documentation
|
|
109
122
|
|
|
110
123
|
Dans le dépôt `nocode-factory/ncf-sanity-kit` : `docs/INSTALL.md` (options),
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
// CONTRÔLE PROD / PRÉPROD (cœur du dispositif) : `npx ncf-kit check-environments`,
|
|
2
|
+
// depuis le dossier du site, APRÈS `next build` (script postbuild). Un déploiement qui
|
|
3
|
+
// laisserait fuir un brouillon en production, ou ouvrirait la préproduction sans
|
|
4
|
+
// laissez-passer, échoue au build : il n'est jamais mis en ligne.
|
|
5
|
+
//
|
|
6
|
+
// Démarre le site construit deux fois, avec l'environnement Vercel simulé :
|
|
7
|
+
// - production (VERCEL_ENV=production) : ne montre JAMAIS de brouillons, même avec un
|
|
8
|
+
// cookie de mode brouillon parfaitement valide (forgé à partir du build) ;
|
|
9
|
+
// - préproduction (VERCEL_ENV=preview) : privée (clé de partage ou session signée),
|
|
10
|
+
// bascule brouillons / en ligne fiable dans les deux sens.
|
|
11
|
+
// Sans réseau ni dépendance au contenu. Prérequis côté site (le starter les a) :
|
|
12
|
+
// - routes /api/draft-mode/enable (ncfEnableDraftMode) et /toggle (ncfDraftModeToggle) ;
|
|
13
|
+
// - garde ncfPreviewGuard dans le proxy / middleware ;
|
|
14
|
+
// - <meta name="ncf-data" content={await dataPerspective()} /> dans le layout ;
|
|
15
|
+
// - une page témoin statique (--page, défaut /design-system/options sinon /).
|
|
16
|
+
import { spawn } from "node:child_process";
|
|
17
|
+
import { createServer } from "node:net";
|
|
18
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
19
|
+
import { webcrypto as crypto } from "node:crypto";
|
|
20
|
+
|
|
21
|
+
const args = process.argv.slice(2);
|
|
22
|
+
const flag = (name) => {
|
|
23
|
+
const i = args.indexOf(`--${name}`);
|
|
24
|
+
return i >= 0 ? args[i + 1] : undefined;
|
|
25
|
+
};
|
|
26
|
+
const PAGE = flag("page") ?? (existsSync("app/[locale]/design-system/options") || existsSync("app/design-system/options") ? "/design-system/options" : "/");
|
|
27
|
+
const SECRET = "ncf-test-environments";
|
|
28
|
+
const failures = [];
|
|
29
|
+
let passed = 0;
|
|
30
|
+
|
|
31
|
+
function check(name, ok, detail = "") {
|
|
32
|
+
if (ok) passed++;
|
|
33
|
+
else failures.push(`${name}${detail ? ` (${detail})` : ""}`);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const freePort = () =>
|
|
37
|
+
new Promise((resolve, reject) => {
|
|
38
|
+
const srv = createServer();
|
|
39
|
+
srv.once("error", reject);
|
|
40
|
+
srv.listen(0, () => {
|
|
41
|
+
const { port } = srv.address();
|
|
42
|
+
srv.close(() => resolve(port));
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
// Identifiant du mode brouillon de CE build : un vrai cookie __prerender_bypass.
|
|
47
|
+
if (!existsSync(".next/prerender-manifest.json")) {
|
|
48
|
+
console.error("✖ Contrôle des environnements : aucun build (.next) ici. Lancer après `next build`, depuis le dossier du site.");
|
|
49
|
+
process.exit(1);
|
|
50
|
+
}
|
|
51
|
+
const previewModeId = JSON.parse(readFileSync(".next/prerender-manifest.json", "utf8")).preview?.previewModeId;
|
|
52
|
+
if (!previewModeId) {
|
|
53
|
+
console.error("✖ Contrôle des environnements : previewModeId introuvable (.next/prerender-manifest.json)");
|
|
54
|
+
process.exit(1);
|
|
55
|
+
}
|
|
56
|
+
if (!existsSync("node_modules/next/dist/bin/next")) {
|
|
57
|
+
console.error("✖ Contrôle des environnements : lancer depuis le dossier du site Next.js (node_modules/next introuvable)");
|
|
58
|
+
process.exit(1);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// Même signature que le kit (previewSession.ts) : HMAC-SHA256, base64url.
|
|
62
|
+
async function sign(secret, expires) {
|
|
63
|
+
const enc = new TextEncoder();
|
|
64
|
+
const key = await crypto.subtle.importKey("raw", enc.encode(secret), { name: "HMAC", hash: "SHA-256" }, false, ["sign"]);
|
|
65
|
+
const sig = Buffer.from(await crypto.subtle.sign("HMAC", key, enc.encode(`ncf-preview-session:${expires}`))).toString("base64url");
|
|
66
|
+
return `${expires}.${sig}`;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
async function start(vercelEnv) {
|
|
70
|
+
const port = await freePort();
|
|
71
|
+
// Environnement « nu » (comme postbuild-check) + VERCEL_ENV simulé + clé de test.
|
|
72
|
+
const env = Object.fromEntries(
|
|
73
|
+
Object.entries(process.env).filter(([k]) => !/^(VERCEL|__VERCEL|NOW_|NEXT_PRIVATE|__NEXT_PRIVATE|NEXT_EDGE_RUNTIME_PROVIDER|NCF_PREVIEW_SECRET)/.test(k)),
|
|
74
|
+
);
|
|
75
|
+
env.VERCEL_ENV = vercelEnv;
|
|
76
|
+
env.NCF_PREVIEW_SECRET = SECRET;
|
|
77
|
+
const server = spawn(process.execPath, ["node_modules/next/dist/bin/next", "start", "-p", String(port)], { stdio: ["ignore", "pipe", "pipe"], env });
|
|
78
|
+
let log = "";
|
|
79
|
+
server.stdout.on("data", (d) => (log += d));
|
|
80
|
+
server.stderr.on("data", (d) => (log += d));
|
|
81
|
+
const base = `http://localhost:${port}`;
|
|
82
|
+
const deadline = Date.now() + 90_000;
|
|
83
|
+
for (;;) {
|
|
84
|
+
try {
|
|
85
|
+
const res = await fetch(`${base}/robots.txt`);
|
|
86
|
+
if (res.status < 500) break;
|
|
87
|
+
} catch {
|
|
88
|
+
/* pas encore prêt */
|
|
89
|
+
}
|
|
90
|
+
if (server.exitCode !== null || Date.now() > deadline) throw new Error(`serveur ${vercelEnv} injoignable\n${log.slice(-1500)}`);
|
|
91
|
+
await new Promise((r) => setTimeout(r, 500));
|
|
92
|
+
}
|
|
93
|
+
return { base, stop: () => server.kill("SIGTERM") };
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const get = (base, path, cookies = {}) =>
|
|
97
|
+
fetch(`${base}${path}`, {
|
|
98
|
+
redirect: "manual",
|
|
99
|
+
headers: {
|
|
100
|
+
accept: "text/html",
|
|
101
|
+
cookie: Object.entries(cookies)
|
|
102
|
+
.map(([k, v]) => `${k}=${v}`)
|
|
103
|
+
.join("; "),
|
|
104
|
+
},
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
const dataOf = async (res) => (await res.text()).match(/<meta name="ncf-data" content="(\w+)"/)?.[1] ?? null;
|
|
108
|
+
const setCookies = (res) => res.headers.getSetCookie?.() ?? [];
|
|
109
|
+
/** Cookies posés (valeur non vide, non expirés) par une réponse. */
|
|
110
|
+
function applied(res) {
|
|
111
|
+
const out = {};
|
|
112
|
+
for (const line of setCookies(res)) {
|
|
113
|
+
const [pair, ...attrs] = line.split(";");
|
|
114
|
+
const [name, ...v] = pair.split("=");
|
|
115
|
+
const value = v.join("=");
|
|
116
|
+
const expired = attrs.some((a) => /expires=thu, 01 jan 1970/i.test(a) || /max-age=0\b/i.test(a.trim()));
|
|
117
|
+
out[name.trim()] = expired || !value ? null : value;
|
|
118
|
+
}
|
|
119
|
+
return out;
|
|
120
|
+
}
|
|
121
|
+
const merge = (jar, res) => {
|
|
122
|
+
const next = { ...jar };
|
|
123
|
+
for (const [k, v] of Object.entries(applied(res))) {
|
|
124
|
+
if (v === null) delete next[k];
|
|
125
|
+
else next[k] = v;
|
|
126
|
+
}
|
|
127
|
+
return next;
|
|
128
|
+
};
|
|
129
|
+
const sameOrigin = (base, res) => {
|
|
130
|
+
const loc = res.headers.get("location");
|
|
131
|
+
return !!loc && new URL(loc, base).origin === new URL(base).origin;
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
const prod = await start("production");
|
|
135
|
+
const pre = await start("preview");
|
|
136
|
+
try {
|
|
137
|
+
// ---------- PRODUCTION : jamais de brouillons ----------
|
|
138
|
+
{
|
|
139
|
+
const { base } = prod;
|
|
140
|
+
const plain = await get(base, PAGE);
|
|
141
|
+
check("prod : page servie", plain.status === 200, `HTTP ${plain.status}`);
|
|
142
|
+
const html = await plain.text();
|
|
143
|
+
if (!/<meta name="ncf-data"/.test(html)) throw new Error(`<meta name="ncf-data"> absent de ${PAGE} : l'ajouter au layout (content={await dataPerspective()}), ou choisir une autre page avec --page`);
|
|
144
|
+
check("prod : données en ligne", /<meta name="ncf-data" content="published"/.test(html));
|
|
145
|
+
// Le bandeau est figé au build dans les pages statiques : vérifiable seulement quand
|
|
146
|
+
// CE build est celui de la production (postbuild sur Vercel, VERCEL_ENV=production).
|
|
147
|
+
if (process.env.VERCEL_ENV === "production") check("prod : pas de bandeau de préversion", !/aria-label="Données affichées"/.test(html));
|
|
148
|
+
|
|
149
|
+
const forged = await get(base, PAGE, { __prerender_bypass: previewModeId, "sanity-preview-perspective": "drafts" });
|
|
150
|
+
check("prod : cookie de mode brouillon VALIDE ignoré (données en ligne)", (await dataOf(forged)) === "published", `HTTP ${forged.status}`);
|
|
151
|
+
|
|
152
|
+
const enable = await get(base, `/api/draft-mode/enable?sanity-preview-secret=x&sanity-preview-pathname=${encodeURIComponent(PAGE)}`);
|
|
153
|
+
const enableSet = setCookies(enable).join("\n");
|
|
154
|
+
check("prod : activation du brouillon sans effet (redirige vers la page)", enable.status >= 300 && enable.status < 400 && sameOrigin(base, enable), `HTTP ${enable.status}`);
|
|
155
|
+
check("prod : l'activation ne pose aucun cookie de brouillon valide", !enableSet.includes(previewModeId) && applied(enable).__prerender_bypass == null);
|
|
156
|
+
|
|
157
|
+
const evil = await get(base, `/api/draft-mode/enable?sanity-preview-pathname=${encodeURIComponent("//evil.example/x")}`);
|
|
158
|
+
check("prod : pas de redirection ouverte (activation)", sameOrigin(base, evil), evil.headers.get("location") ?? "");
|
|
159
|
+
|
|
160
|
+
const toggle = await get(base, "/api/draft-mode/toggle?enable=true&redirect=/");
|
|
161
|
+
check("prod : bascule refusée (403)", toggle.status === 403, `HTTP ${toggle.status}`);
|
|
162
|
+
check("prod : la bascule ne pose aucun brouillon", applied(toggle).__prerender_bypass == null);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
// ---------- PRÉPRODUCTION : privée, bascule fiable ----------
|
|
166
|
+
{
|
|
167
|
+
const { base } = pre;
|
|
168
|
+
const anon = await get(base, PAGE);
|
|
169
|
+
check("préprod : refusée sans laissez-passer (401)", anon.status === 401, `HTTP ${anon.status}`);
|
|
170
|
+
check("préprod : refus non indexable", (anon.headers.get("x-robots-tag") ?? "").includes("noindex"));
|
|
171
|
+
|
|
172
|
+
const draftOnly = await get(base, PAGE, { __prerender_bypass: previewModeId, "sanity-preview-perspective": "drafts" });
|
|
173
|
+
check("préprod : un cookie de brouillon seul n'ouvre pas", draftOnly.status === 401, `HTTP ${draftOnly.status}`);
|
|
174
|
+
|
|
175
|
+
const fakeKey = await get(base, `${PAGE}?ncf_preview=cle-inventee`);
|
|
176
|
+
check("préprod : clé de partage inventée refusée", fakeKey.status === 401, `HTTP ${fakeKey.status}`);
|
|
177
|
+
|
|
178
|
+
const now = Date.now();
|
|
179
|
+
const badSession = await get(base, PAGE, { ncf_preview_session: await sign("mauvaise-cle", now + 3_600_000) });
|
|
180
|
+
check("préprod : session falsifiée refusée", badSession.status === 401, `HTTP ${badSession.status}`);
|
|
181
|
+
const expired = await get(base, PAGE, { ncf_preview_session: await sign(SECRET, now - 1000) });
|
|
182
|
+
check("préprod : session expirée refusée", expired.status === 401, `HTTP ${expired.status}`);
|
|
183
|
+
|
|
184
|
+
let jar = { ncf_preview_session: await sign(SECRET, now + 3_600_000) };
|
|
185
|
+
const live = await get(base, PAGE, jar);
|
|
186
|
+
check("préprod : session valide acceptée", live.status === 200, `HTTP ${live.status}`);
|
|
187
|
+
const liveHtml = await live.text();
|
|
188
|
+
check("préprod : par défaut, données en ligne", /<meta name="ncf-data" content="published"/.test(liveHtml));
|
|
189
|
+
// Même raison que pour la prod : le bandeau est figé au build ; un build de
|
|
190
|
+
// production (VERCEL_ENV=production) n'en contient pas, même servi en préprod simulée.
|
|
191
|
+
if (process.env.VERCEL_ENV !== "production") check("préprod : bandeau de préversion présent", /aria-label="Données affichées"/.test(liveHtml));
|
|
192
|
+
|
|
193
|
+
const on = await get(base, `/api/draft-mode/toggle?enable=true&redirect=${encodeURIComponent(PAGE)}`, jar);
|
|
194
|
+
check("préprod : bascule « Brouillons » redirige vers la page", on.status >= 300 && on.status < 400 && sameOrigin(base, on), `HTTP ${on.status}`);
|
|
195
|
+
jar = merge(jar, on);
|
|
196
|
+
check("préprod : « Brouillons » pose la perspective brouillons", jar["sanity-preview-perspective"] === "drafts");
|
|
197
|
+
check("préprod : « Brouillons » → données brouillons", (await dataOf(await get(base, PAGE, jar))) === "drafts");
|
|
198
|
+
|
|
199
|
+
const off = await get(base, `/api/draft-mode/toggle?enable=false&redirect=${encodeURIComponent(PAGE)}`, jar);
|
|
200
|
+
jar = merge(jar, off);
|
|
201
|
+
check("préprod : « En ligne » → données en ligne", (await dataOf(await get(base, PAGE, jar))) === "published");
|
|
202
|
+
|
|
203
|
+
// Venant de Presentation en « publié », « Brouillons » doit bien montrer les brouillons.
|
|
204
|
+
let fromPresentation = { ...jar, __prerender_bypass: previewModeId, "sanity-preview-perspective": "published" };
|
|
205
|
+
check("préprod : aperçu Presentation « publié » → données en ligne", (await dataOf(await get(base, PAGE, fromPresentation))) === "published");
|
|
206
|
+
const again = await get(base, `/api/draft-mode/toggle?enable=true&redirect=${encodeURIComponent(PAGE)}`, fromPresentation);
|
|
207
|
+
fromPresentation = merge(fromPresentation, again);
|
|
208
|
+
check("préprod : puis « Brouillons » → données brouillons", (await dataOf(await get(base, PAGE, fromPresentation))) === "drafts");
|
|
209
|
+
|
|
210
|
+
const open = await get(base, `/api/draft-mode/toggle?enable=true&redirect=${encodeURIComponent("//evil.example")}`, jar);
|
|
211
|
+
check("préprod : pas de redirection ouverte (bascule)", sameOrigin(base, open), open.headers.get("location") ?? "");
|
|
212
|
+
|
|
213
|
+
const badEnable = await get(base, `/api/draft-mode/enable?sanity-preview-secret=faux&sanity-preview-pathname=${encodeURIComponent(PAGE)}`);
|
|
214
|
+
check("préprod : secret Presentation invalide → ni brouillon ni session", !(badEnable.status >= 300 && badEnable.status < 400) && applied(badEnable).ncf_preview_session == null && applied(badEnable).__prerender_bypass == null, `HTTP ${badEnable.status}`);
|
|
215
|
+
}
|
|
216
|
+
} catch (err) {
|
|
217
|
+
failures.push(`erreur : ${err.message}`);
|
|
218
|
+
} finally {
|
|
219
|
+
prod.stop();
|
|
220
|
+
pre.stop();
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
if (failures.length) {
|
|
224
|
+
console.error(`\n✖ Prod / préprod : ${failures.length} échec(s), ${passed} contrôle(s) réussi(s) :\n${failures.map((f) => ` ✖ ${f}`).join("\n")}\n`);
|
|
225
|
+
process.exit(1);
|
|
226
|
+
}
|
|
227
|
+
console.log(`✓ Prod / préprod : ${passed} contrôles (jamais de brouillon en prod, préprod privée, bascule fiable)`);
|
package/bin/ncf-kit.mjs
CHANGED
|
@@ -33,6 +33,7 @@ function usage(code = 0) {
|
|
|
33
33
|
console.log(`Usage :
|
|
34
34
|
npx ncf-kit setup --types page,homePage [options] active le projet, clé du journal, webhook
|
|
35
35
|
npx ncf-kit doctor [--web <dossier>] [--offline] vérifie que le projet est complet
|
|
36
|
+
npx ncf-kit check-environments [--page <chemin>] test prod / préprod, BLOQUANT (postbuild du site)
|
|
36
37
|
|
|
37
38
|
Depuis le dossier du studio (celui de sanity.config.ts et de .env).
|
|
38
39
|
|
|
@@ -311,6 +312,16 @@ async function doctor() {
|
|
|
311
312
|
toggle ? ok('Bascule brouillons', toggle.replace(root + '/', '')) : ko('Bascule brouillons', 'app/api/draft-mode/toggle/route.ts : export const {GET} = ncfDraftModeToggle()')
|
|
312
313
|
const guard = findUsage(files, 'ncfPreviewGuard')
|
|
313
314
|
guard ? ok('Garde de préproduction', guard.replace(root + '/', '')) : ko('Garde de préproduction', 'ncfPreviewGuard absent de proxy.ts (ou middleware.ts) : la préproduction serait publique.')
|
|
315
|
+
const enable = findUsage(files, 'ncfEnableDraftMode')
|
|
316
|
+
enable ? ok('Activation du brouillon', enable.replace(root + '/', '')) : ko('Activation du brouillon', "app/api/draft-mode/enable/route.ts doit envelopper defineEnableDraftMode dans ncfEnableDraftMode(...) : sinon la production peut activer les brouillons.")
|
|
317
|
+
const meta = findUsage(files, 'name="ncf-data"')
|
|
318
|
+
meta ? ok('Témoin des données', meta.replace(root + '/', '')) : ko('Témoin des données', 'layout sans <meta name="ncf-data" content={await dataPerspective()} /> : le test prod / préprod ne peut pas lire les données affichées.')
|
|
319
|
+
// Le test prod / préprod doit tourner à CHAQUE build (postbuild), pour qu'un
|
|
320
|
+
// déploiement qui laisserait fuir un brouillon échoue au lieu d'être mis en ligne.
|
|
321
|
+
const scripts = JSON.parse(webPkg).scripts ?? {}
|
|
322
|
+
const chain = [scripts.build, scripts.postbuild].filter(Boolean).join(' ')
|
|
323
|
+
const runsCheck = /ncf-kit check-environments/.test(chain) || files.some((f) => /\.(m?js|ts)$/.test(f) && chain.includes(f.split('/').pop()) && /ncf-kit[^\n]*check-environments|check-environments/.test(read(f)))
|
|
324
|
+
runsCheck ? ok('Test prod / préprod', 'lancé après chaque build') : ko('Test prod / préprod', 'le build du site ne lance pas `ncf-kit check-environments` : ajouter "postbuild": "ncf-kit check-environments" dans package.json. Sans lui, une fuite de brouillon en production serait mise en ligne.')
|
|
314
325
|
}
|
|
315
326
|
|
|
316
327
|
/* Valeurs par défaut des composants : instances, overrides, preview */
|
|
@@ -384,6 +395,9 @@ if (command === 'setup') {
|
|
|
384
395
|
setup().catch((error) => fail(error?.message ?? String(error)))
|
|
385
396
|
} else if (command === 'doctor') {
|
|
386
397
|
doctor().catch((error) => fail(error?.message ?? String(error)))
|
|
398
|
+
} else if (command === 'check-environments') {
|
|
399
|
+
// Script autonome (il démarre le site construit) : chargé seulement à la demande.
|
|
400
|
+
import('./check-environments.mjs').catch((error) => fail(error?.message ?? String(error)))
|
|
387
401
|
} else if (!command || command === 'help' || has('help')) {
|
|
388
402
|
usage(command ? 0 : 1)
|
|
389
403
|
} else {
|
package/dist/index.js
CHANGED
|
@@ -1621,12 +1621,12 @@ function useOpenOnline() {
|
|
|
1621
1621
|
let { projectId, dataset, token } = client.config();
|
|
1622
1622
|
if (!projectId || !dataset) throw Error("unknown_project");
|
|
1623
1623
|
let key = `${config.serviceEndpoint}|${projectId}|${dataset}`, grant = cache.get(key);
|
|
1624
|
-
(!grant || new Date(grant.expiresAt).getTime() - Date.now() <
|
|
1624
|
+
(!grant || new Date(grant.expiresAt).getTime() - Date.now() < 864e5) && (grant = await requestPreviewGrant(config.serviceEndpoint, {
|
|
1625
1625
|
projectId,
|
|
1626
1626
|
dataset,
|
|
1627
1627
|
sanityToken: token ?? "",
|
|
1628
1628
|
label: "Ouverture depuis le Studio",
|
|
1629
|
-
days:
|
|
1629
|
+
days: 30
|
|
1630
1630
|
}), cache.set(key, grant));
|
|
1631
1631
|
let signed = onlineUrl(environment, perspective, {
|
|
1632
1632
|
path: options.path,
|