@tinycloud/operations 0.5.1 → 0.5.2-beta.1
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/cli-runtime.cjs +16 -0
- package/dist/cli-runtime.cjs.map +1 -1
- package/dist/cli-runtime.js +16 -0
- package/dist/cli-runtime.js.map +1 -1
- package/dist/index.cjs +16 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -1
- package/dist/profile.cjs +5 -0
- package/dist/profile.cjs.map +1 -1
- package/dist/profile.d.cts +16 -1
- package/dist/profile.d.ts +16 -1
- package/dist/profile.js +4 -0
- package/dist/profile.js.map +1 -1
- package/package.json +2 -2
package/dist/cli-runtime.js
CHANGED
|
@@ -8570,6 +8570,9 @@ function resolvePosture(profile) {
|
|
|
8570
8570
|
function isLocalOwnerProfile(profile) {
|
|
8571
8571
|
return resolvePosture(profile) === "local-owner-key" || profile.authMethod === "local" || typeof profile.privateKey === "string";
|
|
8572
8572
|
}
|
|
8573
|
+
function ownerSessionLacksProof(session, profile) {
|
|
8574
|
+
return profile !== null && resolvePosture(profile) === "owner-openkey" && (typeof session.siwe !== "string" || typeof session.signature !== "string");
|
|
8575
|
+
}
|
|
8573
8576
|
function profileNotFound2(profile) {
|
|
8574
8577
|
return {
|
|
8575
8578
|
ok: false,
|
|
@@ -8706,6 +8709,12 @@ async function createInvocationRuntime(target, requirement = "authenticated") {
|
|
|
8706
8709
|
"The selected profile does not have an active session."
|
|
8707
8710
|
));
|
|
8708
8711
|
}
|
|
8712
|
+
} else if (ownerSessionLacksProof(activeSession, profile)) {
|
|
8713
|
+
return failed(summary, operationError(
|
|
8714
|
+
"AUTH_REQUIRED",
|
|
8715
|
+
"The stored OpenKey session has no signed proof. Sign in again.",
|
|
8716
|
+
{ retryable: false, details: { recovery: signInRecovery(profileName, summary.posture) } }
|
|
8717
|
+
));
|
|
8709
8718
|
} else {
|
|
8710
8719
|
try {
|
|
8711
8720
|
await node.restoreSession(activeSession);
|
|
@@ -8801,6 +8810,13 @@ async function createRestoredRuntime(target, resolved) {
|
|
|
8801
8810
|
{ details: { recovery: signInRecovery(profileName, summary.posture) } }
|
|
8802
8811
|
));
|
|
8803
8812
|
}
|
|
8813
|
+
if (ownerSessionLacksProof(activeSession, profile)) {
|
|
8814
|
+
return failed(summary, operationError(
|
|
8815
|
+
"AUTH_REQUIRED",
|
|
8816
|
+
"The stored OpenKey session has no signed proof. Sign in again.",
|
|
8817
|
+
{ retryable: false, details: { recovery: signInRecovery(profileName, summary.posture) } }
|
|
8818
|
+
));
|
|
8819
|
+
}
|
|
8804
8820
|
if (!await bindingMigrationRecorded(profileName)) {
|
|
8805
8821
|
const records = await readAdditionalDelegations(profileName);
|
|
8806
8822
|
if (records.some(
|