@tinycloud/cli 1.2.2-beta.1 → 1.2.2-beta.2
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 +6 -1
- package/dist/index.js.map +1 -1
- package/dist/legacy-entry.js +24 -26
- package/dist/legacy-entry.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -7843,6 +7843,7 @@ __export(sdk_exports, {
|
|
|
7843
7843
|
storedSessionVerifiesLocally: () => storedSessionVerifiesLocally
|
|
7844
7844
|
});
|
|
7845
7845
|
import { TinyCloudNode, signedCompactUcanExpiry } from "@tinycloud/node-sdk";
|
|
7846
|
+
import { ownerSessionLacksProof } from "@tinycloud/operations/profile";
|
|
7846
7847
|
function jwkHasPrivateParameter(jwk) {
|
|
7847
7848
|
if (!jwk || typeof jwk !== "object") return false;
|
|
7848
7849
|
const d = jwk.d;
|
|
@@ -7874,11 +7875,15 @@ function signedLifetimePassed(delegation) {
|
|
|
7874
7875
|
return expiry !== void 0 && expiry.getTime() <= Date.now();
|
|
7875
7876
|
}
|
|
7876
7877
|
async function restoreProfileSession(node, profileName, profile, sessionData) {
|
|
7878
|
+
const posture = profile === null ? void 0 : resolveProfilePosture(profile);
|
|
7879
|
+
if (ownerSessionLacksProof(sessionData, profile)) {
|
|
7880
|
+
throw sessionExpiredError(profileName, posture);
|
|
7881
|
+
}
|
|
7877
7882
|
try {
|
|
7878
7883
|
await node.restoreSession(sessionData);
|
|
7879
7884
|
} catch (error) {
|
|
7880
7885
|
if (typeof error === "object" && error !== null && "code" in error && error.code === "AUTH_EXPIRED") {
|
|
7881
|
-
throw sessionExpiredError(profileName,
|
|
7886
|
+
throw sessionExpiredError(profileName, posture);
|
|
7882
7887
|
}
|
|
7883
7888
|
throw error;
|
|
7884
7889
|
}
|