@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.cjs
CHANGED
|
@@ -8559,6 +8559,9 @@ function resolvePosture(profile) {
|
|
|
8559
8559
|
function isLocalOwnerProfile(profile) {
|
|
8560
8560
|
return resolvePosture(profile) === "local-owner-key" || profile.authMethod === "local" || typeof profile.privateKey === "string";
|
|
8561
8561
|
}
|
|
8562
|
+
function ownerSessionLacksProof(session, profile) {
|
|
8563
|
+
return profile !== null && resolvePosture(profile) === "owner-openkey" && (typeof session.siwe !== "string" || typeof session.signature !== "string");
|
|
8564
|
+
}
|
|
8562
8565
|
function profileNotFound2(profile) {
|
|
8563
8566
|
return {
|
|
8564
8567
|
ok: false,
|
|
@@ -8694,6 +8697,12 @@ async function createInvocationRuntime(target, requirement = "authenticated") {
|
|
|
8694
8697
|
"The selected profile does not have an active session."
|
|
8695
8698
|
));
|
|
8696
8699
|
}
|
|
8700
|
+
} else if (ownerSessionLacksProof(activeSession, profile)) {
|
|
8701
|
+
return failed(summary, operationError(
|
|
8702
|
+
"AUTH_REQUIRED",
|
|
8703
|
+
"The stored OpenKey session has no signed proof. Sign in again.",
|
|
8704
|
+
{ retryable: false, details: { recovery: signInRecovery(profileName, summary.posture) } }
|
|
8705
|
+
));
|
|
8697
8706
|
} else {
|
|
8698
8707
|
try {
|
|
8699
8708
|
await node.restoreSession(activeSession);
|
|
@@ -8789,6 +8798,13 @@ async function createRestoredRuntime(target, resolved) {
|
|
|
8789
8798
|
{ details: { recovery: signInRecovery(profileName, summary.posture) } }
|
|
8790
8799
|
));
|
|
8791
8800
|
}
|
|
8801
|
+
if (ownerSessionLacksProof(activeSession, profile)) {
|
|
8802
|
+
return failed(summary, operationError(
|
|
8803
|
+
"AUTH_REQUIRED",
|
|
8804
|
+
"The stored OpenKey session has no signed proof. Sign in again.",
|
|
8805
|
+
{ retryable: false, details: { recovery: signInRecovery(profileName, summary.posture) } }
|
|
8806
|
+
));
|
|
8807
|
+
}
|
|
8792
8808
|
if (!await bindingMigrationRecorded(profileName)) {
|
|
8793
8809
|
const records = await readAdditionalDelegations(profileName);
|
|
8794
8810
|
if (records.some(
|