@faable/auth-sdk 2.6.2 → 2.6.4
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/dist/version.js +2 -2
- package/package.json +1 -1
- package/spec/openapi.json +1 -1
- package/tests/pack/verify-published.mjs +26 -14
package/dist/version.js
CHANGED
|
@@ -9,13 +9,13 @@
|
|
|
9
9
|
// login pages could not import the SDK at all. Same pattern as auth-js.
|
|
10
10
|
//
|
|
11
11
|
// The sentinels MUST stay byte-identical to the `from` values in `.releaserc`.
|
|
12
|
-
export const version = "2.6.
|
|
12
|
+
export const version = "2.6.4";
|
|
13
13
|
// Short git SHA of the released commit. The version dates a build; this names
|
|
14
14
|
// the exact tree, so a canonical log line or an audit entry leads straight to
|
|
15
15
|
// `git show <sha>`. Deliberately NOT hex: an unreleased build (dev, a local
|
|
16
16
|
// link) cannot be mistaken for a real commit — auth only records values that
|
|
17
17
|
// look like a SHA, and this one never will.
|
|
18
|
-
export const commit = "
|
|
18
|
+
export const commit = "6b995b1";
|
|
19
19
|
// What this SDK writes in `x-faable-client`. Exported for a consumer that
|
|
20
20
|
// builds a strategy on its own (outside `FaableAuthApi`) and still wants the
|
|
21
21
|
// token request attributed — a bare `authClientCredentials` stamps only what
|
package/package.json
CHANGED
package/spec/openapi.json
CHANGED
|
@@ -28,27 +28,39 @@ const sentinels = JSON.parse(readFileSync(join(ROOT, ".releaserc"), "utf8"))
|
|
|
28
28
|
.plugins.find((p) => Array.isArray(p) && p[0] === "semantic-release-replace-plugin")[1]
|
|
29
29
|
.replacements.map((r) => r.from);
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
// Ask the registry itself rather than `npm pack`: the packument is what
|
|
32
|
+
// propagates first, and npm's own cache on a runner can report a
|
|
33
|
+
// just-published version as missing for a while (2.6.2 was live and this
|
|
34
|
+
// guard still called it "never available"). Up to 5 minutes, because
|
|
35
|
+
// propagation is the only thing being waited on here.
|
|
36
|
+
const fetchTarballUrl = async () => {
|
|
37
|
+
const url = `https://registry.npmjs.org/${pkg.name.replace("/", "%2F")}`;
|
|
38
|
+
for (let attempt = 1; attempt <= 30; attempt++) {
|
|
36
39
|
try {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
const res = await fetch(url, { headers: { "cache-control": "no-cache" } });
|
|
41
|
+
if (res.ok) {
|
|
42
|
+
const doc = await res.json();
|
|
43
|
+
const tarball = doc.versions?.[version]?.dist?.tarball;
|
|
44
|
+
if (tarball) return tarball;
|
|
45
|
+
}
|
|
42
46
|
} catch {
|
|
43
|
-
|
|
44
|
-
execSync("sleep 10");
|
|
47
|
+
// network blip — keep waiting
|
|
45
48
|
}
|
|
49
|
+
console.log(`→ ${pkg.name}@${version} not served yet (attempt ${attempt}/30)`);
|
|
50
|
+
await new Promise((r) => setTimeout(r, 10_000));
|
|
46
51
|
}
|
|
47
|
-
|
|
52
|
+
return undefined;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
const tmp = mkdtempSync(join(tmpdir(), "faable-auth-sdk-published-"));
|
|
56
|
+
try {
|
|
57
|
+
const tarballUrl = await fetchTarballUrl();
|
|
58
|
+
if (!tarballUrl) {
|
|
48
59
|
console.error(`✖ ${pkg.name}@${version} never became available on the registry`);
|
|
49
60
|
process.exit(1);
|
|
50
61
|
}
|
|
51
|
-
|
|
62
|
+
const tarball = "published.tgz";
|
|
63
|
+
execSync(`curl -sfL "${tarballUrl}" -o ${tarball}`, { cwd: tmp });
|
|
52
64
|
execSync(`tar xzf ${tarball}`, { cwd: tmp });
|
|
53
65
|
const published = readFileSync(join(tmp, "package/dist/version.js"), "utf8");
|
|
54
66
|
for (const sentinel of sentinels) {
|