@tinycloud/cli 1.3.0-beta.26 → 1.3.0-beta.27
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/index.js +9 -6
- package/dist/index.js.map +1 -1
- package/dist/legacy-entry.js +9 -6
- package/dist/legacy-entry.js.map +1 -1
- package/package.json +5 -5
package/dist/legacy-entry.js
CHANGED
|
@@ -7657,12 +7657,15 @@ CREATE TABLE IF NOT EXISTS grant_install (
|
|
|
7657
7657
|
}
|
|
7658
7658
|
#storeGrantPolicy(g, policy, existing) {
|
|
7659
7659
|
const installedAt = existing?.installedAt ?? policy.at;
|
|
7660
|
+
const keepExisting = existing !== null && existing.consentDeadline < policy.consentDeadline;
|
|
7661
|
+
const consentDeadline = keepExisting ? existing.consentDeadline : policy.consentDeadline;
|
|
7662
|
+
const consentAnchor = keepExisting ? existing.consentAnchor : policy.consentAnchor;
|
|
7660
7663
|
const effectiveExpiresAt = Math.min(
|
|
7661
7664
|
g.expiresAt === null ? Infinity : g.expiresAt * 1e3,
|
|
7662
7665
|
installedAt + policy.ttlMs,
|
|
7663
|
-
|
|
7666
|
+
consentDeadline
|
|
7664
7667
|
);
|
|
7665
|
-
if (!Number.isSafeInteger(installedAt) || installedAt < 0 || !Number.isSafeInteger(effectiveExpiresAt) || effectiveExpiresAt < 0 || !Number.isSafeInteger(
|
|
7668
|
+
if (!Number.isSafeInteger(installedAt) || installedAt < 0 || !Number.isSafeInteger(effectiveExpiresAt) || effectiveExpiresAt < 0 || !Number.isSafeInteger(consentDeadline) || consentDeadline < 0 || !Number.isSafeInteger(consentAnchor.at) || consentAnchor.at < 0 || !Number.isSafeInteger(policy.ttlMs) || policy.ttlMs <= 0) {
|
|
7666
7669
|
throw new ReplicaError3(ReplicaErrorCode3.GRANT_EXPIRED, "The replica grant has no finite effective expiry.");
|
|
7667
7670
|
}
|
|
7668
7671
|
this.#db.run(
|
|
@@ -7674,11 +7677,11 @@ CREATE TABLE IF NOT EXISTS grant_install (
|
|
|
7674
7677
|
g.cid,
|
|
7675
7678
|
installedAt,
|
|
7676
7679
|
effectiveExpiresAt,
|
|
7677
|
-
|
|
7678
|
-
|
|
7679
|
-
|
|
7680
|
+
consentDeadline,
|
|
7681
|
+
consentAnchor.at,
|
|
7682
|
+
consentAnchor.source
|
|
7680
7683
|
);
|
|
7681
|
-
return { installedAt, effectiveExpiresAt, consentDeadline
|
|
7684
|
+
return { installedAt, effectiveExpiresAt, consentDeadline, consentAnchor };
|
|
7682
7685
|
}
|
|
7683
7686
|
async installGatedGrant(g, policy) {
|
|
7684
7687
|
return this.#guardedWrite("Installing the gated grant", () => {
|